firebird-wasm 0.9.0 → 0.10.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 (2) hide show
  1. package/CHANGELOG.md +78 -0
  2. package/package.json +21 -3
package/CHANGELOG.md CHANGED
@@ -4,6 +4,84 @@ All notable changes to `firebird-wasm`. This project follows
4
4
  [semantic versioning](https://semver.org/); while the major version is 0 the
5
5
  API may still move between minor releases.
6
6
 
7
+ ## 0.10.0 — 2026-10-24
8
+
9
+ ### Added
10
+
11
+ - **Kysely and Drizzle ORM dialects (`firebird-wasm/kysely` and
12
+ `firebird-wasm/drizzle`).** Both run against `FirebirdBrowser` and
13
+ `FirebirdLite`:
14
+ - `firebird-wasm/kysely` exports `FirebirdDialect`, `FirebirdDriver`,
15
+ `FirebirdQueryCompiler`, `FirebirdAdapter`, `FirebirdIntrospector`, and
16
+ `createKysely(db, config?)`. Compiles `?` positional parameters, Firebird
17
+ `OFFSET ? ROWS FETCH NEXT ? ROWS ONLY` pagination (and `ROWS ?` on
18
+ `UPDATE` / `DELETE`), multi-row `INSERT INTO … SELECT … FROM RDB$DATABASE
19
+ UNION ALL …`, `UPDATE OR INSERT INTO … MATCHING (…)` upserts on
20
+ `onConflict`, `INSERT` / `UPDATE` / `DELETE … RETURNING`, Firebird DDL
21
+ (`GENERATED BY DEFAULT AS IDENTITY` before `PRIMARY KEY`, `CREATE GLOBAL
22
+ TEMPORARY TABLE`, `ALTER TABLE … ADD / DROP / ALTER COLUMN … TO …`),
23
+ transactions with Firebird isolation levels and savepoints, cursor
24
+ streaming over `queryStream()`, system-table introspection
25
+ (`RDB$RELATIONS` / `RDB$RELATION_FIELDS`), and bijective lowercase/uppercase
26
+ identifier folding (`identifierCase: 'lower' | 'preserve'`).
27
+ - `firebird-wasm/drizzle` exports `drizzle(db, config?)`,
28
+ `FirebirdDrizzleDialect`, `FirebirdDrizzleSession`,
29
+ `FirebirdDrizzlePreparedQuery`, `FirebirdDrizzleTransaction`,
30
+ `FirebirdDrizzleDatabase`, `firebirdTable`, column builders, and query
31
+ operators. Supports relational queries (`db.query.*.findMany()`),
32
+ multi-row inserts, omitted identity/default columns, `onConflictDoUpdate`
33
+ via `UPDATE OR INSERT … MATCHING`, `RETURNING`, `db.$count()`,
34
+ transactions, and nested savepoints.
35
+ - **Cursor / streaming query API (`queryStream()`).** `queryStream(sql,
36
+ params?, options?)` on `FirebirdBrowser`, `FirebirdBrowserTransaction`,
37
+ `FirebirdLite`, and `FirebirdTransaction` (including `sql` tagged-template
38
+ overloads) returns an `AsyncIterable<QueryResult<T>>` yielding batches of
39
+ `batchSize` rows (default `500`) over an open cursor (`_fb_cursor_open`,
40
+ `_fb_cursor_fetch`, `_fb_cursor_close` in the WASM C bridge;
41
+ `ResultSet.fetch({ fetchSize })` on Node). Breaking out of `for await` early
42
+ closes the cursor and finishes its autocommit transaction immediately without
43
+ fetching the rest of the table.
44
+ - **Node backend `types` and `FieldInfo` parity.** `FirebirdLite` and
45
+ `FirebirdTransaction` now accept `types: { bigint, dates, binary, parsers,
46
+ serializers }` at database construction and per-query (`QueryOptions.types`),
47
+ populate full `FieldInfo` metadata (`type`, `typeName`, `subType`, `scale`,
48
+ `length`, `nullable`) from the native statement metadata, and normalize wire
49
+ values (`BIGINT`, `INT128`, scaled `NUMERIC` / `DECIMAL`, `DATE`, `TIME`,
50
+ `TIMESTAMP`, `TIME WITH TIME ZONE`, `TIMESTAMP WITH TIME ZONE`, `DECFLOAT`,
51
+ text/binary `BLOB`s, and `OCTETS`) to match `FirebirdBrowser`.
52
+ - **Shape server `replica=full`, `applyWrite`, `DECFLOAT`, and batched change
53
+ fetches.**
54
+ - `firebird-wasm/electric-server` now supports `?replica=full`: the update
55
+ and delete triggers record prior column values in `OLD_VALUES` on
56
+ `ELECTRIC_CHANGES`, and `replica=full` responses include `old_value` on
57
+ updates (changed columns) and deletes (all non-key columns).
58
+ - `server.applyWrite(write)` executes a `PendingWrite` from
59
+ `createWriteQueue` directly against the Firebird source table in one
60
+ transaction and returns `{ txid }` for immediate write-queue confirmation.
61
+ - `changesAfter` batches row fetches for changed keys with `IN (?, …)` in
62
+ chunks of 200 instead of issuing one `SELECT` per changed key.
63
+ - `DECFLOAT(16)` and `DECFLOAT(34)` (`SQL_DEC16 = 260`, `SQL_DEC34 = 262`)
64
+ are decoded in the C bridge, mapped in `firebird-wasm/electric-server`, and
65
+ accepted by `firebird-wasm/electric`.
66
+
67
+ ### Changed
68
+
69
+ - **Zero-copy OPFS reads and writes on the default single-threaded build.**
70
+ When `HEAPU8.buffer` is a plain `ArrayBuffer` (`firebird-embedded-st`),
71
+ `mountOpfs` passes the WASM heap subarray directly to
72
+ `FileSystemSyncAccessHandle.read` and `.write` without allocating or copying
73
+ through an intermediate scratch buffer.
74
+ - **Faster C bridge value formatting.** `SQL_FLOAT` uses `std::to_chars`,
75
+ offset-based `SQL_TIME_TZ` and `SQL_TIMESTAMP_TZ` (`0..2878`) are decoded in
76
+ C without `IUtil`, and `appendScaledDecimal` writes directly into the JSON
77
+ buffer without temporary string shifts.
78
+ - **Incremental WASM rebuilds and CI verification.** `wasm/build.sh` preserves
79
+ the timestamps of unchanged `autoconfig.h`, `parse.h` / `parse.cpp`, and
80
+ `epp-generated` outputs across native bootstrap rebuilds, and
81
+ `build-wasm.yml` runs an incremental rebuild check after wiping
82
+ `build-native-config` and `.wasm-patches-applied` and touching
83
+ `fb_wasm_api.cpp`.
84
+
7
85
  ## 0.9.0 — 2026-10-19
8
86
 
9
87
  ### Changed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "firebird-wasm",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "Firebird embedded database in WebAssembly — runs in the browser and Node, like PGlite for PostgreSQL",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -38,6 +38,14 @@
38
38
  "types": "./dist/electric-server/index.d.ts",
39
39
  "default": "./dist/electric-server/index.js"
40
40
  },
41
+ "./kysely": {
42
+ "types": "./dist/kysely/index.d.ts",
43
+ "default": "./dist/kysely/index.js"
44
+ },
45
+ "./drizzle": {
46
+ "types": "./dist/drizzle/index.d.ts",
47
+ "default": "./dist/drizzle/index.js"
48
+ },
41
49
  "./package.json": "./package.json"
42
50
  },
43
51
  "scripts": {
@@ -66,9 +74,11 @@
66
74
  "node-firebird-driver": "^3.5.0"
67
75
  },
68
76
  "peerDependencies": {
77
+ "@electric-sql/client": ">=1.5",
78
+ "drizzle-orm": ">=0.30",
79
+ "kysely": ">=0.27",
69
80
  "react": ">=18",
70
- "vue": ">=3.3",
71
- "@electric-sql/client": ">=1.5"
81
+ "vue": ">=3.3"
72
82
  },
73
83
  "peerDependenciesMeta": {
74
84
  "react": {
@@ -79,6 +89,12 @@
79
89
  },
80
90
  "@electric-sql/client": {
81
91
  "optional": true
92
+ },
93
+ "kysely": {
94
+ "optional": true
95
+ },
96
+ "drizzle-orm": {
97
+ "optional": true
82
98
  }
83
99
  },
84
100
  "devDependencies": {
@@ -89,8 +105,10 @@
89
105
  "@types/react-dom": "^19.2.2",
90
106
  "@typescript-eslint/eslint-plugin": "^7.17.0",
91
107
  "@typescript-eslint/parser": "^7.17.0",
108
+ "drizzle-orm": "^0.45.4",
92
109
  "eslint": "^8.57.0",
93
110
  "jest": "^29.7.0",
111
+ "kysely": "^0.28.14",
94
112
  "react": "^19.2.0",
95
113
  "react-dom": "^19.2.0",
96
114
  "ts-jest": "^29.2.2",