-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSqlite.affine
More file actions
19 lines (16 loc) · 793 Bytes
/
Copy pathSqlite.affine
File metadata and controls
19 lines (16 loc) · 793 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// SPDX-License-Identifier: MPL-2.0
// Copyright (c) 2026 Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
//
// Sqlite.affine — extern bindings for an SQLite backend.
//
// All database handles are opaque Int. Query parameters are JSON-encoded
// strings; each result row is returned as a JSON-encoded string for
// caller-side decoding. The Node-CJS shim wraps Deno sqlite or node:sqlite.
module Sqlite;
pub extern type Db;
pub extern fn db_open(path: String) -> Db;
pub extern fn db_close(d: Db) -> Int;
pub extern fn db_execute(d: Db, sql: String) -> Int;
pub extern fn db_query(d: Db, sql: String, params_json: String) -> String;
pub extern fn db_query_one(d: Db, sql: String, params_json: String) -> String;
pub extern fn db_query_int(d: Db, sql: String, params_json: String) -> Int;