Skip to content

Add Lakebase Autoscaling support to psql command - #4399

Merged
pietern merged 26 commits into
mainfrom
psql-autoscaling
Jan 30, 2026
Merged

Add Lakebase Autoscaling support to psql command#4399
pietern merged 26 commits into
mainfrom
psql-autoscaling

Conversation

@pietern

@pieternpietern commented Jan 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add support for the new Lakebase Autoscaling API (projects/branches/endpoints) alongside existing Lakebase Provisioned instances
  • Introduce --provisioned and --autoscaling flags to filter by product type during interactive selection
  • Add --project, --branch, and --endpoint flags for direct autoscaling resource targeting
  • Auto-select branch/endpoint when only one exists for streamlined UX
  • Skip retries for non-retryable connection errors (authentication failures, missing roles/databases)

Backward Compatibility

The existing interface remains fully compatible:

  • databricks psql my-instance continues to work for Lakebase Provisioned
  • databricks psql (no args) still shows interactive selection, now including both products
  • All existing flags and behaviors are preserved

Test plan

  • New acceptance tests
  • Manually tested with both provisioned and autoscaling instances

pieternand others added 22 commits January 29, 2026 18:22
- Add lakebasev2 package for new Postgres API (projects/branches/endpoints)
- Move existing lakebase code to lakebasev1 package
- Update psql command to support both APIs:
- Old API: databricks psql <database-instance>
- New API: databricks psql --project <id> or projects/<id>/...
- Add interactive selection with display names
- Auto-select when only one branch/endpoint exists
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Refactor lakebase v1 and v2 packages to contain only library logic
(fetching instances, connecting) while the interactive selection and
prompting logic now lives in cmd/psql. This improves separation of
concerns - libraries handle data and connections, commands handle UI.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move the psql command building, retry logic, and connection handling
into libs/lakebase/psql. Both v1 (Database API) and v2 (Postgres API)
now use the shared RetryConfig and ConnectOptions structs.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The first connection attempt now shows the same message as when retries
are disabled. Attempt numbers are only shown on the 2nd and subsequent
attempts.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Instead of retrieving the workspace client from context inside the
Connect functions, require it as a parameter. This makes the dependency
explicit.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Rename "Old Database API" to "Lakebase Provisioned" and "New Postgres API"
to "Lakebase Autoscaling" throughout the codebase to align with official
Databricks documentation.
Also fix the auto-selection acceptance test by configuring the mock server
to return a single branch and endpoint, and add test coverage for:
- All three flags specified (--project --branch --endpoint)
- Extra arguments with --project flag
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Reduce verbosity by showing concise connection status (e.g., "Instance: my-database
(provisioned)" instead of multiple status lines). Add FormatEndpointType and
FormatEndpointState helpers for cleaner display. Consolidate connection functions
and simplify control flow.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…tection
Positional argument now takes precedence over flags. Flags can supplement
missing components in partial paths but conflict with existing components
in the path. Also validates resource path structure and rejects malformed
paths with clear error messages.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…ection
Extract listAllDatabases function to fetch instances and projects in
parallel, used by both autocompletion and interactive selection.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…tput
Move the project log line from connectAutoscaling to resolveEndpoint and
fetch the project to display its human-readable name.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Return the branch ID string directly instead of the full branch object,
matching the pattern used by selectEndpointID.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Follows the same pattern as selectBranchID and selectEndpointID.
Displays project display names but returns the project ID.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update resolveEndpoint to:
- Call selectProjectID when projectID is not provided
- Perform GET calls on branch and endpoint to validate they exist
- Use the fetched objects to build resource names consistently
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The endpoint is now fetched directly in resolveEndpoint using the SDK.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- psql.go: Main command setup, argument parsing, interactive selection
- psql_provisioned.go: connectProvisioned function
- psql_autoscaling.go: connectAutoscaling, resolveEndpoint, and select* functions
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…selection
These flags limit the interactive selection to a single product segment:
- --provisioned: Only show/select from provisioned database instances
- --autoscaling: Only show/select from autoscaling projects
The flags are mutually exclusive with each other and have appropriate
conflict detection with other flags and positional arguments.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add error classification to distinguish between transient and permanent
psql connection failures. Errors like "role does not exist" and
"authentication failed" are not retried since they require user action.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Standardize error messages across all selection functions:
- Combined: "no Lakebase databases found in workspace"
- Provisioned: "no Lakebase Provisioned instances found in workspace"
- Autoscaling: "no Lakebase Autoscaling projects found in workspace"
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Simplify help text with grouped examples instead of numbered list
- Add link to Lakebase documentation
- Group flags into "Product Selection" and "Autoscaling" sections
- Fix usage string to show flags before -- separator
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Show instance name for provisioned and project name for autoscaling
in the selection ID, instead of numeric indices.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Jan 29, 2026

Copy link
Copy Markdown
Collaborator

Commit: 681a029

Run: 21522070322

Env🟨​KNOWN🔄​flaky💚​RECOVERED🙈​SKIP✅​pass🙈​skipTime
🟨​aws linux71744271030:14
🟨​aws windows71741471828:52
🟨​aws-ucws linux39564158067:46
🟨​aws-ucws windows39561058958:40
💚​azure linux2944270936:02
💚​azure windows2941471728:29
💚​azure-ucws linux6763757967:10
💚​azure-ucws windows6760658856:36
🔄​gcp linux31942971534:54
💚​gcp windows2940372330:48
19 interesting tests: 7 KNOWN, 5 SKIP, 5 RECOVERED, 2 flaky
Test Nameaws linuxaws windowsaws-ucws linuxaws-ucws windowsazure linuxazure windowsazure-ucws linuxazure-ucws windowsgcp linuxgcp windows
🟨​TestAccept🟨​K🟨​K🟨​K🟨​K💚​R💚​R💚​R💚​R🔄​f💚​R
🙈​TestAccept/bundle/deployment/bind/alert🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🙈​TestAccept/bundle/generate/alert🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
💚​TestAccept/bundle/invariant/no_drift🙈​S🙈​S💚​R💚​R🙈​S🙈​S💚​R💚​R🙈​S🙈​S
🙈​TestAccept/bundle/resources/alerts/basic🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🙈​TestAccept/bundle/resources/alerts/with_file🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🔄​TestAccept/bundle/resources/dashboards/detect-change✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p🔄​f✅​p
🔄​TestAccept/bundle/resources/dashboards/detect-change/DATABRICKS_BUNDLE_ENGINE=terraform✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p🔄​f✅​p
🙈​TestAccept/bundle/resources/permissions🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🟨​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions🟨​K🟨​K🟨​K🟨​K🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🟨​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=direct🟨​K🟨​K🟨​K🟨​K
🟨​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=terraform🟨​K🟨​K💚​R💚​R
🟨​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions🟨​K🟨​K💚​R💚​R🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🟨​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=direct🟨​K🟨​K💚​R💚​R
🟨​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=terraform🟨​K🟨​K💚​R💚​R
💚​TestAccept/bundle/resources/synced_database_tables/basic🙈​S🙈​S💚​R💚​R🙈​S🙈​S💚​R💚​R🙈​S🙈​S
💚​TestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=direct💚​R💚​R💚​R💚​R
💚​TestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=terraform💚​R💚​R💚​R💚​R
💚​TestAccept/ssh/connection💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R
Top 50 slowest tests (at least 2 minutes):
durationenvtestname
9:05azure-ucws linuxTestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=synced_database_table.yml.tmpl
8:18aws-ucws windowsTestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=synced_database_table.yml.tmpl
8:09aws-ucws linuxTestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=synced_database_table.yml.tmpl
7:59aws-ucws linuxTestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_instance.yml.tmpl
7:30aws-ucws linuxTestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
7:08aws-ucws linuxTestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=terraform
6:59azure linuxTestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
6:40aws-ucws windowsTestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=terraform
6:23aws-ucws linuxTestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=direct
6:21aws-ucws windowsTestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=direct
6:21azure linuxTestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
6:15gcp linuxTestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
6:12aws-ucws windowsTestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_instance.yml.tmpl
6:09aws windowsTestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
6:06aws-ucws linuxTestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_catalog.yml.tmpl
6:05aws linuxTestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
6:04aws-ucws windowsTestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_catalog.yml.tmpl
6:03gcp windowsTestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
5:58azure-ucws windowsTestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_catalog.yml.tmpl
5:56azure-ucws linuxTestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=terraform
5:46aws-ucws linuxTestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
4:59gcp linuxTestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
4:31azure-ucws linuxTestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=direct
4:29azure-ucws windowsTestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_instance.yml.tmpl
4:23azure-ucws windowsTestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=synced_database_table.yml.tmpl
4:21azure-ucws linuxTestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_catalog.yml.tmpl
3:54azure-ucws windowsTestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=terraform
3:49aws-ucws windowsTestAccept/bundle/resources/models/basic/DATABRICKS_BUNDLE_ENGINE=terraform
3:48azure-ucws linuxTestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
3:44azure-ucws windowsTestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=direct
3:38gcp linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:23gcp windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:22gcp windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:22azure-ucws linuxTestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
3:20gcp linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:12azure-ucws linuxTestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_instance.yml.tmpl
3:05aws-ucws windowsTestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=direct/DLT=yes/NBOOK=yes/PY=yes/READPLAN=1
3:01aws-ucws linuxTestAccept/bundle/resources/registered_models/basic/DATABRICKS_BUNDLE_ENGINE=terraform
3:00azure-ucws linuxTestAccept/bundle/resources/secret_scopes/permissions/DATABRICKS_BUNDLE_ENGINE=terraform
2:53aws-ucws linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:50azure-ucws windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:50azure linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:50azure-ucws linuxTestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=direct/DLT=yes/NBOOK=no/PY=yes/READPLAN=
2:50azure-ucws windowsTestAccept/bundle/templates/default-python/combinations/serverless/DATABRICKS_BUNDLE_ENGINE=direct/DLT=yes/NBOOK=no/PY=yes/READPLAN=
2:49aws-ucws windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:48aws-ucws linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:47azure-ucws windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:47aws linuxTestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
2:46aws linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:46aws-ucws linuxTestAccept/bundle/templates/default-python/combinations/serverless/DATABRICKS_BUNDLE_ENGINE=direct/DLT=yes/NBOOK=no/PY=yes/READPLAN=

Comment threadacceptance/cmd/psql/argument-errors/script Outdated
Comment threadlibs/lakebase/v2/connect.go Outdated
func FormatEndpointState(state postgres.EndpointStatusState) string {
switch state {
case postgres.EndpointStatusStateActive:
return ""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this empty string and not "active"?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to inform the user that the endpoint is in the nominal good state.

I'll refactor this to provide a "suffix" with parens to make the logger below simpler.

Comment threadlibs/lakebase/v2/connect.go Outdated
endpointType := FormatEndpointType(endpoint.Status.EndpointType)
stateDesc := FormatEndpointState(state)
if stateDesc != "" {
cmdio.LogString(ctx, fmt.Sprintf("Connecting to %s endpoint (%s)...", endpointType, stateDesc))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This branch only executes for state == Idle, intentional?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplified in latest.

Comment threadlibs/lakebase/v2/connect.go Outdated
cmdio.LogString(ctx, fmt.Sprintf("Connecting to %s endpoint...", endpointType))
}

if endpoint.Status.Hosts == nil || endpoint.Status.Hosts.Host == "" {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why some errors are returned before Connecting message and some after? What's the difference?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leftover from before. I consolidated and moved the log to right before the psql.Connect call.

Comment threadlibs/lakebase/v2/connect.go Outdated
@@ -0,0 +1,100 @@
package lakebasev2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this package in libs/, it seems tightly coupled to psql command, so it can live somewhere in cmd/?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I inlined the functions from these packages into cmd/psql and moved libs/lakebase/psql to libs/psql.

This change consolidates Lakebase-specific connection logic directly into
the psql command, eliminating unnecessary abstraction layers.
Key changes:
- Inline v1 and v2 connection helpers into psql_{provisioned,autoscaling}.go
- Move libs/lakebase/psql to libs/psql (it's a general PostgreSQL client)
- Remove libs/lakebase/v1 and libs/lakebase/v2 packages entirely
- Extract and inline ExtractIDFromName as a local helper in psql_autoscaling.go
- Standardize error messages to use "failed to" pattern consistently
- Add documented constants for default database names
- Fix autoscaling default database from "postgres" to "databricks_postgres"
This simplifies the codebase by having all psql connection logic in one place,
making it easier to understand and maintain. The lakebase libraries were only
used by the psql command, so inlining them reduces indirection without loss
of functionality.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
pieternand others added 2 commits January 30, 2026 17:00
Update expected test outputs to reflect the autoscaling default database
change from 'postgres' to 'lakebase'.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Reorder operations so that credential generation and host validation
happen before logging "Connecting...". This ensures we only log the
connection message after all prerequisite checks have passed.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@pietern
pietern enabled auto-merge January 30, 2026 16:02
@pietern
pietern added this pull request to the merge queueJan 30, 2026
Merged via the queue into main with commit f9cac44Jan 30, 2026
18 checks passed
@pietern
pietern deleted the psql-autoscaling branch January 30, 2026 17:18
github-merge-queueBot pushed a commit that referenced this pull request Feb 4, 2026
## Changes
This PR adds support for Lakebase Autoscaling resources, enabling
declarative configuration of projects, branches, and endpoints. For more
information about the product, see
https://docs.databricks.com/aws/en/oltp/projects/.
These APIs use a "spec" field to capture the user intent in requests and
a "status" field to contain the applied values in responses. To match
DABs UX patterns, this PR embeds the "spec" type at the top level of the
resource.
## Example
Example configuration:
```yaml
resources:
postgres_projects:
my_db:
project_id: dabs-test-prod-app
display_name: "Production Database"
pg_version: 17
postgres_branches:
main:
parent: ${resources.postgres_projects.my_db.id}
branch_id: main
is_protected: false
no_expiry: true
postgres_endpoints:
primary:
parent: ${resources.postgres_branches.main.id}
endpoint_id: primary
endpoint_type: ENDPOINT_TYPE_READ_WRITE
autoscaling_limit_min_cu: 0.5
autoscaling_limit_max_cu: 4
```
After deploying this, you can access the endpoint using the `psql`
command (see #4399):
```
% databricks psql projects/dabs-test-prod-app/branches/main/endpoints/primary -- -c 'select 1;'
Project: Production Database
Branch: main
Endpoint: primary
Connecting to read-write endpoint...
?column?
----------
1
(1 row)
```
**Note:** the default database name assumed by the command is
`databricks_postgres`. If this doesn't work, you can try `--dbname
lakebase`.
## Tests
* Acceptance tests on AWS.
* API coverage in the testserver.
* Manual testing.
# Known limitations
* Resource IDs are required: project_id, branch_id, and endpoint_id must
be explicitly specified. They're planned to be optional and
auto-generated by the server.
* ID field updates in Terraform don't trigger recreation as expected.
* Endpoint reconciliation conflicts prevent reliable Terraform-based
recreate tests for endpoints.
---------
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
deco-sdk-taggingBot added a commit that referenced this pull request Feb 5, 2026
## Release v0.287.0
### CLI
* Add Lakebase Autoscaling support to `psql` command ([#4399](#4399))
* Add `workspace_id` to the profiles command ([#4404](#4404))
### Bundles
* Add support for Lakebase resources (postgres_projects, postgres_branches, postgres_endpoints) ([#4423](#4423))
* Add missing values to SchemaGrantPrivilege enum ([#4380](#4380))
* Added support for UC catalogs (only in direct mode) ([#4342](#4342))
* engine/direct: Fix updates to fields being ignored for database_catalogs, synced_database_tables (([#4388](#4388)))
* engine/direct: Fix migration for database_instances, database_catalog, synced_database_tables ([#4424](#4424))
* Show warning message if valueFrom is used instead of value_from in app config section ([$4429](#4429))
denik pushed a commit that referenced this pull request May 20, 2026
## Summary
- Add support for the new Lakebase Autoscaling API
(projects/branches/endpoints) alongside existing Lakebase Provisioned
instances
- Introduce `--provisioned` and `--autoscaling` flags to filter by
product type during interactive selection
- Add `--project`, `--branch`, and `--endpoint` flags for direct
autoscaling resource targeting
- Auto-select branch/endpoint when only one exists for streamlined UX
- Skip retries for non-retryable connection errors (authentication
failures, missing roles/databases)
## Backward Compatibility
The existing interface remains fully compatible:
- `databricks psql my-instance` continues to work for Lakebase
Provisioned
- `databricks psql` (no args) still shows interactive selection, now
including both products
- All existing flags and behaviors are preserved
## Test plan
- New acceptance tests
- Manually tested with both provisioned and autoscaling instances
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
denik pushed a commit that referenced this pull request May 20, 2026
## Changes
This PR adds support for Lakebase Autoscaling resources, enabling
declarative configuration of projects, branches, and endpoints. For more
information about the product, see
https://docs.databricks.com/aws/en/oltp/projects/.
These APIs use a "spec" field to capture the user intent in requests and
a "status" field to contain the applied values in responses. To match
DABs UX patterns, this PR embeds the "spec" type at the top level of the
resource.
## Example
Example configuration:
```yaml
resources:
postgres_projects:
my_db:
project_id: dabs-test-prod-app
display_name: "Production Database"
pg_version: 17
postgres_branches:
main:
parent: ${resources.postgres_projects.my_db.id}
branch_id: main
is_protected: false
no_expiry: true
postgres_endpoints:
primary:
parent: ${resources.postgres_branches.main.id}
endpoint_id: primary
endpoint_type: ENDPOINT_TYPE_READ_WRITE
autoscaling_limit_min_cu: 0.5
autoscaling_limit_max_cu: 4
```
After deploying this, you can access the endpoint using the `psql`
command (see #4399):
```
% databricks psql projects/dabs-test-prod-app/branches/main/endpoints/primary -- -c 'select 1;'
Project: Production Database
Branch: main
Endpoint: primary
Connecting to read-write endpoint...
?column?
----------
1
(1 row)
```
**Note:** the default database name assumed by the command is
`databricks_postgres`. If this doesn't work, you can try `--dbname
lakebase`.
## Tests
* Acceptance tests on AWS.
* API coverage in the testserver.
* Manual testing.
# Known limitations
* Resource IDs are required: project_id, branch_id, and endpoint_id must
be explicitly specified. They're planned to be optional and
auto-generated by the server.
* ID field updates in Terraform don't trigger recreation as expected.
* Endpoint reconciliation conflicts prevent reliable Terraform-based
recreate tests for endpoints.
---------
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
denik pushed a commit that referenced this pull request May 20, 2026
## Release v0.287.0
### CLI
* Add Lakebase Autoscaling support to `psql` command ([#4399](#4399))
* Add `workspace_id` to the profiles command ([#4404](#4404))
### Bundles
* Add support for Lakebase resources (postgres_projects, postgres_branches, postgres_endpoints) ([#4423](#4423))
* Add missing values to SchemaGrantPrivilege enum ([#4380](#4380))
* Added support for UC catalogs (only in direct mode) ([#4342](#4342))
* engine/direct: Fix updates to fields being ignored for database_catalogs, synced_database_tables (([#4388](#4388)))
* engine/direct: Fix migration for database_instances, database_catalog, synced_database_tables ([#4424](#4424))
* Show warning message if valueFrom is used instead of value_from in app config section ([$4429](#4429))
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@pietern@eng-dev-ecosystem-bot@denik@anton-107