Base64URL cursor pagination, schema migration versioning, audit-log tables, JSON/CSV export, and DDL diffing for db/sqlite.
Keyset cursor and offset pagination, JSON/CSV table exporters, live schema diffing, and transactional audit-log tracking for Veko's Zero-FFI db/sqlite ORM.
veko pkg add sqlite_orm_ext@1.0.0Import in any Veko module:
use [ext = sqlite_orm_ext]Existing imports of sqlite_orm_ext/paginate remain fully supported via re-exports.
lib/db/sqlite and lib/codec/csv, running identically on the 64-bit VKO VM, Wasm 3.0 sandbox, and native binaries without external C SQLite bindings.ext/paginate-rows): Fetches limit + 1 rows in a single indexed query to determine has_more accurately without off-by-one ambiguity, returning next_cursor for O(log N) keyset pagination alongside next_offset and total.ext/diff-schema): Compares live B-tree table/index catalogs against a target sq/TableSpec and emits preview CREATE TABLE, ALTER TABLE ... ADD COLUMN, and CREATE [UNIQUE] INDEX DDL statements before migration.ext/insert-audited, ext/update-audited, and ext/delete-audited wrap mutations inside BEGIN/COMMIT transactions and capture structured JSON before and after snapshots in veko_audit_log.PageResult — { items block, limit i64, offset i64, total i64, has_more bool, next_cursor any, next_offset i64 }SchemaDiff — { table_name str, table_exists bool, up_to_date bool, missing_columns block, extra_columns block, missing_indexes block, migration_sql block }AuditEntry — { id i64, table_name str, record_id str, action str, actor str, before any, after any, changed_at i64 }ext/clamp-limit requested max_rows -> i64ext/paginate-rows db table_name limit [/offset i64] [/cursor any] [/pk str] [/desc bool] [/max-limit i64] -> PageResultext/export-json db table_name [/order-by str] -> strext/export-csv db table_name [/order-by str] -> strext/inspect-table db table_name -> mapext/diff-schema db spec -> SchemaDiffext/init-audit-log mut db -> enumext/insert-audited mut db spec record actor now_unix -> i64ext/update-audited mut db spec record_id patch actor now_unix -> i64ext/delete-audited mut db spec record_id actor now_unix -> i64ext/query-audit-log db [/table str] [/record-id str] -> block[AuditEntry]use [ext = sqlite_orm_ext, sq = db/sqlite]
users = sq/define-table 'users' (quote [
id i64 .pk
email str .unique
role str = 'member'
])
mut db = sq/open ':memory:'
_ = sq/migrate mut db users
_ = ext/init-audit-log mut db
uid = ext/insert-audited mut db users { email = 'ada@veko-lang.org', role = 'admin' } 'system' 1700000000
page = ext/paginate-rows db 'users' 10
csv_data = ext/export-csv db 'users'
println csv_datahttps://veko-lang.org/pkg/sqlite_orm_ext/1.0.0.vkp1d4dcfbab7d30ef2381bc40a932ba8ac4de87e51540bd06b73ecfc28208eaa9688382c8da86d42d7fc03914232544604b449c46569e123ecc44ca33afbb6f419ed25519:27406074d8681da1d4e6420f5d887cac15c313334c249ac047ba9d4e2df72b70{"name":"sqlite_orm_ext","version":"1.0.0","tier":6.0,"tier_label":"Tier 6: Local-First, IoT, Web & Media","category":"Zero-FFI SQLite ORM Extensions","description":"Base64URL cursor pagination, schema migration versioning, audit-log tables, JSON/CSV export, and DDL diffing for db/sqlite.","modules":["sqlite_orm_ext","sqlite_orm_ext/paginate"],"homepage":"https://veko-lang.org/packages/sqlite_orm_ext"}| Bundle Entry Path | Size | Leaf SHA-256 Digest |
|---|---|---|
| README.md | 2 KB | 98a61c0bc29401c2c914cce02e7185cad8c92ed2f4ae879feaf0fb085a22a5d6 |
| examples/demo.vk | 6 KB | 5aad42d57b36f6591893b5b3644ae94ce577e17663d791084e5fca863fb87d04 |
| mod.vk | 13 KB | cc8608e31b10e8d062c3c65d0fb39774c96f0971b371a18dfc71d2a5d730eff2 |
| paginate.vk | 1 KB | 1099b6befbcf3d37783574a9554f17869b4be8d6c894cd798b076d288e2df05f |