Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds first-class SQLite support to sqlx-ts, enabling validation and TS type generation against SQLite databases alongside existing Postgres/MySQL support.
Changes:
- Introduces SQLite connection pooling + query validation path in
coreand wires it through shared connection/config code. - Adds SQLite schema introspection and SQLite-specific SQL parsing/type-affinity mapping for TS generation.
- Adds SQLite-focused integration tests for
?parameters and type output.
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/sqlite_query_parameters.rs | New integration tests covering SQLite ? parameters, result typing, and invalid SQL handling. |
| test-utils/src/sandbox.rs | Extends test harness to allow running the CLI without host/user/pass when db_type=sqlite. |
| src/ts_generator/types/ts_query.rs | Adds SQLite column-type-affinity → TS type mapping. |
| src/ts_generator/information_schema.rs | Adds SQLite table introspection via PRAGMA table_info and integrates into DBSchema::fetch_table. |
| src/ts_generator/generator.rs | Uses sqlparser’s SQLiteDialect when generating types for SQLite connections. |
| src/core/sqlite/prepare.rs | Adds SQLite query validation implementation (currently via EXPLAIN). |
| src/core/sqlite/pool.rs | Adds bb8 manager for SQLite using rusqlite connections. |
| src/core/sqlite/mod.rs | Exposes SQLite core modules. |
| src/core/mod.rs | Registers core::sqlite module. |
| src/core/connection.rs | Adds DBConn::SqliteConn and routes prepare()/get_db_type() accordingly. |
| src/common/types.rs | Adds DatabaseType::Sqlite. |
| src/common/lazy.rs | Creates and caches SQLite pools from config. |
| src/common/dotenv.rs | Parses DB_TYPE=sqlite from .env. |
| src/common/config.rs | Adjusts default-connection config rules for SQLite and adds get_sqlite_path(). |
| Cargo.toml | Adds rusqlite dependency (and duplicates it in dev-deps). |
| Cargo.lock | Locks new rusqlite/sqlite transitive dependencies. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.