@prisma/adapter-better-sqlite3 7.2.0 → 7.3.0-integration-fix-6-19-0-cloudflare-accelerate-engine.1

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.
package/dist/index.d.mts CHANGED
@@ -6,16 +6,16 @@ declare type BetterSQLite3InputParams = Options & {
6
6
  url: ':memory:' | (string & {});
7
7
  };
8
8
 
9
- export declare class PrismaBetterSqlite3 implements SqlMigrationAwareDriverAdapterFactory {
9
+ export declare class PrismaBetterSQLite3 implements SqlMigrationAwareDriverAdapterFactory {
10
10
  #private;
11
11
  readonly provider = "sqlite";
12
12
  readonly adapterName: string;
13
- constructor(config: BetterSQLite3InputParams, options?: PrismaBetterSqlite3Options);
13
+ constructor(config: BetterSQLite3InputParams, options?: PrismaBetterSQLite3Options);
14
14
  connect(): Promise<SqlDriverAdapter>;
15
15
  connectToShadowDb(): Promise<SqlDriverAdapter>;
16
16
  }
17
17
 
18
- declare type PrismaBetterSqlite3Options = {
18
+ declare type PrismaBetterSQLite3Options = {
19
19
  shadowDatabaseUrl?: string;
20
20
  timestampFormat?: 'iso8601' | 'unixepoch-ms';
21
21
  };
package/dist/index.d.ts CHANGED
@@ -6,16 +6,16 @@ declare type BetterSQLite3InputParams = Options & {
6
6
  url: ':memory:' | (string & {});
7
7
  };
8
8
 
9
- export declare class PrismaBetterSqlite3 implements SqlMigrationAwareDriverAdapterFactory {
9
+ export declare class PrismaBetterSQLite3 implements SqlMigrationAwareDriverAdapterFactory {
10
10
  #private;
11
11
  readonly provider = "sqlite";
12
12
  readonly adapterName: string;
13
- constructor(config: BetterSQLite3InputParams, options?: PrismaBetterSqlite3Options);
13
+ constructor(config: BetterSQLite3InputParams, options?: PrismaBetterSQLite3Options);
14
14
  connect(): Promise<SqlDriverAdapter>;
15
15
  connectToShadowDb(): Promise<SqlDriverAdapter>;
16
16
  }
17
17
 
18
- declare type PrismaBetterSqlite3Options = {
18
+ declare type PrismaBetterSQLite3Options = {
19
19
  shadowDatabaseUrl?: string;
20
20
  timestampFormat?: 'iso8601' | 'unixepoch-ms';
21
21
  };
package/dist/index.js CHANGED
@@ -30,7 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  // src/index.ts
31
31
  var index_exports = {};
32
32
  __export(index_exports, {
33
- PrismaBetterSqlite3: () => PrismaBetterSqlite3AdapterFactory
33
+ PrismaBetterSQLite3: () => PrismaBetterSQLite3AdapterFactory
34
34
  });
35
35
  module.exports = __toCommonJS(index_exports);
36
36
 
@@ -369,6 +369,10 @@ function mapRow(row, columnTypes) {
369
369
  const result = [];
370
370
  for (let i = 0; i < row.length; i++) {
371
371
  const value = row[i];
372
+ if (value instanceof ArrayBuffer || value instanceof Buffer) {
373
+ result[i] = Array.from(new Uint8Array(value));
374
+ continue;
375
+ }
372
376
  if (typeof value === "number" && (columnTypes[i] === import_driver_adapter_utils.ColumnTypeEnum.Int32 || columnTypes[i] === import_driver_adapter_utils.ColumnTypeEnum.Int64) && !Number.isInteger(value)) {
373
377
  result[i] = Math.trunc(value);
374
378
  continue;
@@ -421,6 +425,9 @@ function mapArg(arg, argType, options) {
421
425
  if (typeof arg === "string" && argType.scalarType === "bytes") {
422
426
  return Buffer.from(arg, "base64");
423
427
  }
428
+ if (Array.isArray(arg) && argType.scalarType === "bytes") {
429
+ return Buffer.from(arg);
430
+ }
424
431
  return arg;
425
432
  }
426
433
 
@@ -586,7 +593,7 @@ var BetterSQLite3Transaction = class extends BetterSQLite3Queryable {
586
593
  return Promise.resolve();
587
594
  }
588
595
  };
589
- var PrismaBetterSqlite3Adapter = class extends BetterSQLite3Queryable {
596
+ var PrismaBetterSQLite3Adapter = class extends BetterSQLite3Queryable {
590
597
  #mutex = new Mutex();
591
598
  constructor(client, adapterOptions) {
592
599
  super(client, adapterOptions);
@@ -624,7 +631,7 @@ var PrismaBetterSqlite3Adapter = class extends BetterSQLite3Queryable {
624
631
  return Promise.resolve();
625
632
  }
626
633
  };
627
- var PrismaBetterSqlite3AdapterFactory = class {
634
+ var PrismaBetterSQLite3AdapterFactory = class {
628
635
  provider = "sqlite";
629
636
  adapterName = name;
630
637
  #config;
@@ -634,12 +641,12 @@ var PrismaBetterSqlite3AdapterFactory = class {
634
641
  this.#options = options;
635
642
  }
636
643
  connect() {
637
- return Promise.resolve(new PrismaBetterSqlite3Adapter(createBetterSQLite3Client(this.#config), this.#options));
644
+ return Promise.resolve(new PrismaBetterSQLite3Adapter(createBetterSQLite3Client(this.#config), this.#options));
638
645
  }
639
646
  connectToShadowDb() {
640
647
  const url = this.#options?.shadowDatabaseUrl ?? ":memory:";
641
648
  return Promise.resolve(
642
- new PrismaBetterSqlite3Adapter(createBetterSQLite3Client({ ...this.#config, url }), this.#options)
649
+ new PrismaBetterSQLite3Adapter(createBetterSQLite3Client({ ...this.#config, url }), this.#options)
643
650
  );
644
651
  }
645
652
  };
@@ -652,5 +659,5 @@ function createBetterSQLite3Client(input) {
652
659
  }
653
660
  // Annotate the CommonJS export names for ESM import in node:
654
661
  0 && (module.exports = {
655
- PrismaBetterSqlite3
662
+ PrismaBetterSQLite3
656
663
  });
package/dist/index.mjs CHANGED
@@ -333,6 +333,10 @@ function mapRow(row, columnTypes) {
333
333
  const result = [];
334
334
  for (let i = 0; i < row.length; i++) {
335
335
  const value = row[i];
336
+ if (value instanceof ArrayBuffer || value instanceof Buffer) {
337
+ result[i] = Array.from(new Uint8Array(value));
338
+ continue;
339
+ }
336
340
  if (typeof value === "number" && (columnTypes[i] === ColumnTypeEnum.Int32 || columnTypes[i] === ColumnTypeEnum.Int64) && !Number.isInteger(value)) {
337
341
  result[i] = Math.trunc(value);
338
342
  continue;
@@ -385,6 +389,9 @@ function mapArg(arg, argType, options) {
385
389
  if (typeof arg === "string" && argType.scalarType === "bytes") {
386
390
  return Buffer.from(arg, "base64");
387
391
  }
392
+ if (Array.isArray(arg) && argType.scalarType === "bytes") {
393
+ return Buffer.from(arg);
394
+ }
388
395
  return arg;
389
396
  }
390
397
 
@@ -550,7 +557,7 @@ var BetterSQLite3Transaction = class extends BetterSQLite3Queryable {
550
557
  return Promise.resolve();
551
558
  }
552
559
  };
553
- var PrismaBetterSqlite3Adapter = class extends BetterSQLite3Queryable {
560
+ var PrismaBetterSQLite3Adapter = class extends BetterSQLite3Queryable {
554
561
  #mutex = new Mutex();
555
562
  constructor(client, adapterOptions) {
556
563
  super(client, adapterOptions);
@@ -588,7 +595,7 @@ var PrismaBetterSqlite3Adapter = class extends BetterSQLite3Queryable {
588
595
  return Promise.resolve();
589
596
  }
590
597
  };
591
- var PrismaBetterSqlite3AdapterFactory = class {
598
+ var PrismaBetterSQLite3AdapterFactory = class {
592
599
  provider = "sqlite";
593
600
  adapterName = name;
594
601
  #config;
@@ -598,12 +605,12 @@ var PrismaBetterSqlite3AdapterFactory = class {
598
605
  this.#options = options;
599
606
  }
600
607
  connect() {
601
- return Promise.resolve(new PrismaBetterSqlite3Adapter(createBetterSQLite3Client(this.#config), this.#options));
608
+ return Promise.resolve(new PrismaBetterSQLite3Adapter(createBetterSQLite3Client(this.#config), this.#options));
602
609
  }
603
610
  connectToShadowDb() {
604
611
  const url = this.#options?.shadowDatabaseUrl ?? ":memory:";
605
612
  return Promise.resolve(
606
- new PrismaBetterSqlite3Adapter(createBetterSQLite3Client({ ...this.#config, url }), this.#options)
613
+ new PrismaBetterSQLite3Adapter(createBetterSQLite3Client({ ...this.#config, url }), this.#options)
607
614
  );
608
615
  }
609
616
  };
@@ -615,5 +622,5 @@ function createBetterSQLite3Client(input) {
615
622
  return db;
616
623
  }
617
624
  export {
618
- PrismaBetterSqlite3AdapterFactory as PrismaBetterSqlite3
625
+ PrismaBetterSQLite3AdapterFactory as PrismaBetterSQLite3
619
626
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/adapter-better-sqlite3",
3
- "version": "7.2.0",
3
+ "version": "7.3.0-integration-fix-6-19-0-cloudflare-accelerate-engine.1",
4
4
  "description": "Prisma's driver adapter for better-sqlite3, a fast SQLite3 driver for JavaScript runtimes",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -31,8 +31,8 @@
31
31
  "license": "Apache-2.0",
32
32
  "sideEffects": false,
33
33
  "dependencies": {
34
- "better-sqlite3": "^12.4.5",
35
- "@prisma/driver-adapter-utils": "7.2.0"
34
+ "better-sqlite3": "^11.9.0",
35
+ "@prisma/driver-adapter-utils": "7.3.0-integration-fix-6-19-0-cloudflare-accelerate-engine.1"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/better-sqlite3": "7.6.12",