Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
d31b4fe
dresources: extend ParsePostgresName for databases
pietern May 18, 2026
a97b14f
testserver: add postgres databases CRUD
pietern May 18, 2026
2aaffcf
bundle: add PostgresDatabase config resource type
pietern May 18, 2026
8c6e9f9
bundle: register postgres_databases resource
pietern May 18, 2026
7bce379
dresources: implement postgres database handler
pietern May 18, 2026
b8c1435
dresources: register postgres_databases handler and fixtures
pietern May 18, 2026
475f117
dresources: declare postgres_databases lifecycle
pietern May 18, 2026
99b0a90
bundle: terraform engine support for postgres_databases
pietern May 18, 2026
1ccb524
bundle: statemgmt and schema annotations for postgres_databases
pietern May 18, 2026
7258983
bundle: regenerate schema for postgres_databases
pietern May 18, 2026
6f9aca4
acc: postgres database basic deploy
pietern May 18, 2026
39e3781
acc: postgres database recreate on immutable change
pietern May 18, 2026
93fa246
acc: postgres database update via rename
pietern May 19, 2026
539c522
acc: cover postgres_databases with invariant configs
pietern May 19, 2026
b8bc8df
changelog: postgres_databases bundle resource
pietern May 19, 2026
3dfe94e
dresources: lint and comment polish for postgres_databases
pietern May 19, 2026
d7b0056
dresources: align postgres_databases comment with sibling phrasing
pietern May 19, 2026
36c29a7
bundle: add postgres_roles as a resource type
pietern May 19, 2026
48d1701
postgres_role: require role_id and treat 404 from GetRole as not-found
pietern May 19, 2026
efe72ff
postgres_role: include enum_fields from validation regeneration
pietern May 19, 2026
02108c6
postgres_role: only log "does not exist" on the not-found path
pietern May 19, 2026
ad485de
Merge branch 'postgres-roles' into postgres-databases
pietern May 19, 2026
cbf69bc
acc: parameterize postgres_databases role in fixtures
pietern May 19, 2026
61f98ed
acc: cover postgres_databases missing-role rejection
pietern May 19, 2026
7287089
testserver: mirror status.database_id on postgres database GET
pietern May 19, 2026
a8ca9b4
acc: portable postgres_databases role via postgres_roles
pietern May 19, 2026
58e99a2
acc: cover postgres_databases bad-role-ref and bad-database-id rejection
pietern May 19, 2026
c253582
postgres_role: prefer Status.RoleId over TrimPrefix in RemapState
pietern May 26, 2026
1bff84d
Merge remote-tracking branch 'origin/main' into postgres-roles
pietern Jun 2, 2026
dc334c7
Merge origin/main into postgres-databases
pietern Jun 2, 2026
be75fe2
Merge branch 'postgres-roles' into postgres-databases
pietern Jun 2, 2026
8768a75
postgres_role: treat postgres_role/auth_method/identity_type as recre…
pietern Jun 2, 2026
0a860a6
Merge branch 'postgres-roles' into postgres-databases
pietern Jun 2, 2026
9d89b35
Merge remote-tracking branch 'origin/main' into postgres-roles
pietern Jun 3, 2026
97fb08b
Merge branch 'postgres-roles' into postgres-databases
pietern Jun 3, 2026
e9b9043
Merge origin/main into postgres-databases
janniklasrose Jun 8, 2026
aa811bf
postgres_role: preserve role_id and parent in serialized state
janniklasrose Jun 9, 2026
dd651e9
postgres_database: return (false, nil) when the database is missing
janniklasrose Jun 9, 2026
ddeabf9
dresources: drop duplicate postgres_roles key from apitypes.yml override
janniklasrose Jun 9, 2026
f76290f
Merge remote-tracking branch 'origin/main' into postgres-databases
janniklasrose Jun 16, 2026
8cbfcaf
Merge remote-tracking branch 'origin/main' into postgres-databases
pietern Jun 16, 2026
ad3eea0
testserver: require spec.role on postgres_database create
pietern Jun 16, 2026
c03a46f
Merge remote-tracking branch 'origin/main' into postgres-databases
pietern Jun 17, 2026
b5992d4
Add postgres_database bind acceptance test; dedup postgres_roles in p…
pietern Jun 17, 2026
4561bb6
resources: postgres_database GetName returns empty, matching postgres…
pietern Jun 17, 2026
35c0bcc
Add changelog entry for Lakebase postgres_roles and postgres_databases
pietern Jun 17, 2026
c5cf109
phases: require approval to recreate or delete postgres_databases
pietern Jun 17, 2026
e0125c7
Reference the postgres_databases PR in the changelog entry
pietern Jun 17, 2026
aed3d1b
Merge remote-tracking branch 'origin/main' into postgres-databases
pietern Jun 17, 2026
7ea2ab0
postgres_databases: use provided_id_fields and minimize apitypes.yml …
pietern Jun 17, 2026
30a63e7
Drop already-released data_security_mode entry from NEXT_CHANGELOG
pietern Jun 17, 2026
717d4c1
acceptance: assert recreate deploy aborts via musterr
pietern Jun 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion NEXT_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* engine/direct: Fix WAL corruption after two consecutive failed deploys ([#5606](https://github.com/databricks/cli/pull/5606)).
* engine/direct: Don't open the deployment state WAL when a deploy's plan fails ([#5607](https://github.com/databricks/cli/pull/5607)).
* Ignore unity catalog managed schema property defaults to avoid unnecessary drift ([#5195](https://github.com/databricks/cli/pull/5195)).
* Add Postgres role as a bundle resource ([#5467](https://github.com/databricks/cli/pull/5467)).
* Add `postgres_roles` and `postgres_databases` resources to create Postgres roles and databases on a Lakebase branch ([#5467](https://github.com/databricks/cli/pull/5467), [#5627](https://github.com/databricks/cli/pull/5627)).
* direct: Stop spurious recreate/rename on redeploy when the backend normalizes a resource's name-based ID (e.g. Unity Catalog lowercasing a schema or volume name) ([#5599](https://github.com/databricks/cli/pull/5599)).

### Dependency updates
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
bundle:
name: test-bundle

resources:
postgres_databases:
database1:
parent: projects/test-project/branches/main
database_id: test-database
postgres_database: app_db

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions acceptance/bundle/deployment/bind/postgres_database/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

>>> [CLI] bundle deployment bind database1 projects/test-project/branches/main/databases/test-database --auto-approve
Updating deployment state...
Successfully bound postgres_database with an id 'projects/test-project/branches/main/databases/test-database'
Run 'bundle deploy' to deploy changes to your workspace

>>> [CLI] bundle summary
Name: test-bundle
Target: default
Workspace:
User: [USERNAME]
Path: /Workspace/Users/[USERNAME]/.bundle/test-bundle/default
Resources:
Postgres databases:
database1:
Name:
URL: (not deployed)

>>> [CLI] bundle deployment unbind database1
Updating deployment state...

>>> [CLI] bundle summary
Name: test-bundle
Target: default
Workspace:
User: [USERNAME]
Path: /Workspace/Users/[USERNAME]/.bundle/test-bundle/default
Resources:
Postgres databases:
database1:
Name:
URL: (not deployed)
6 changes: 6 additions & 0 deletions acceptance/bundle/deployment/bind/postgres_database/script
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
DATABASE_NAME="projects/test-project/branches/main/databases/test-database"
trace $CLI bundle deployment bind database1 "${DATABASE_NAME}" --auto-approve
trace $CLI bundle summary

trace $CLI bundle deployment unbind database1
trace $CLI bundle summary
18 changes: 18 additions & 0 deletions acceptance/bundle/deployment/bind/postgres_database/test.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Local = true
Cloud = false

Ignore = [
".databricks"
]

[[Server]]
Pattern = "GET /api/2.0/postgres/projects/test-project/branches/main/databases/test-database"
Response.Body = '''
{
"name": "projects/test-project/branches/main/databases/test-database",
"parent": "projects/test-project/branches/main",
"status": {
"postgres_database": "app_db"
}
}
'''
27 changes: 27 additions & 0 deletions acceptance/bundle/invariant/configs/postgres_database.yml.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
bundle:
name: test-bundle-$UNIQUE_NAME

resources:
postgres_projects:
project:
project_id: test-pg-project-$UNIQUE_NAME
display_name: Test Postgres Project

postgres_branches:
branch:
parent: ${resources.postgres_projects.project.name}
branch_id: test-branch-$UNIQUE_NAME
no_expiry: true

postgres_roles:
owner:
parent: ${resources.postgres_branches.branch.name}
role_id: test-role-$UNIQUE_NAME
postgres_role: app_role

postgres_databases:
foo:
parent: ${resources.postgres_branches.branch.name}
database_id: test-database-$UNIQUE_NAME
postgres_database: app_db
role: ${resources.postgres_roles.owner.name}
1 change: 1 addition & 0 deletions acceptance/bundle/invariant/continue_293/out.test.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions acceptance/bundle/invariant/migrate/out.test.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions acceptance/bundle/invariant/no_drift/out.test.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions acceptance/bundle/invariant/test.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ EnvMatrix.INPUT_CONFIG = [
"pipeline_config_dots.yml.tmpl",
"postgres_branch.yml.tmpl",
"postgres_catalog.yml.tmpl",
"postgres_database.yml.tmpl",
"postgres_endpoint.yml.tmpl",
"postgres_project.yml.tmpl",
"postgres_role.yml.tmpl",
Expand Down Expand Up @@ -77,6 +78,7 @@ no_postgres_endpoint_on_cloud = ["CONFIG_Cloud=true", "INPUT_CONFIG=postgres_end
no_postgres_catalog_on_cloud = ["CONFIG_Cloud=true", "INPUT_CONFIG=postgres_catalog.yml.tmpl"]
no_postgres_synced_table_on_cloud = ["CONFIG_Cloud=true", "INPUT_CONFIG=postgres_synced_table.yml.tmpl"]
no_postgres_role_on_cloud = ["CONFIG_Cloud=true", "INPUT_CONFIG=postgres_role.yml.tmpl"]
no_postgres_database_on_cloud = ["CONFIG_Cloud=true", "INPUT_CONFIG=postgres_database.yml.tmpl"]

# External locations require actual storage credentials with cloud IAM setup
# which are environment-specific, so we only test locally with the mock server
Expand Down
16 changes: 16 additions & 0 deletions acceptance/bundle/refschema/out.fields.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2870,6 +2870,22 @@ resources.postgres_catalogs.*.status.project string REMOTE
resources.postgres_catalogs.*.uid string REMOTE
resources.postgres_catalogs.*.update_time *time.Time REMOTE
resources.postgres_catalogs.*.url string INPUT
resources.postgres_databases.*.create_time *time.Time REMOTE
resources.postgres_databases.*.database_id string ALL
resources.postgres_databases.*.id string INPUT
resources.postgres_databases.*.lifecycle resources.Lifecycle INPUT
resources.postgres_databases.*.lifecycle.prevent_destroy bool INPUT
resources.postgres_databases.*.modified_status string INPUT
resources.postgres_databases.*.name string REMOTE
resources.postgres_databases.*.parent string ALL
resources.postgres_databases.*.postgres_database string ALL
resources.postgres_databases.*.role string ALL
resources.postgres_databases.*.status *postgres.DatabaseDatabaseStatus REMOTE
resources.postgres_databases.*.status.database_id string REMOTE
resources.postgres_databases.*.status.postgres_database string REMOTE
resources.postgres_databases.*.status.role string REMOTE
resources.postgres_databases.*.update_time *time.Time REMOTE
resources.postgres_databases.*.url string INPUT
resources.postgres_endpoints.*.autoscaling_limit_max_cu float64 ALL
resources.postgres_endpoints.*.autoscaling_limit_min_cu float64 ALL
resources.postgres_endpoints.*.create_time *time.Time REMOTE
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
bundle:
name: deploy-postgres-database-$UNIQUE_NAME

sync:
paths: []

resources:
postgres_projects:
my_project:
project_id: test-pg-proj-$UNIQUE_NAME
display_name: "Test Project for Database"
pg_version: 16
history_retention_duration: "604800s"

postgres_branches:
main:
parent: ${resources.postgres_projects.my_project.id}
branch_id: main
no_expiry: true

postgres_roles:
owner:
parent: ${resources.postgres_branches.main.id}
role_id: app-owner
postgres_role: app_owner

postgres_databases:
my_database:
parent: ${resources.postgres_branches.main.id}
database_id: my-database
postgres_database: app_db
# The live API requires `role`. Declare an explicit role so the bundle is
# portable across users (the auto-created project-owner role's id is
# derived from the creator's identity).
role: ${resources.postgres_roles.owner.id}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"method": "POST",
"path": "/api/2.0/postgres/projects",
"q": {
"project_id": "test-pg-proj-[UNIQUE_NAME]"
},
"body": {
"spec": {
"display_name": "Test Project for Database",
"history_retention_duration": "604800s",
"pg_version": 16
}
}
}
{
"method": "POST",
"path": "/api/2.0/postgres/projects/test-pg-proj-[UNIQUE_NAME]/branches",
"q": {
"branch_id": "main"
},
"body": {
"spec": {
"no_expiry": true
}
}
}
{
"method": "POST",
"path": "/api/2.0/postgres/projects/test-pg-proj-[UNIQUE_NAME]/branches/main/roles",
"q": {
"role_id": "app-owner"
},
"body": {
"spec": {
"postgres_role": "app_owner"
}
}
}
{
"method": "POST",
"path": "/api/2.0/postgres/projects/test-pg-proj-[UNIQUE_NAME]/branches/main/databases",
"q": {
"database_id": "my-database"
},
"body": {
"spec": {
"postgres_database": "app_db",
"role": "projects/test-pg-proj-[UNIQUE_NAME]/branches/main/roles/app-owner"
}
}
}
{
"method": "GET",
"path": "/api/2.0/postgres/projects/test-pg-proj-[UNIQUE_NAME]/branches/main/databases/my-database"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"method": "POST",
"path": "/api/2.0/postgres/projects",
"q": {
"project_id": "test-pg-proj-[UNIQUE_NAME]"
},
"body": {
"spec": {
"display_name": "Test Project for Database",
"history_retention_duration": "604800s",
"pg_version": 16
}
}
}
{
"method": "POST",
"path": "/api/2.0/postgres/projects/test-pg-proj-[UNIQUE_NAME]/branches",
"q": {
"branch_id": "main"
},
"body": {
"parent": "projects/test-pg-proj-[UNIQUE_NAME]",
"spec": {
"no_expiry": true
}
}
}
{
"method": "POST",
"path": "/api/2.0/postgres/projects/test-pg-proj-[UNIQUE_NAME]/branches/main/roles",
"q": {
"role_id": "app-owner"
},
"body": {
"parent": "projects/test-pg-proj-[UNIQUE_NAME]/branches/main",
"spec": {
"postgres_role": "app_owner"
}
}
}
{
"method": "POST",
"path": "/api/2.0/postgres/projects/test-pg-proj-[UNIQUE_NAME]/branches/main/databases",
"q": {
"database_id": "my-database"
},
"body": {
"parent": "projects/test-pg-proj-[UNIQUE_NAME]/branches/main",
"spec": {
"postgres_database": "app_db",
"role": "projects/test-pg-proj-[UNIQUE_NAME]/branches/main/roles/app-owner"
}
}
}
{
"method": "GET",
"path": "/api/2.0/postgres/projects/test-pg-proj-[UNIQUE_NAME]/branches/main/databases/my-database"
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading