Releases: alumna/sqlite
Release list
v1.2.0 - Nested JSON Indexes, Query Safety & Memory Tuning
This release synchronizes the SQLite adapter with Alumna Backend v0.5.7, bringing nested JSON indexing and query safety improvements.
Native Nested JSON Indexes
You can now mark deeply nested fields with unique: true or indexed: true in your Alumna Schema. The SQLite adapter automatically understands this and compiles the necessary CREATE INDEX statements using SQLite's native json_extract functions. Duplicate records on nested fields are gracefully intercepted and returned as 422 Unprocessable Entity.
Strict Query Safety
Previously, if a client passed an unknown field into a $filter, $select, or $sort query parameter, the adapter silently dropped it. This could lead to clients accidentally receiving unfiltered datasets. The query engine is now strictly sealed: any reference to an undeclared schema field immediately halts the request with a 400 Bad Request.
Zero-Allocation Tuning & Resilience
- Perfectly Sized Hashes: Internal
createandpatchoperations now perfectly calculate theirinitial_capacity, eliminating mid-flight buffer resizing. - O(1) Patch Validation: Column validation during
PATCHoperations now uses a flat array inclusion check, completely bypassing structural dot-notation scanning. - Panic-Proof Dates: If your SQLite database contains legacy or corrupt strings in a
Timecolumn, the adapter now safely maps them tonilrather than raising an unhandled parsing exception.
v1.1.0 - Unique and Indexes, Nullability, and Zero-Allocation SQL
This release brings the SQLite adapter to full feature parity with Alumna Backend v0.5.5, adding index generation, uniqueness constraints, and explicit nullability, as well as performance optimizations.
Highlights
- Unique Constraints: The adapter now intercepts
unique: trueand compound.index(..., unique: true)traits, returning a semantic422 Unprocessable Entityon duplicate entries. This cleanly prevents fatal SQLite constraint exceptions and 500 Server Errors. - Auto-Indexing Helper: Added
SqliteAdapter#create_indexes!. Calling this upon initialization automatically reads your schema and generates the exactCREATE INDEXandCREATE UNIQUE INDEXstatements in SQLite. It also works natively with nested JSON dot-notation fields. - Explicit Nullability: Complete, type-safe support for the
nullable: trueschema trait, flawlessly mapping CrystalNilto SQLiteNULL. - Zero-Allocation SQL Engine: The SQL query builder for
find,create,update, andpatchhas been deeply refactored. Queries are now streamed directly to memory buffers, bypassing intermediate string, array, and hash allocations entirely. - Hardened Type Safety: The
cast_from_dblayer has been hardened to never trigger runtime panics (likeTypeCastError) even if the underlying SQLite file contains corrupt or mismatched primitive types.
Code Coverage
This release maintains a strict 100% test coverage.