@arcote.tech/arc-adapter-db-sqlite-wasm 0.7.30 → 0.7.32

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/dist/index.js +9 -0
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -5099,6 +5099,9 @@ class SQLiteWasmReadTransaction {
5099
5099
  deserializeValue(value, column) {
5100
5100
  if (value === null || value === undefined)
5101
5101
  return null;
5102
+ if (column.arcType === "boolean") {
5103
+ return Boolean(value);
5104
+ }
5102
5105
  switch (column.type.toLowerCase()) {
5103
5106
  case "json":
5104
5107
  if (typeof value === "string") {
@@ -5322,6 +5325,9 @@ class SQLiteWasmReadWriteTransaction extends SQLiteWasmReadTransaction {
5322
5325
  serializeValue(value, column) {
5323
5326
  if (value === null || value === undefined)
5324
5327
  return null;
5328
+ if (column.arcType === "boolean") {
5329
+ return value ? 1 : 0;
5330
+ }
5325
5331
  if (typeof value === "object" && !Array.isArray(value) && !(value instanceof Date) && Object.keys(value).length === 0) {
5326
5332
  return null;
5327
5333
  }
@@ -5441,6 +5447,7 @@ class SQLiteWasmAdapter {
5441
5447
  const columns = agnosticSchema.columns.map((columnInfo) => ({
5442
5448
  name: columnInfo.name,
5443
5449
  type: this.mapType(columnInfo.type, columnInfo.storeData),
5450
+ arcType: columnInfo.type,
5444
5451
  constraints: this.buildConstraints(columnInfo.storeData),
5445
5452
  isNullable: columnInfo.storeData?.isNullable || false,
5446
5453
  defaultValue: columnInfo.defaultValue,
@@ -5452,6 +5459,7 @@ class SQLiteWasmAdapter {
5452
5459
  columns: columns.map((col) => ({
5453
5460
  name: col.name,
5454
5461
  type: col.type,
5462
+ arcType: col.arcType,
5455
5463
  isOptional: col.isNullable,
5456
5464
  default: col.defaultValue
5457
5465
  }))
@@ -5506,6 +5514,7 @@ class SQLiteWasmAdapter {
5506
5514
  columns: allColumns.map((col) => ({
5507
5515
  name: col.name,
5508
5516
  type: this.mapType(col.type, col.storeData),
5517
+ arcType: col.type,
5509
5518
  isOptional: col.storeData?.isNullable || false,
5510
5519
  default: col.defaultValue
5511
5520
  }))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcote.tech/arc-adapter-db-sqlite-wasm",
3
- "version": "0.7.30",
3
+ "version": "0.7.32",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -39,7 +39,7 @@
39
39
  "dev": "bun build ./src/index.ts ./src/worker.ts --outdir ./dist --target browser --format esm --watch"
40
40
  },
41
41
  "peerDependencies": {
42
- "@arcote.tech/arc": "^0.7.30",
42
+ "@arcote.tech/arc": "^0.7.32",
43
43
  "@sqlite.org/sqlite-wasm": "^3.46.0-build1"
44
44
  },
45
45
  "devDependencies": {