Draft
Conversation
Add a new `sqlite` feature flag alongside the existing `postgres` feature, allowing compile-time selection of the database backend. This includes: - New `es-entity-macros-sqlite` proc macro crate generating SQLite-compatible SQL (positional `?N` params, `IS` instead of `IS NOT DISTINCT FROM`, etc.) - `src/db.rs` module with cfg-gated type aliases as the single chokepoint for database-specific types (Pool, Row, Db, etc.) - SQLite migration for test infrastructure with in-memory databases - All existing integration tests adapted to work with both backends - 82 macro unit tests + full integration test suite passing on SQLite Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The function in error.rs referenced sqlx::postgres::PgDatabaseError without a feature gate. Add #[cfg(feature = "postgres")] and a SQLite no-op variant. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
8370f31 to
7b2b5ae
Compare
Add nextest-sqlite-runner script that runs macro and integration tests with SQLite features (in-memory databases, no infrastructure needed). Add sqlite-tests job to test.yml workflow for CI visibility. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…and list_for The generated SQL for find_by and list_for queries used bare `= ?` equality, which fails when the bound parameter is NULL because `column = NULL` evaluates to NULL (falsy) in SQL. This caused zero rows to be returned when querying for NULL values on Option<T> columns. Switch to SQLite's `IS` operator for Option<T> columns, which handles NULL-safe equality (`NULL IS NULL` returns true). The list_for_filters variant already handled this correctly via its COALESCE pattern. Co-Authored-By: Claude Opus 4.6 <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.
Summary
sqlitefeature flag alongside the existingpostgresfeature for compile-time database backend selectiones-entity-macros-sqliteproc macro crate that generates SQLite-compatible SQL (positional?Nparams,ISinstead ofIS NOT DISTINCT FROM, noANY(), etc.)src/db.rsmodule with cfg-gated type aliases as the single chokepoint for all database-specific types (Pool,Row,Db,Transaction, etc.)Test plan
cargo test -p es-entity-macros-sqlite)cargo test --no-default-features --features sqlite -p es-entity)nix flake checkpasses (fmt, clippy-pg, clippy-sqlite, audit, deny)cargo test --features postgres)🤖 Generated with Claude Code