A portable SQLite subset with typed statements, an AOT compiler and SQLite page output
moon add mizchi/sqlike@0.2.0let db = @sqlike.Connection::open(":memory:")
let statement = db.prepare("SELECT ?")
statement.bind(index=1, 9007199254740993L)
if statement.step() {
let value : Int64 = statement.column(index=0)
assert_eq(value, 9007199254740993L)
}
statement.finalize()
db.close()| Package | Purpose |
|---|---|
| mizchi/sqlike | Baseline SQL and typed values: CRUD, RETURNING, JOINs, aggregates, indexes, transactions, FK and STRICT |
| mizchi/sqlike/full | All implemented SQL features, including JSON, CTEs, triggers and windows |
| mizchi/sqlike/aot | Programs and named prepared statements without the SQL parser; JS/Wasm GC |
| mizchi/sqlike/compiler | Build-time schema and SQL compilation |
| mizchi/sqlike/fts | Optional full-text search, separate from the SQL runtime |
trait Bindtrait Columnpub suberror SqliteError {
SqliteError(code~ : ErrorCode, extended~ : ExtendedCode?, msg~ : String)
}type AotPreparedValuestype AotSnapshottype Connectionpub(all) enum ErrorCode {
Error
Busy
ReadOnly
Corrupt
Constraint
Mismatch
Misuse
Range
CantOpen
Unknown(Int)
} derive(Eq)pub(all) enum ExtendedCode {
ConstraintCheck
ConstraintForeignKey
ConstraintNotNull
ConstraintPrimaryKey
ConstraintUnique
ConstraintTrigger
ConstraintDatatype
Unknown(Int)
} derive(Eq)type SqlPreparedtype SqlitePagertype Statementfn database_prepared_exec(query : SqlPrepared, bindings : String, read_only : Bool, positional : Bool) -> StringInstall
Download zipA portable SQLite subset with typed statements, an AOT compiler and SQLite page output