Repository navigation
Releases: forinda/kzig
Release list
v0.3.0
kzig 0.3.0 gives the app's mode a kzig name: KZIG_ENV. Requires Zig 0.17.0. Pre-alpha: APIs will change.
Highlights
KZIG_ENVsays how the app runs:development,test, or anything else (unset included) for production. It turns ondev_defaults, the migrations-at-boot policy, and Swagger withdisable_in_prod.NODE_ENVis still read whenKZIG_ENVisn't set, so KickJS.envfiles and deployment configs keep working;KZIG_ENVwins when both are set.Process.env: inject*const kzig.Processand read.development,.@"test"or.production(dev_or_testis still there).kzig new: the scaffoldedConfigno longer has anode_envfield that defaulted todevelopmentwhile the app ran as production, and its tests boot withKZIG_ENV=test.- Releases now get their notes from
scripts/release-notes.sh: hand-written highlights from.github/release-notes/<tag>.md, then the commits since the last tag. RELEASING.md documents the flow.
Changes to note when upgrading
kzig devandkzig startsetKZIG_ENV(todevelopment/production) instead ofNODE_ENV, and only when neither is set. If your ownConfigreads anode_envfield, either setNODE_ENVyourself or readProcess.envinstead.
Features
- KZIG_ENV says how the app runs (NODE_ENV still read when it's unset); Process.env; the scaffold's Config drops its misleading node_env
Maintenance
- release notes from the commits since the last tag (scripts/release-notes.sh, used by the release workflow); RELEASING.md
Install
zig fetch --save git+https://github.com/forinda/kzig#v0.3.0Prebuilt kzig CLIs for Linux (x86_64, aarch64) and macOS (x86_64, arm64) are attached, with SHA256SUMS.
Full changelog: v0.2.0...v0.3.0
v0.2.0
kzig 0.2.0 adds scheduled jobs, file storage and a database layer, and moves the docs to
https://forinda.github.io/kzig/, with a tutorial from
kzig new to a Docker image. Requires Zig 0.17.0. Pre-alpha: APIs will change.
Highlights
Database (kzig.db)
kick/db's code-first layer, in Zig.
-
Postgres without libpq. A pure-Zig client with SCRAM-SHA-256, a pool and transactions, and rows decoded into structs by column name.
- TLS follows libpq's
sslmode, withsslrootcertor the system's CAs, andsslnegotiation=direct(Postgres 17). - Channel binding (SCRAM-SHA-256-PLUS).
- Client certificates on TLS 1.3 and 1.2: EC, RSA and Ed25519 keys, encrypted keys with
sslpassword. - Revocation lists (
sslcrl).
- TLS follows libpq's
-
Schema and queries. Tables are Zig struct literals. The query builder covers select, insert, update, delete, joins,
upsert,findOrCreateandinsertMany, and a wrong column or value type is a compile error. -
Relations.
one,manyandthroughare resolved with kick/db's rules.client.query(.t).findMany(.{ .with = … })reads nested rows in one statement. -
Migrations.
kzig db generatewrites kick/db's migration folders from your schema, with renames by prompt or flag;kzig db checkis for CI.kzig db migrate,rollbackandstatus, orkzig.db.migrate.onBoot, apply them, so a kick/db app and a kzig app can share a folder. -
SQLite, Turso and Cloudflare D1. The same schema, builder, relations and migrations, in three forms:
sqlite:pathfor local files. Needs-Dsqlite, which builds SQLite's C library; the default build stays C-free.libsql://for Turso, over HTTP.d1://for D1, over its REST API.
On SQLite, Turso and D1, parameters bind by their Zig type.
Also new
- Scheduled jobs.
pub const crons = .{ … }on any service: 5- or 6-field expressions checked at compile time, timezones from zoneinfo, overlap control, manual runs. - Storage.
kzig.storageover memory, a disk folder, or S3 (AWS, R2, MinIO, SeaweedFS), with SigV4 signing (no SDK), presigned links and listing. - Routing. Routes now match through a segment tree built at compile time.
Docs
- The guides moved from the README to a site built with MkDocs (Material).
- The API reference is built from the source by Zig's autodoc, at /api/.
- The tutorial builds a bookmarks API: SQLite with migrations, validation, an API key, Swagger UI, tests, production settings and a 25 MB Docker image.
Changes to note when upgrading
Pool.queryParams/execParams(and theTxversions) take[]const kzig.db.Param; wrap raw text withkzig.db.Param.texts(arena, values).kzig db generateandkzig db checkneed--db <name>when the app has more than one database adapter with a schema.
Install
zig fetch --save git+https://github.com/forinda/kzig#v0.2.0Prebuilt kzig CLIs for Linux (x86_64, aarch64) and macOS (x86_64, arm64) are attached below, with SHA256SUMS.
v0.1.0
Full Changelog: https://github.com/forinda/kzig/commits/v0.1.0