Add database type step (SQLite/Postgres) to create-app wizard - #6
Draft
surajair wants to merge 1 commit into
Draft
Add database type step (SQLite/Postgres) to create-app wizard#6surajair wants to merge 1 commit into
surajair wants to merge 1 commit into
Conversation
Introduce a new "Database type" prompt before the existing SQLite config step. Choosing PostgreSQL collects a connection URL (validated for a postgres:// or postgresql:// shape) and pulls the template from the `postgres` branch instead of `main`. SQLite keeps its existing local/ remote flow unchanged. - Add chooseDatabaseType step and wire it into the flow - Widen DbChoice to 'sqlite' | 'postgres' - Resolve template branch per db choice via templateSource() - Skip the SQLite config step when postgres is chosen - Add postgres URL validator and tests Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Mq5yZj1buYYbGUr1qDDSS3
There was a problem hiding this comment.
Pull request overview
This PR extends the create-app wizard to support choosing a database type (SQLite vs PostgreSQL) up front. PostgreSQL selection collects a connection URL, validates it, skips the SQLite configuration step, and downloads the app template from the postgres branch; SQLite continues to use the existing local/remote flow and pulls from main.
Changes:
- Added a new
chooseDatabaseTypestep to prompt for SQLite vs PostgreSQL and (for PostgreSQL) collect/validate the connection URL. - Updated template download logic to resolve the template branch based on the selected database type.
- Added URL validation helper for PostgreSQL and expanded test coverage for the new flow.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/steps/download-template.test.ts | Verifies correct template source (#main for SQLite, #postgres for PostgreSQL). |
| tests/steps/choose-database.test.ts | Ensures SQLite step is a no-op when PostgreSQL was chosen earlier. |
| tests/steps/choose-database-type.test.ts | Adds coverage for database type selection, URL capture/dequoting, validation, and cancel handling. |
| tests/lib/postgres-url.test.ts | Adds unit tests for PostgreSQL URL shape validation. |
| tests/commands/create-app.test.ts | Updates wizard prompt scripts for new step; adds end-to-end PostgreSQL flow assertions. |
| src/steps/download-template.ts | Switches template download source to be computed from the selected database type. |
| src/steps/choose-database.ts | Skips SQLite configuration when PostgreSQL is selected. |
| src/steps/choose-database-type.ts | Implements new wizard step to select DB type and collect PostgreSQL URL. |
| src/lib/postgres-url.ts | Introduces validatePostgresUrlShape helper to validate postgres:// / postgresql:// URLs with hostname. |
| src/core/context.ts | Expands DbChoice to `'sqlite' |
| src/constants.ts | Adds templateSource(dbChoice) and per-db template branch mapping. |
| src/commands/create-app-run.ts | Wires chooseDatabaseType into the create-app step sequence before SQLite configuration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
surajair
marked this pull request as draft
July 20, 2026 04:01
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.
Introduce a new "Database type" prompt before the existing SQLite config
step. Choosing PostgreSQL collects a connection URL (validated for a
postgres:// or postgresql:// shape) and pulls the template from the
postgresbranch instead ofmain. SQLite keeps its existing local/remote flow unchanged.
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01Mq5yZj1buYYbGUr1qDDSS3