Overview

BackendDriverProfilesBuild option
SQLitezqlite, bundled3.45–3.53sqlite
PostgreSQLpg.zig15–18postgres, postgres_tls

A profile in sqlz.ziggy selects the grammar and type rules the checker applies. A backend can be checked without being in a project’s runtime set, but not the other way round.

SQLite

var conn = try sqlz.sqlite.open(allocator, io, "app.db", .{});
defer conn.deinit();

Open options cover foreign keys, journal mode, synchronous mode, the busy timeout and open flags. sqlz.sqlite.Pool wraps zqlite’s native pool.

PostgreSQL

The adapter supports pools, enum codecs and one-dimensional arrays, and checks the server version against the configured profile at connect time. CI runs the live conformance suite against PostgreSQL 15, 16, 17 and 18.

Portable queries

A query lists the backends it supports. Portable queries are checked against each listed backend’s catalog; backend-specific SQL is allowed for queries that name only that backend.

I/O runtimes

Every handle takes the application’s std.Io. The SQLite runtime is tested on std.Io.Threaded and on a zio-backed std.Io.