Skip to content

sqlite support#270

Open
JasonShin wants to merge 3 commits intomainfrom
sqlite
Open

sqlite support#270
JasonShin wants to merge 3 commits intomainfrom
sqlite

Conversation

@JasonShin
Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings March 29, 2026 10:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 core and 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.

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