@crvouga/mockingbird-service-sqlite 1.0.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +11 -5
  3. package/package.json +3 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog — @crvouga/mockingbird-service-sqlite
2
2
 
3
+ ## 1.2.0 (2026-09-30)
4
+
5
+ ### Features
6
+
7
+ - state each mock's parity and share one CSS reset ([264b06e](https://github.com/crvouga/mockingbird/commit/264b06ef15efc1d5131bbf78c89f45e2ce86b557))
8
+
9
+ ## 1.1.0 (2026-09-29)
10
+
11
+ ### Features
12
+
13
+ - share one field-guide identity across the docs site and READMEs ([024f445](https://github.com/crvouga/mockingbird/commit/024f445c143e0d2d07a4dd0a3c063bca94c59623))
14
+
15
+ ### Fixes and improvements
16
+
17
+ - typecheck the postgres and sqlite README signature blocks ([cd2080b](https://github.com/crvouga/mockingbird/commit/cd2080b1af98f2746de063f289382527e28acfb2))
18
+
3
19
  ## 1.0.0 (2026-09-24)
4
20
 
5
21
  ### ⚠️ Breaking changes
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # @crvouga/mockingbird-service-sqlite
2
2
 
3
+ > Familiar calls. Faithful echoes. Part of [Mockingbird](https://github.com/crvouga/mockingbird).
4
+
3
5
  Pure TypeScript, completely in-memory SQLite engine aiming for **full SQLite3 SQL dialect parity**
4
6
  (same statements, same results). Use it in tests (or the browser) wherever you want real SQLite SQL
5
7
  semantics without native bindings: schema + migrations, constraints, transactions, JSON functions,
@@ -296,14 +298,14 @@ Stable runtime exports of the main entry:
296
298
  Signatures (types are exported too: `DatabaseOptions`, `RunResult`, `ResultSet`, `ErrorCategory`,
297
299
  `BindValue`, `QueryRow`, `QueryValue`):
298
300
 
299
- ```text
301
+ ```ts
300
302
  interface DatabaseOptions {
301
303
  seed?: number | bigint // default 1; ignored when random is "os"
302
304
  random?: "deterministic" | "os" // default "deterministic"; "os" is CSPRNG like SQLite
303
305
  now?: Date | (() => Date) | "system" // default 2000-01-01T00:00:00.000Z; "system" is wall clock
304
306
  }
305
307
 
306
- class Database {
308
+ declare class Database {
307
309
  constructor(options?: DatabaseOptions)
308
310
  exec(sql: string): void
309
311
  query<T = QueryRow>(sql: string, params?: readonly BindValue[], options?: { at?: Snapshot }): T[]
@@ -320,13 +322,17 @@ class Database {
320
322
  readonly randomMode: "deterministic" | "os"
321
323
  }
322
324
 
323
- class Statement {
325
+ declare class Statement {
324
326
  run(...params: BindValue[]): RunResult
325
327
  all<T = QueryRow>(...params: BindValue[]): T[]
326
328
  get<T = QueryRow>(...params: BindValue[]): T | undefined
327
329
  result(...params: BindValue[]): ResultSet // includes columns + values when zero rows
328
330
  }
329
331
 
332
+ type ErrorCategory = string // "syntax" | "no_such_table" | "constraint_unique" | "misuse" | ...
333
+ type QueryValue = null | number | bigint | string | Uint8Array
334
+ type QueryRow = Record<string, QueryValue>
335
+ type BindValue = QueryValue | boolean | ArrayBuffer
330
336
  interface RunResult { changes: number; lastInsertRowid: number | bigint }
331
337
  interface ResultSet {
332
338
  columns: string[]
@@ -336,13 +342,13 @@ interface ResultSet {
336
342
  lastInsertRowid: number | bigint
337
343
  }
338
344
 
339
- class Snapshot {
345
+ declare class Snapshot {
340
346
  open(options?: DatabaseOptions): Database
341
347
  encode(): Uint8Array
342
348
  static decode(bytes: Uint8Array): Snapshot
343
349
  }
344
350
 
345
- class SqliteError extends Error {
351
+ declare class SqliteError extends Error {
346
352
  readonly category: ErrorCategory // "syntax", "no_such_table", "constraint_unique", "misuse", ...
347
353
  readonly sqliteCode: string // always set; default "SQLITE_ERROR"
348
354
  readonly code: string // === sqliteCode (Node err.code convention)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crvouga/mockingbird-service-sqlite",
3
- "version": "1.0.0",
3
+ "version": "1.2.0",
4
4
  "description": "Pure TypeScript in-memory SQLite implementation with zero WASM/native dependencies",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -95,6 +95,7 @@
95
95
  "devDependencies": {
96
96
  "@arethetypeswrong/cli": "^0.18.5",
97
97
  "@biomejs/biome": "^2.5.8",
98
+ "@crvouga/mockingbird-ui": "0.0.0-development",
98
99
  "@types/bun": "latest",
99
100
  "alasql": "^4.17.3",
100
101
  "esbuild": "^0.28.2",
@@ -126,6 +127,6 @@
126
127
  "docs": "https://sqlite.org/docs.html",
127
128
  "description": "SQLite is a small, fast, self-contained, public-domain SQL database engine, the most widely deployed database in the world."
128
129
  },
129
- "status": "ready"
130
+ "parity": "In-memory SQL engine"
130
131
  }
131
132
  }