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

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
@@ -5008,6 +5008,9 @@ class SQLiteReadTransaction {
5008
5008
  deserializeValue(value, column) {
5009
5009
  if (value === null || value === undefined)
5010
5010
  return null;
5011
+ if (column.arcType === "boolean") {
5012
+ return Boolean(value);
5013
+ }
5011
5014
  switch (column.type.toLowerCase()) {
5012
5015
  case "json":
5013
5016
  if (typeof value === "string") {
@@ -5248,6 +5251,9 @@ class SQLiteReadWriteTransaction extends SQLiteReadTransaction {
5248
5251
  serializeValue(value, column) {
5249
5252
  if (value === null || value === undefined)
5250
5253
  return null;
5254
+ if (column.arcType === "boolean") {
5255
+ return value ? 1 : 0;
5256
+ }
5251
5257
  switch (column.type.toLowerCase()) {
5252
5258
  case "timestamp":
5253
5259
  case "datetime":
@@ -5374,6 +5380,7 @@ class SQLiteAdapter {
5374
5380
  const columns = agnosticSchema.columns.map((columnInfo) => ({
5375
5381
  name: columnInfo.name,
5376
5382
  type: this.mapType(columnInfo.type, columnInfo.storeData),
5383
+ arcType: columnInfo.type,
5377
5384
  constraints: this.buildConstraints(columnInfo.storeData),
5378
5385
  isNullable: columnInfo.storeData?.isNullable || false,
5379
5386
  defaultValue: columnInfo.defaultValue,
@@ -5390,6 +5397,7 @@ class SQLiteAdapter {
5390
5397
  columns: columns.map((col) => ({
5391
5398
  name: col.name,
5392
5399
  type: col.type,
5400
+ arcType: col.arcType,
5393
5401
  isOptional: col.isNullable,
5394
5402
  default: col.defaultValue
5395
5403
  }))
@@ -5453,6 +5461,7 @@ class SQLiteAdapter {
5453
5461
  columns: allColumns.map((col) => ({
5454
5462
  name: col.name,
5455
5463
  type: this.mapType(col.type, col.storeData),
5464
+ arcType: col.type,
5456
5465
  isOptional: col.storeData?.isNullable || false,
5457
5466
  default: col.defaultValue
5458
5467
  }))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcote.tech/arc-adapter-db-sqlite",
3
- "version": "0.7.30",
3
+ "version": "0.7.31",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -20,7 +20,7 @@
20
20
  "test": "bun test"
21
21
  },
22
22
  "peerDependencies": {
23
- "@arcote.tech/arc": "^0.7.30"
23
+ "@arcote.tech/arc": "^0.7.31"
24
24
  },
25
25
  "devDependencies": {
26
26
  "typescript": "^5.0.0"