Skip to content

docs: design 001, database development flow - #677

Open
ditadi wants to merge 9 commits into
mainfrom
stack/database-dev-flow/00-design
Open

ditadi wants to merge 9 commits into
mainfrom
stack/database-dev-flow/00-design

Conversation

@ditadi

@ditadi ditadi commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

🥞 Stacked PR (generated by Stack)

Use this link to review incremental changes.


What did you change, and why?

Design 001 (designs/001_DatabaseDevelopmentFlow.md) describes database branch ownership, committed migrations, and deployment. This revision updates the application development flow to match the named-operation design and experience fixes in #687–#692.

  • Replaces the current API description based on generated CRUD routes with authored, authorized operations. Table declarations alone expose no HTTP endpoint.
  • Documents the three route configurations: conventional database() discovery, routes: false, and an explicit custom registry. Covers committed registry/contracts, development reloads for shared schemas and policies, first/last route changes, and source-less production builds.
  • Defines omitted input as no parameters, with no placeholder object or inferred input. Explicit schemas determine caller input. Method-based output defaults remain unchanged; input shape never determines result cardinality.
  • Explains query/mutation hooks, typed skipToken, operation/session-scoped state, late responses, refresh after writes, and safe field feedback that preserves failed drafts.
  • Records the distinction between policy-resource snapshots and atomic business rules: transactional rechecks, constraints, database-generated IDs, and audit writes.
  • Updates the scaffold-to-deploy walkthrough, API changes, compatibility guidance and links to the owning operation PRs.

The migration decisions remain: opt-in startup migrations, per-migration transactions, bounded advisory/history locks, branch guards, ownership handoff, private-column preservation, deployed verification and offline history checks. The tooling remains internal at @databricks/appkit/beta/database-tooling, and revealing the hidden plugin/commands remains a separate change.

The document explicitly distinguishes the migration chain (#654–#678) from the operation chain (#687–#692). Combined startup/deployment validation is a release integration step; the separate chains' checks do not establish that integration. PR #677 targets main independently, and the implementation chain begins at #654 on main.

The linked Google Doc remains available for comments and edits. This PR updates the Markdown design copy.

How do you know it works?

Documentation only. Checked the changed contracts against the current #687–#692 implementation and plugin guidelines; validated the syntax of all three TypeScript/TSX examples, balanced fenced blocks, operation PR references, and git diff --check. The branch's pre-existing Knip findings (one unused CLI file and three dev dependencies) also occur with the unchanged design; they are unrelated to this Markdown-only edit. No runtime or app files are included.

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

Signed-off-by: ditadi <victordperd@gmail.com>
@github-actions

github-actions Bot commented Oct 19, 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 41659774331 -R databricks/appkit -n appkit-template-0.90.0-pr.a9e1c3f-stack-database-dev-flow-00-design-677 -D appkit-pr-677 \
  && unzip -o "appkit-pr-677/appkit-template-0.90.0-pr.a9e1c3f-stack-database-dev-flow-00-design-677.zip" -d "appkit-pr-677" \
  && databricks apps init --template "appkit-pr-677"

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>
@ditadi
ditadi requested a review from a team as a code owner October 26, 2026 02:04
@ditadi
ditadi requested a review from MarioCadenas October 26, 2026 02:04
ditadi and others added 4 commits October 30, 2026 10:44
The design doc promised behavior the corrected stack does not ship. It
now describes what the code does:

- The tooling export is @databricks/appkit/beta/database-tooling, beta
  and internal to the AppKit CLI.
- migrate, introspect, clean and init hold config/database/.appkit-db.lock.
  init holds one lock for its whole run, and init --schema none, seed,
  verify and clean --delete-branch take none. The doc says how to
  recover a stale lock file.
- init --schema none hands off nothing, and schema public is never
  handed off.
- Values in variable-overrides.json count for the deploy boundary, and
  an unresolved branch or database reference refuses every write.
- Introspect keeps .private() on declared columns, writes new columns
  private, and refuses a schema.ts that does not load or a foreign key
  it does not declare.
- verify --deployed compares the committed migrations with the source
  snapshot of the active deployment, and fails when it cannot read it.
- Migrations log one line per run. There is no span and no metric.
- #675 keeps the plugin and appkit db hidden. A reveal is a later,
  separate change.

The appkit db check section stays as it is until #678 settles.

Signed-off-by: ditadi <victordperd@gmail.com>
…he stack code

Signed-off-by: ditadi <victordperd@gmail.com>
… and prompts

Apply the review of the design doc. The pooler refusal belongs to migrate on start, the migrator reconciles without the lock before it takes it, the deploy guard reads each target with and without variable-overrides.json, and init asks only for --schema clean and an ambiguous rename. The reveal also moves the database export into the generated barrel, check refuses a file that is not a drizzle-kit snapshot, and the project is not a databricks.yml variable.

Signed-off-by: ditadi <victordperd@gmail.com>
@ditadi
ditadi requested a review from fjakobs November 1, 2026 23:27
Signed-off-by: ditadi <victordperd@gmail.com>

This branch has not been deployed

No deployments
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.

1 participant