Skip to content

SQLite apps and amber database on Grant's own engine (2.0.19 candidate) - #82

Merged
crimson-knight merged 5 commits into
mainfrom
s3/sqlite-on-grant-engine
Nov 28, 2026
Merged

crimson-knight merged 5 commits into
mainfrom
s3/sqlite-on-grant-engine

Conversation

@crimson-knight

Copy link
Copy Markdown
Member

Makes Grant's own SQLite engine the default for amber new -d sqlite (re-applies #75, c55b725, onto main), after the 72-hour engine soak passed (2026-11-28T01:30Z, 0 lost commits of 727,228).

  • Generated config/database.cr requires grant/adapter/sqlite/grant_engine; its comment and the README name the one-line switch back: require "grant/adapter/sqlite". Database files are the same either way.
  • amber database runs on the same engine, so the CLI links no libsqlite3 (otool -L bin/amber: libSystem only, local build).
  • scripts/check_generated_app_linkage.sh now also fails on libsqlite3 / any sqlite3_ import, and runs sqlite3 ... PRAGMA integrity_check on the database amber database migrate wrote.
  • Version 2.0.19. Grant is re-pinned to the 0.29.0 release (Release 0.29.0: Grant's SQLite engine ready to be the default (merges 0.28.2 forward) crimson-knight/grant#169) before this leaves draft.

Release is held so this ships with the Beryl OpenSSL opt-out removal (B3V) as one Amber CLI release.

Local macOS gate on this head (Grant 0.28.2 pin): fresh app links libSystem only, 0 sqlite3_ imports, specs 1/0, scaffold specs 12/0, migrate development/test integrity_check ok, one-line switch to C builds with libsqlite3 and passes 12/0. amber_cli specs touched: 210 examples, 0 failures.

amber new -d sqlite now requires grant/adapter/sqlite/grant_engine, so the
app links no C SQLite library; a comment in config/database.cr and the
README name the one-line require that brings the C library back.
amber database runs on the same engine, so the CLI links no libsqlite3.
The generated-app linkage check now also fails on libsqlite3 or any
sqlite3_ import. Re-applies #75 (c55b725) on main; version 2.0.19.
…te3 reads its migrated database as sound

check_generated_app_linkage.sh now fails on any libsqlite3 library or
sqlite3_ import in the default and scaffolded apps, and runs the C sqlite3
tool's PRAGMA integrity_check on the test database amber database migrate
wrote through Grant's engine. CI installs the sqlite3 tool on Ubuntu; macOS
has /usr/bin/sqlite3. The release workflow also rejects libsqlite3 in the CLI.
Grant 0.29.0 carries the engine's Windows support, the C-parity fixes
(#145 #146 #150 #151 #153), C-shaped rollback journals (#156 #158), the
one-descent delete (#165) and the 0.28.1/0.28.2 fixes merged forward.
Generated apps and the CLI's own lock both pin it; the checksum is the one
Minecart wrote for a fresh amber new -d sqlite, and a frozen reinstall
verifies it.
…ned symbols, CLI linkage in PR CI

- check_generated_app_linkage.sh: integrity_check fails with a message when
  the test database is missing or sqlite3 itself fails, and opens it
  read-only so the tool never creates an empty file; the sqlite3_ count uses
  plain nm, so a statically linked libsqlite3 is caught too.
- build.yml: every build asserts the CLI links no libsqlite3 and holds no
  sqlite3_ symbol (otool on macOS, ldd on Linux).
- new_command_spec: pg and mysql apps keep their own adapter require and
  carry no SQLite engine note.
- ci.yml: the build-libraries comment matches what the CLI links.
@crimson-knight

Copy link
Copy Markdown
Member Author

Independent review (separate agent, crystal-conventions rubric): first pass at 3ed0480 MAJOR 0 / MINOR 6; MINOR 1, 2, 3, 5 and 6 fixed in b159659 and 6d92e10; re-review of 3ed0480..6d92e10 MAJOR 0 / MINOR 0, mergeable. MINOR 4 (unused templates/app/config/database.cr.ecr) left for a follow-up. CI 13/13 green on 6d92e10.

Gates on the candidate (Grant v0.29.0 pin):

  • macOS, m4-mini-02, crystal-alpha 1.22.3: fresh amber new -d sqlite links /usr/lib/libSystem.B.dylib only, 0 sqlite3_ imports, specs 1/0; after scaffold 12/0; amber database migrate development and test, /usr/bin/sqlite3 integrity_check ok; one-line switch to C builds with libsqlite3, specs 12/0.
  • Linux aarch64 and x86_64, agent-crystal 1.22.3-incremental-4, cross-compiled and linked in crystallang/crystal:1.21.0-build@sha256:34ac3d5d…: libc, libm, libgcc_s and the loader only; 0 sqlite3_/pcre2_/yaml_/z/iconv/gmp/OpenSSL imports; GET / 200, and GET /pets 200 after scaffold.

The release (tag, archives, Homebrew tap) is held so 2.0.19 ships together with the Beryl OpenSSL opt-out removal (relay B3V).

@crimson-knight
crimson-knight marked this pull request as ready for review November 28, 2026 04:28
@crimson-knight
crimson-knight merged commit 90a43f2 into main Nov 28, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant