Design notes and technical writing on SwiftQL: SQL as a first-class language in Swift.
SwiftQL v1.9 makes a declared query the whole read path. A declaration can now be observed, called inside a transaction, and written with LIKE or REGEXP over a parameter. A new macro gives named bindings a typed packet, and a batch insert prepares one statement for a whole transaction.
How to set up SwiftQL 1.9's build-time SQLite validation for a package that declares its queries with @SQLQuery: generate the manifest from the declarations, then let swift build prepare every query against your real schema, with the exact commands and output.
SwiftQL v1.8.1 is a correctness and safety patch. Crashes become typed errors, silently wrong results are fixed or refused, REGEXP bounds its input, and a few queries that ran on 1.8.0 now need a one-line change.
SwiftQL v1.8 makes the build tell you which index to add. It captures what SQLite plans to do with each declared query, warns about the shapes that cost avoidable work, and proves each index it recommends by creating it on a disposable snapshot copy and re-planning.
SwiftQL v1.7 makes the REGEXP operator work. SQLite ships no regexp function, so the operator used to fail before it ran; SwiftQL now supplies one backed by Swift Regex, compiles each pattern once per statement instead of once per row, and lets you match a RegexBuilder pattern directly.
SwiftQL v1.6 makes SQLite's JSON surface typed Swift: the -> and ->> operators, json_extract, the constructor, inspection, mutation, and aggregate functions, JSONB variants, and a typed path builder. Decoding a large result set also got about 56% faster.
How to port an existing SQLite query to SwiftQL: clause by clause, in SQL's own order, with worked examples including a left join, grouped aggregates, and a full recursive CTE.
The design story behind SwiftQL: why Core Data and raw SQLite strings both fail, and why the library reads SQL in SQL's own order.
SwiftQL v1.5.5 adds async live-query streams, an @Observable wrapper for SwiftUI, and a lazy single-pass result set, and rebuilds Combine's publish() as an adapter over the new streams.
SwiftQL v1.5.4 moves scalar functions to method style, adds SwiftUI observers for live queries, restores the #row macro, and infers Setting's row type from the table.
v1.5.3 adds five SQLite value-codec presets, Date/JSON/UUID, and a per-property @SQLCodec attribute, all built on the existing v1.2 codec registry with no required migration.
SwiftQL v1.5.2 adds a manifest format, a standalone validator, and a SwiftPM build-tool plugin that check every static query against a real SQLite engine as part of swift build.
v1.5.1 adds @SQLQuery and @SQLQueries to generate cached, type-checked query functions from a plain Swift signature, a typed multi-statement transaction scope, nested result composition, and a @SQLFunction macro for custom SQL functions.
SwiftQL v1.4.6 cuts query construction-and-rendering allocations by around 15% through three internal fast paths, with no change to the public API or rendered SQL.
INSERT gains conflict-resolution clauses and upsert, RETURNING lands on INSERT, UPDATE, and DELETE, and UPDATE can now be scoped by a WITH clause.
SwiftQL v1.4.5 rounds out join coverage with NATURAL, USING, RIGHT, and FULL OUTER JOIN, adds MATERIALIZED hints and scalar common table expressions, and drops the XLResult requirement from compound queries.
SwiftQL v1.4.3 adds typed constructors for SQLite's date and time functions, with an ordered modifier type and integer component accessors.
A patch release that rounds out SwiftQL's expression and aggregate coverage: a unified cast API, typed BETWEEN, whole-row COUNT(*), and broader AVG/TOTAL support.
LIKE ESCAPE, NOT IN, nullable subqueries, custom collations, and REGEXP land, closing out the operator conformance matrix.
SwiftQL 1.3.0 adds no new public API; it backs the existing SQLite surface with a versioned conformance inventory, a real-database correctness corpus, and a live-query stress suite.
SwiftQL 1.2.0 adds a GRDB-free SwiftQLCore product, contextual value codecs, and durable static query descriptors underneath the unchanged v1 API, and fixes how COLLATE names and non-finite Double values render.
SwiftQL 1.1.0 adds NULL-aware aggregate APIs, an opt-in live-query retry policy for SQLITE_BUSY, and a verified, provenance-checked release pipeline.
SwiftQL's first tagged release: macro-generated table types, a SQL-shaped query API backed by GRDB, joins, CTEs, and custom types and functions.