Skip to content

fix(appkit): allow database initialization without arguments - #582

Open
ditadi wants to merge 6 commits into
mainfrom
fix/database-init
Open

fix(appkit): allow database initialization without arguments#582
ditadi wants to merge 6 commits into
mainfrom
fix/database-init

Conversation

@ditadi

@ditadi ditadi commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Allow database() and database({}) to initialize without explicit configuration.

  • Load the named schema export from config/database/schema.ts; ship a valid empty starter in newly scaffolded apps.
  • Resolve the PostgreSQL username from the application's Databricks credentials when PGUSER and DATABRICKS_CLIENT_ID are absent, using the same client for identity lookup and pool authentication.
  • Preserve explicit overrides and validate the schema before pool creation.
  • Check the packaged template's database starter before uploading the PR artifact.

Validation

  • 4,983 tests passed, 1 skipped; build, docs, lint and typecheck passed.
  • Created a fresh app with the actual Databricks CLI and prepared SDK tarballs.
  • Started the unmodified generated server and received HTTP 200.
  • Initialized database() and queried real local PostgreSQL without PGUSER or DATABRICKS_CLIENT_ID; the workspace identity/credential API was a local test double, not a live Lakebase workspace.

Signed-off-by: ditadi <victordperd@gmail.com>
@ditadi
ditadi requested a review from a team as a code owner September 11, 2026 10:38
@ditadi
ditadi requested a review from MarioCadenas September 11, 2026 10:38
@github-actions

github-actions Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

📦 Bundle size report

Compared against bundle-size-baseline.json (main).

@databricks/appkit

npm tarball (packed): 1.1 MB (+4.2 KB) — gzipped download (dist + bin; excludes release-only docs/NOTICE).

dist raw gzip
JS (runtime) 1.1 MB (+4.6 KB) 412 KB (+1.8 KB)
Type declarations 425 KB (+1.3 KB) 153 KB (+413 B)
Source maps 2.3 MB (+8.6 KB) 773 KB (+3.3 KB)
Other 11 KB 3.7 KB
Total 3.8 MB (+14 KB) 1.3 MB (+5.5 KB)
Per-entry composition (own code — deps external (as shipped))
Entry Initial (gz) Lazy (gz) Total (gz) node_modules (min) Own code (min)
. 95 KB (+8 B) 2.5 KB 98 KB (+8 B) external 313 KB
./beta 93 KB (+729 B) 457 B 93 KB (+729 B) external 279 KB (+2.0 KB)
./testing 17 KB (-1 B) 0 B 17 KB (-1 B) external 52 KB
./tsdown 520 B 0 B 520 B external 813 B
./type-generator 23 KB 0 B 23 KB external 65 KB

Chunks:

Entry Chunk Load Size (gz)
. index.js initial 91 KB
. utils.js initial 4.0 KB
. remote-tunnel-manager.js lazy 2.5 KB
./beta beta.js initial 76 KB
./beta stream-manager.js initial 5.8 KB
./beta wide-event-emitter.js initial 3.2 KB
./beta databricks.js initial 3.2 KB
./beta configuration.js initial 2.3 KB
./beta service-context.js initial 1.3 KB
./beta client.js initial 434 B
./beta client-options.js initial 220 B
./beta supervisor-api.js lazy 192 B
./beta databricks.js lazy 142 B
./beta index.js lazy 123 B
./testing index.js initial 17 KB
./tsdown index.js initial 520 B
./type-generator index.js initial 23 KB

@databricks/appkit-ui

npm tarball (packed): 350 KB (+4 B) — gzipped download (dist + bin; excludes release-only docs/NOTICE).

dist raw gzip
JS (runtime) 395 KB 132 KB
Type declarations 229 KB 84 KB (+1 B)
Source maps 766 KB 253 KB
CSS 16 KB 3.2 KB
Total 1.4 MB 473 KB (+1 B)
Per-entry composition (consumer bundle — deps bundled, peerDeps external)
Entry Initial (gz) Lazy (gz) Total (gz) node_modules (min) Own code (min)
./js 5.3 KB 49 KB 55 KB 208 KB 14 KB
./js/beta 20 B 0 B 20 B 0 B 0 B
./react 432 KB 49 KB 481 KB 1.3 MB 177 KB
./react/beta 1.0 KB 0 B 1.0 KB 0 B 1.9 KB

Chunks:

Entry Chunk Load Size (gz)
./js index.js initial 5.2 KB
./js chunk initial 120 B
./js apache-arrow lazy 49 KB
./js/beta beta.js initial 20 B
./react index.js initial 430 KB
./react tslib initial 2.1 KB
./react apache-arrow lazy 49 KB
./react/beta beta.js initial 1.0 KB

@github-actions

github-actions Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

🤖 AppKit PR bot

🔬 Run evals

Start an eval for this PR from the evals-monitor app: Go to Evals Monitor →

📦 Try this PR's app template

Scaffolds a new app from this PR's SDK build. Run it in any folder (requires the GitHub CLI — gh auth login — and the Databricks CLI):

gh run download 34626747579 -R databricks/appkit -n appkit-template-0.74.1-pr.e83879e-fix-database-init-582 -D appkit-pr-582 \
  && unzip -o "appkit-pr-582/appkit-template-0.74.1-pr.e83879e-fix-database-init-582.zip" -d "appkit-pr-582" \
  && databricks apps init --template "appkit-pr-582"

The template pins @databricks/appkit and @databricks/appkit-ui to tarballs built from this branch, so the scaffolded app runs against this PR's code.

Signed-off-by: ditadi <victordperd@gmail.com>
Signed-off-by: ditadi <victordperd@gmail.com>
…e connector

Signed-off-by: ditadi <victordperd@gmail.com>
Signed-off-by: ditadi <victordperd@gmail.com>
Comment thread template/config/database/schema.ts
Signed-off-by: ditadi <victordperd@gmail.com>
Sign up for free to 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.

2 participants