feat(cli): dev defaults to sqlite + auto-seed admin#1455
Merged
Conversation
serve.ts: in dev with no OS_DATABASE_URL/OS_DATABASE_DRIVER, prefer SqlDriver(sqlite, :memory:) over the pure-JS InMemoryDriver for production-like SQL semantics. Probe by actually opening a connection (knex loads better-sqlite3 lazily at first query), and fall back to InMemoryDriver with a warning if the native binary is unavailable (not built / ABI mismatch / blocked prebuild). This keeps the silent-catch path from ever leaving the kernel with no driver. dev.ts: `--seed-admin` now defaults ON in dev. The seed is idempotent and non-destructive — it POSTs the public sign-up endpoint, which creates admin@objectos.ai only on an empty DB (then bootstrapPlatformAdmin promotes it to platform admin) and skips when the email already exists (422/400), so a custom password is never overwritten. No need to gate on ephemeral vs persistent. Disable with --no-seed-admin. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two dev-experience fixes in the CLI so a bare
objectstack dev(e.g.pnpm dev:showcase) starts production-like and logged-in by default.1. dev default driver → SQLite (was in-memory)
In dev with no
OS_DATABASE_URL/OS_DATABASE_DRIVER,serve.tspreviously defaulted to the pure-JSInMemoryDriver(mingo) — which diverges from real SQL semantics, so "works in dev" didn't guarantee "works in prod". Now it prefersSqlDriver(sqlite, :memory:).connect()→SELECT 1), because knex loadsbetter-sqlite3lazily at first query, not at construction.InMemoryDriverwith a visible warning if the native binary is unavailable (not built / ABI mismatch after a Node upgrade / blocked prebuild download). This also closes a latent hole where the surrounding silentcatchcould leave the kernel with no driver.2.
--seed-admindefaults ON in devA bare
devnever seeded the initial admin, so you always hit the first-run sign-up wizard. Now--seed-admindefaults ON.admin@objectos.ai/admin123only on an empty DB (thenbootstrapPlatformAdminpromotes that first user to platform admin), and skips when the email already exists (422/400) — a custom password is never overwritten.--no-seed-admin.Verification
tsc --noEmit+ build green.pnpm dev:showcase: banner showsDriver: SqlDriver(sqlite) → :memory:and🔑 Admin seeded: admin@objectos.ai / admin123.(admin admin@objectos.ai already exists — skipping seed)— no overwrite, no error.🤖 Generated with Claude Code