@prisma/adapter-libsql 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/README.md CHANGED
@@ -18,17 +18,17 @@ Update your Prisma Client instance to use the libSQL database Client:
18
18
  ```ts
19
19
  // Import needed packages
20
20
  import { PrismaClient } from '@prisma/client'
21
- import { PrismaLibSql } from '@prisma/adapter-libsql'
21
+ import { PrismaLibSQL } from '@prisma/adapter-libsql'
22
22
  // You can alternatively use the web version of the client if you're running in
23
23
  // a constrained environment where the standard libsql client doesn't work:
24
- // import { PrismaLibSql } from '@prisma/adapter-libsql/web'
24
+ // import { PrismaLibSQL } from '@prisma/adapter-libsql/web'
25
25
 
26
26
  // Setup
27
27
  const connectionString = `${process.env.TURSO_DATABASE_URL}`
28
28
  const authToken = `${process.env.TURSO_AUTH_TOKEN}`
29
29
 
30
30
  // Init prisma client
31
- const adapter = new PrismaLibSql({
31
+ const adapter = new PrismaLibSQL({
32
32
  url: connectionString,
33
33
  authToken,
34
34
  })
@@ -3,21 +3,21 @@ import { Config } from '@libsql/client';
3
3
  import type { SqlDriverAdapter } from '@prisma/driver-adapter-utils';
4
4
  import type { SqlMigrationAwareDriverAdapterFactory } from '@prisma/driver-adapter-utils';
5
5
 
6
- export declare class PrismaLibSql extends PrismaLibSqlAdapterFactoryBase {
6
+ export declare class PrismaLibSQL extends PrismaLibSQLAdapterFactoryBase {
7
7
  createClient(config: Config): Client;
8
8
  }
9
9
 
10
- declare abstract class PrismaLibSqlAdapterFactoryBase implements SqlMigrationAwareDriverAdapterFactory {
10
+ declare abstract class PrismaLibSQLAdapterFactoryBase implements SqlMigrationAwareDriverAdapterFactory {
11
11
  #private;
12
12
  readonly provider = "sqlite";
13
13
  readonly adapterName: string;
14
- constructor(config: Config, options?: PrismaLibSqlOptions);
14
+ constructor(config: Config, options?: PrismaLibSQLOptions);
15
15
  connect(): Promise<SqlDriverAdapter>;
16
16
  connectToShadowDb(): Promise<SqlDriverAdapter>;
17
17
  abstract createClient(config: Config): StdClient;
18
18
  }
19
19
 
20
- declare type PrismaLibSqlOptions = {
20
+ declare type PrismaLibSQLOptions = {
21
21
  timestampFormat?: 'iso8601' | 'unixepoch-ms';
22
22
  };
23
23
 
@@ -3,21 +3,21 @@ import { Config } from '@libsql/client';
3
3
  import type { SqlDriverAdapter } from '@prisma/driver-adapter-utils';
4
4
  import type { SqlMigrationAwareDriverAdapterFactory } from '@prisma/driver-adapter-utils';
5
5
 
6
- export declare class PrismaLibSql extends PrismaLibSqlAdapterFactoryBase {
6
+ export declare class PrismaLibSQL extends PrismaLibSQLAdapterFactoryBase {
7
7
  createClient(config: Config): Client;
8
8
  }
9
9
 
10
- declare abstract class PrismaLibSqlAdapterFactoryBase implements SqlMigrationAwareDriverAdapterFactory {
10
+ declare abstract class PrismaLibSQLAdapterFactoryBase implements SqlMigrationAwareDriverAdapterFactory {
11
11
  #private;
12
12
  readonly provider = "sqlite";
13
13
  readonly adapterName: string;
14
- constructor(config: Config, options?: PrismaLibSqlOptions);
14
+ constructor(config: Config, options?: PrismaLibSQLOptions);
15
15
  connect(): Promise<SqlDriverAdapter>;
16
16
  connectToShadowDb(): Promise<SqlDriverAdapter>;
17
17
  abstract createClient(config: Config): StdClient;
18
18
  }
19
19
 
20
- declare type PrismaLibSqlOptions = {
20
+ declare type PrismaLibSQLOptions = {
21
21
  timestampFormat?: 'iso8601' | 'unixepoch-ms';
22
22
  };
23
23
 
@@ -20,7 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index-node.ts
21
21
  var index_node_exports = {};
22
22
  __export(index_node_exports, {
23
- PrismaLibSql: () => PrismaLibSqlAdapterFactory
23
+ PrismaLibSQL: () => PrismaLibSQLAdapterFactory
24
24
  });
25
25
  module.exports = __toCommonJS(index_node_exports);
26
26
 
@@ -152,7 +152,7 @@ function mapRow(row, columnTypes) {
152
152
  for (let i = 0; i < row.length; i++) {
153
153
  const value = row[i];
154
154
  if (value instanceof ArrayBuffer) {
155
- result[i] = new Uint8Array(value);
155
+ result[i] = Array.from(new Uint8Array(value));
156
156
  continue;
157
157
  }
158
158
  if (typeof value === "number" && (columnTypes[i] === import_driver_adapter_utils.ColumnTypeEnum.Int32 || columnTypes[i] === import_driver_adapter_utils.ColumnTypeEnum.Int64) && !Number.isInteger(value)) {
@@ -198,6 +198,9 @@ function mapArg(arg, argType, options) {
198
198
  if (typeof arg === "string" && argType.scalarType === "bytes") {
199
199
  return Buffer.from(arg, "base64");
200
200
  }
201
+ if (Array.isArray(arg) && argType.scalarType === "bytes") {
202
+ return new Uint8Array(arg);
203
+ }
201
204
  return arg;
202
205
  }
203
206
 
@@ -355,7 +358,7 @@ var LibSqlTransaction = class extends LibSqlQueryable {
355
358
  }
356
359
  }
357
360
  };
358
- var PrismaLibSqlAdapter = class extends LibSqlQueryable {
361
+ var PrismaLibSQLAdapter = class extends LibSqlQueryable {
359
362
  constructor(client, adapterOptions) {
360
363
  super(client, adapterOptions);
361
364
  }
@@ -395,7 +398,7 @@ var PrismaLibSqlAdapter = class extends LibSqlQueryable {
395
398
  return Promise.resolve();
396
399
  }
397
400
  };
398
- var PrismaLibSqlAdapterFactoryBase = class {
401
+ var PrismaLibSQLAdapterFactoryBase = class {
399
402
  provider = "sqlite";
400
403
  adapterName = name;
401
404
  #config;
@@ -405,22 +408,22 @@ var PrismaLibSqlAdapterFactoryBase = class {
405
408
  this.#options = options;
406
409
  }
407
410
  connect() {
408
- return Promise.resolve(new PrismaLibSqlAdapter(this.createClient(this.#config), this.#options));
411
+ return Promise.resolve(new PrismaLibSQLAdapter(this.createClient(this.#config), this.#options));
409
412
  }
410
413
  connectToShadowDb() {
411
414
  return Promise.resolve(
412
- new PrismaLibSqlAdapter(this.createClient({ ...this.#config, url: ":memory:" }), this.#options)
415
+ new PrismaLibSQLAdapter(this.createClient({ ...this.#config, url: ":memory:" }), this.#options)
413
416
  );
414
417
  }
415
418
  };
416
419
 
417
420
  // src/libsql-node.ts
418
- var PrismaLibSqlAdapterFactory = class extends PrismaLibSqlAdapterFactoryBase {
421
+ var PrismaLibSQLAdapterFactory = class extends PrismaLibSQLAdapterFactoryBase {
419
422
  createClient(config) {
420
423
  return (0, import_client.createClient)(config);
421
424
  }
422
425
  };
423
426
  // Annotate the CommonJS export names for ESM import in node:
424
427
  0 && (module.exports = {
425
- PrismaLibSql
428
+ PrismaLibSQL
426
429
  });
@@ -126,7 +126,7 @@ function mapRow(row, columnTypes) {
126
126
  for (let i = 0; i < row.length; i++) {
127
127
  const value = row[i];
128
128
  if (value instanceof ArrayBuffer) {
129
- result[i] = new Uint8Array(value);
129
+ result[i] = Array.from(new Uint8Array(value));
130
130
  continue;
131
131
  }
132
132
  if (typeof value === "number" && (columnTypes[i] === ColumnTypeEnum.Int32 || columnTypes[i] === ColumnTypeEnum.Int64) && !Number.isInteger(value)) {
@@ -172,6 +172,9 @@ function mapArg(arg, argType, options) {
172
172
  if (typeof arg === "string" && argType.scalarType === "bytes") {
173
173
  return Buffer.from(arg, "base64");
174
174
  }
175
+ if (Array.isArray(arg) && argType.scalarType === "bytes") {
176
+ return new Uint8Array(arg);
177
+ }
175
178
  return arg;
176
179
  }
177
180
 
@@ -329,7 +332,7 @@ var LibSqlTransaction = class extends LibSqlQueryable {
329
332
  }
330
333
  }
331
334
  };
332
- var PrismaLibSqlAdapter = class extends LibSqlQueryable {
335
+ var PrismaLibSQLAdapter = class extends LibSqlQueryable {
333
336
  constructor(client, adapterOptions) {
334
337
  super(client, adapterOptions);
335
338
  }
@@ -369,7 +372,7 @@ var PrismaLibSqlAdapter = class extends LibSqlQueryable {
369
372
  return Promise.resolve();
370
373
  }
371
374
  };
372
- var PrismaLibSqlAdapterFactoryBase = class {
375
+ var PrismaLibSQLAdapterFactoryBase = class {
373
376
  provider = "sqlite";
374
377
  adapterName = name;
375
378
  #config;
@@ -379,21 +382,21 @@ var PrismaLibSqlAdapterFactoryBase = class {
379
382
  this.#options = options;
380
383
  }
381
384
  connect() {
382
- return Promise.resolve(new PrismaLibSqlAdapter(this.createClient(this.#config), this.#options));
385
+ return Promise.resolve(new PrismaLibSQLAdapter(this.createClient(this.#config), this.#options));
383
386
  }
384
387
  connectToShadowDb() {
385
388
  return Promise.resolve(
386
- new PrismaLibSqlAdapter(this.createClient({ ...this.#config, url: ":memory:" }), this.#options)
389
+ new PrismaLibSQLAdapter(this.createClient({ ...this.#config, url: ":memory:" }), this.#options)
387
390
  );
388
391
  }
389
392
  };
390
393
 
391
394
  // src/libsql-node.ts
392
- var PrismaLibSqlAdapterFactory = class extends PrismaLibSqlAdapterFactoryBase {
395
+ var PrismaLibSQLAdapterFactory = class extends PrismaLibSQLAdapterFactoryBase {
393
396
  createClient(config) {
394
397
  return createClient(config);
395
398
  }
396
399
  };
397
400
  export {
398
- PrismaLibSqlAdapterFactory as PrismaLibSql
401
+ PrismaLibSQLAdapterFactory as PrismaLibSQL
399
402
  };
@@ -5,21 +5,21 @@ import { Config as Config_2 } from '@libsql/client/web';
5
5
  import type { SqlDriverAdapter } from '@prisma/driver-adapter-utils';
6
6
  import type { SqlMigrationAwareDriverAdapterFactory } from '@prisma/driver-adapter-utils';
7
7
 
8
- export declare class PrismaLibSql extends PrismaLibSqlAdapterFactoryBase {
8
+ export declare class PrismaLibSQL extends PrismaLibSQLAdapterFactoryBase {
9
9
  createClient(config: Config_2): Client_2;
10
10
  }
11
11
 
12
- declare abstract class PrismaLibSqlAdapterFactoryBase implements SqlMigrationAwareDriverAdapterFactory {
12
+ declare abstract class PrismaLibSQLAdapterFactoryBase implements SqlMigrationAwareDriverAdapterFactory {
13
13
  #private;
14
14
  readonly provider = "sqlite";
15
15
  readonly adapterName: string;
16
- constructor(config: Config, options?: PrismaLibSqlOptions);
16
+ constructor(config: Config, options?: PrismaLibSQLOptions);
17
17
  connect(): Promise<SqlDriverAdapter>;
18
18
  connectToShadowDb(): Promise<SqlDriverAdapter>;
19
19
  abstract createClient(config: Config): StdClient;
20
20
  }
21
21
 
22
- declare type PrismaLibSqlOptions = {
22
+ declare type PrismaLibSQLOptions = {
23
23
  timestampFormat?: 'iso8601' | 'unixepoch-ms';
24
24
  };
25
25
 
@@ -5,21 +5,21 @@ import { Config as Config_2 } from '@libsql/client/web';
5
5
  import type { SqlDriverAdapter } from '@prisma/driver-adapter-utils';
6
6
  import type { SqlMigrationAwareDriverAdapterFactory } from '@prisma/driver-adapter-utils';
7
7
 
8
- export declare class PrismaLibSql extends PrismaLibSqlAdapterFactoryBase {
8
+ export declare class PrismaLibSQL extends PrismaLibSQLAdapterFactoryBase {
9
9
  createClient(config: Config_2): Client_2;
10
10
  }
11
11
 
12
- declare abstract class PrismaLibSqlAdapterFactoryBase implements SqlMigrationAwareDriverAdapterFactory {
12
+ declare abstract class PrismaLibSQLAdapterFactoryBase implements SqlMigrationAwareDriverAdapterFactory {
13
13
  #private;
14
14
  readonly provider = "sqlite";
15
15
  readonly adapterName: string;
16
- constructor(config: Config, options?: PrismaLibSqlOptions);
16
+ constructor(config: Config, options?: PrismaLibSQLOptions);
17
17
  connect(): Promise<SqlDriverAdapter>;
18
18
  connectToShadowDb(): Promise<SqlDriverAdapter>;
19
19
  abstract createClient(config: Config): StdClient;
20
20
  }
21
21
 
22
- declare type PrismaLibSqlOptions = {
22
+ declare type PrismaLibSQLOptions = {
23
23
  timestampFormat?: 'iso8601' | 'unixepoch-ms';
24
24
  };
25
25
 
package/dist/index-web.js CHANGED
@@ -20,7 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index-web.ts
21
21
  var index_web_exports = {};
22
22
  __export(index_web_exports, {
23
- PrismaLibSql: () => PrismaLibSqlWebAdapterFactory
23
+ PrismaLibSQL: () => PrismaLibSQLWebAdapterFactory
24
24
  });
25
25
  module.exports = __toCommonJS(index_web_exports);
26
26
 
@@ -152,7 +152,7 @@ function mapRow(row, columnTypes) {
152
152
  for (let i = 0; i < row.length; i++) {
153
153
  const value = row[i];
154
154
  if (value instanceof ArrayBuffer) {
155
- result[i] = new Uint8Array(value);
155
+ result[i] = Array.from(new Uint8Array(value));
156
156
  continue;
157
157
  }
158
158
  if (typeof value === "number" && (columnTypes[i] === import_driver_adapter_utils.ColumnTypeEnum.Int32 || columnTypes[i] === import_driver_adapter_utils.ColumnTypeEnum.Int64) && !Number.isInteger(value)) {
@@ -198,6 +198,9 @@ function mapArg(arg, argType, options) {
198
198
  if (typeof arg === "string" && argType.scalarType === "bytes") {
199
199
  return Buffer.from(arg, "base64");
200
200
  }
201
+ if (Array.isArray(arg) && argType.scalarType === "bytes") {
202
+ return new Uint8Array(arg);
203
+ }
201
204
  return arg;
202
205
  }
203
206
 
@@ -355,7 +358,7 @@ var LibSqlTransaction = class extends LibSqlQueryable {
355
358
  }
356
359
  }
357
360
  };
358
- var PrismaLibSqlAdapter = class extends LibSqlQueryable {
361
+ var PrismaLibSQLAdapter = class extends LibSqlQueryable {
359
362
  constructor(client, adapterOptions) {
360
363
  super(client, adapterOptions);
361
364
  }
@@ -395,7 +398,7 @@ var PrismaLibSqlAdapter = class extends LibSqlQueryable {
395
398
  return Promise.resolve();
396
399
  }
397
400
  };
398
- var PrismaLibSqlAdapterFactoryBase = class {
401
+ var PrismaLibSQLAdapterFactoryBase = class {
399
402
  provider = "sqlite";
400
403
  adapterName = name;
401
404
  #config;
@@ -405,22 +408,22 @@ var PrismaLibSqlAdapterFactoryBase = class {
405
408
  this.#options = options;
406
409
  }
407
410
  connect() {
408
- return Promise.resolve(new PrismaLibSqlAdapter(this.createClient(this.#config), this.#options));
411
+ return Promise.resolve(new PrismaLibSQLAdapter(this.createClient(this.#config), this.#options));
409
412
  }
410
413
  connectToShadowDb() {
411
414
  return Promise.resolve(
412
- new PrismaLibSqlAdapter(this.createClient({ ...this.#config, url: ":memory:" }), this.#options)
415
+ new PrismaLibSQLAdapter(this.createClient({ ...this.#config, url: ":memory:" }), this.#options)
413
416
  );
414
417
  }
415
418
  };
416
419
 
417
420
  // src/libsql-web.ts
418
- var PrismaLibSqlWebAdapterFactory = class extends PrismaLibSqlAdapterFactoryBase {
421
+ var PrismaLibSQLWebAdapterFactory = class extends PrismaLibSQLAdapterFactoryBase {
419
422
  createClient(config) {
420
423
  return (0, import_web.createClient)(config);
421
424
  }
422
425
  };
423
426
  // Annotate the CommonJS export names for ESM import in node:
424
427
  0 && (module.exports = {
425
- PrismaLibSql
428
+ PrismaLibSQL
426
429
  });
@@ -126,7 +126,7 @@ function mapRow(row, columnTypes) {
126
126
  for (let i = 0; i < row.length; i++) {
127
127
  const value = row[i];
128
128
  if (value instanceof ArrayBuffer) {
129
- result[i] = new Uint8Array(value);
129
+ result[i] = Array.from(new Uint8Array(value));
130
130
  continue;
131
131
  }
132
132
  if (typeof value === "number" && (columnTypes[i] === ColumnTypeEnum.Int32 || columnTypes[i] === ColumnTypeEnum.Int64) && !Number.isInteger(value)) {
@@ -172,6 +172,9 @@ function mapArg(arg, argType, options) {
172
172
  if (typeof arg === "string" && argType.scalarType === "bytes") {
173
173
  return Buffer.from(arg, "base64");
174
174
  }
175
+ if (Array.isArray(arg) && argType.scalarType === "bytes") {
176
+ return new Uint8Array(arg);
177
+ }
175
178
  return arg;
176
179
  }
177
180
 
@@ -329,7 +332,7 @@ var LibSqlTransaction = class extends LibSqlQueryable {
329
332
  }
330
333
  }
331
334
  };
332
- var PrismaLibSqlAdapter = class extends LibSqlQueryable {
335
+ var PrismaLibSQLAdapter = class extends LibSqlQueryable {
333
336
  constructor(client, adapterOptions) {
334
337
  super(client, adapterOptions);
335
338
  }
@@ -369,7 +372,7 @@ var PrismaLibSqlAdapter = class extends LibSqlQueryable {
369
372
  return Promise.resolve();
370
373
  }
371
374
  };
372
- var PrismaLibSqlAdapterFactoryBase = class {
375
+ var PrismaLibSQLAdapterFactoryBase = class {
373
376
  provider = "sqlite";
374
377
  adapterName = name;
375
378
  #config;
@@ -379,21 +382,21 @@ var PrismaLibSqlAdapterFactoryBase = class {
379
382
  this.#options = options;
380
383
  }
381
384
  connect() {
382
- return Promise.resolve(new PrismaLibSqlAdapter(this.createClient(this.#config), this.#options));
385
+ return Promise.resolve(new PrismaLibSQLAdapter(this.createClient(this.#config), this.#options));
383
386
  }
384
387
  connectToShadowDb() {
385
388
  return Promise.resolve(
386
- new PrismaLibSqlAdapter(this.createClient({ ...this.#config, url: ":memory:" }), this.#options)
389
+ new PrismaLibSQLAdapter(this.createClient({ ...this.#config, url: ":memory:" }), this.#options)
387
390
  );
388
391
  }
389
392
  };
390
393
 
391
394
  // src/libsql-web.ts
392
- var PrismaLibSqlWebAdapterFactory = class extends PrismaLibSqlAdapterFactoryBase {
395
+ var PrismaLibSQLWebAdapterFactory = class extends PrismaLibSQLAdapterFactoryBase {
393
396
  createClient(config) {
394
397
  return createClient(config);
395
398
  }
396
399
  };
397
400
  export {
398
- PrismaLibSqlWebAdapterFactory as PrismaLibSql
401
+ PrismaLibSQLWebAdapterFactory as PrismaLibSQL
399
402
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/adapter-libsql",
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 libSQL and Turso",
5
5
  "main": "dist/index-node.js",
6
6
  "module": "dist/index-node.mjs",
@@ -41,9 +41,9 @@
41
41
  "license": "Apache-2.0",
42
42
  "sideEffects": false,
43
43
  "dependencies": {
44
- "@libsql/client": "^0.8.1",
44
+ "@libsql/client": "^0.3.5 || ^0.4.0 || ^0.5.0 || ^0.6.0 || ^0.7.0 || ^0.8.0",
45
45
  "async-mutex": "0.5.0",
46
- "@prisma/driver-adapter-utils": "7.2.0"
46
+ "@prisma/driver-adapter-utils": "7.3.0-integration-fix-6-19-0-cloudflare-accelerate-engine.1"
47
47
  },
48
48
  "scripts": {
49
49
  "dev": "DEV=true tsx helpers/build.ts",