@prisma/adapter-libsql 5.20.0-dev.12 → 5.20.0-dev.13

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,7 +6,7 @@ import type { Queryable } from '@prisma/driver-adapter-utils';
6
6
  import type { Result } from '@prisma/driver-adapter-utils';
7
7
  import type { ResultSet } from '@prisma/driver-adapter-utils';
8
8
  import type { Transaction } from '@libsql/client';
9
- import type { Transaction as Transaction_2 } from '@prisma/driver-adapter-utils';
9
+ import type { TransactionContext } from '@prisma/driver-adapter-utils';
10
10
 
11
11
  declare class LibSqlQueryable<ClientT extends StdClient | TransactionClient> implements Queryable {
12
12
  protected readonly client: ClientT;
@@ -36,7 +36,7 @@ declare const LOCK_TAG: unique symbol;
36
36
 
37
37
  export declare class PrismaLibSQL extends LibSqlQueryable<StdClient> implements DriverAdapter {
38
38
  constructor(client: StdClient);
39
- startTransaction(): Promise<Result<Transaction_2>>;
39
+ transactionContext(): Promise<Result<TransactionContext>>;
40
40
  }
41
41
 
42
42
  declare type StdClient = Client;
package/dist/index.d.ts CHANGED
@@ -6,7 +6,7 @@ import type { Queryable } from '@prisma/driver-adapter-utils';
6
6
  import type { Result } from '@prisma/driver-adapter-utils';
7
7
  import type { ResultSet } from '@prisma/driver-adapter-utils';
8
8
  import type { Transaction } from '@libsql/client';
9
- import type { Transaction as Transaction_2 } from '@prisma/driver-adapter-utils';
9
+ import type { TransactionContext } from '@prisma/driver-adapter-utils';
10
10
 
11
11
  declare class LibSqlQueryable<ClientT extends StdClient | TransactionClient> implements Queryable {
12
12
  protected readonly client: ClientT;
@@ -36,7 +36,7 @@ declare const LOCK_TAG: unique symbol;
36
36
 
37
37
  export declare class PrismaLibSQL extends LibSqlQueryable<StdClient> implements DriverAdapter {
38
38
  constructor(client: StdClient);
39
- startTransaction(): Promise<Result<Transaction_2>>;
39
+ transactionContext(): Promise<Result<TransactionContext>>;
40
40
  }
41
41
 
42
42
  declare type StdClient = Client;
package/dist/index.js CHANGED
@@ -258,26 +258,36 @@ var LibSqlTransaction = class extends LibSqlQueryable {
258
258
  return (0, import_driver_adapter_utils2.ok)(void 0);
259
259
  }
260
260
  };
261
- var PrismaLibSQL = class extends LibSqlQueryable {
262
- constructor(client) {
261
+ var LibSqlTransactionContext = class extends LibSqlQueryable {
262
+ constructor(client, release) {
263
263
  super(client);
264
+ this.client = client;
265
+ this.release = release;
264
266
  }
265
267
  async startTransaction() {
266
268
  const options = {
267
269
  usePhantomQuery: true
268
270
  };
269
271
  const tag = "[js::startTransaction]";
270
- debug2(`${tag} options: %O`, options);
271
- const release = await this[LOCK_TAG].acquire();
272
+ debug2("%s options: %O", tag, options);
272
273
  try {
273
274
  const tx = await this.client.transaction("deferred");
274
- return (0, import_driver_adapter_utils2.ok)(new LibSqlTransaction(tx, options, release));
275
+ return (0, import_driver_adapter_utils2.ok)(new LibSqlTransaction(tx, options, this.release));
275
276
  } catch (e) {
276
- release();
277
+ this.release();
277
278
  throw e;
278
279
  }
279
280
  }
280
281
  };
282
+ var PrismaLibSQL = class extends LibSqlQueryable {
283
+ constructor(client) {
284
+ super(client);
285
+ }
286
+ async transactionContext() {
287
+ const release = await this[LOCK_TAG].acquire();
288
+ return (0, import_driver_adapter_utils2.ok)(new LibSqlTransactionContext(this.client, release));
289
+ }
290
+ };
281
291
  // Annotate the CommonJS export names for ESM import in node:
282
292
  0 && (module.exports = {
283
293
  PrismaLibSQL
package/dist/index.mjs CHANGED
@@ -232,26 +232,36 @@ var LibSqlTransaction = class extends LibSqlQueryable {
232
232
  return ok(void 0);
233
233
  }
234
234
  };
235
- var PrismaLibSQL = class extends LibSqlQueryable {
236
- constructor(client) {
235
+ var LibSqlTransactionContext = class extends LibSqlQueryable {
236
+ constructor(client, release) {
237
237
  super(client);
238
+ this.client = client;
239
+ this.release = release;
238
240
  }
239
241
  async startTransaction() {
240
242
  const options = {
241
243
  usePhantomQuery: true
242
244
  };
243
245
  const tag = "[js::startTransaction]";
244
- debug2(`${tag} options: %O`, options);
245
- const release = await this[LOCK_TAG].acquire();
246
+ debug2("%s options: %O", tag, options);
246
247
  try {
247
248
  const tx = await this.client.transaction("deferred");
248
- return ok(new LibSqlTransaction(tx, options, release));
249
+ return ok(new LibSqlTransaction(tx, options, this.release));
249
250
  } catch (e) {
250
- release();
251
+ this.release();
251
252
  throw e;
252
253
  }
253
254
  }
254
255
  };
256
+ var PrismaLibSQL = class extends LibSqlQueryable {
257
+ constructor(client) {
258
+ super(client);
259
+ }
260
+ async transactionContext() {
261
+ const release = await this[LOCK_TAG].acquire();
262
+ return ok(new LibSqlTransactionContext(this.client, release));
263
+ }
264
+ };
255
265
  export {
256
266
  PrismaLibSQL
257
267
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/adapter-libsql",
3
- "version": "5.20.0-dev.12",
3
+ "version": "5.20.0-dev.13",
4
4
  "description": "Prisma's driver adapter for libSQL and Turso",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -32,7 +32,7 @@
32
32
  "sideEffects": false,
33
33
  "dependencies": {
34
34
  "async-mutex": "0.5.0",
35
- "@prisma/driver-adapter-utils": "5.20.0-dev.12"
35
+ "@prisma/driver-adapter-utils": "5.20.0-dev.13"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@libsql/client": "0.8.0"