@prisma/adapter-libsql 6.7.0-dev.3 → 6.7.0-integration-push-sunrovnkrkpv.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-node.js +10 -60
- package/dist/index-node.mjs +10 -60
- package/dist/index-web.js +10 -60
- package/dist/index-web.mjs +10 -60
- package/package.json +2 -2
package/dist/index-node.js
CHANGED
|
@@ -171,64 +171,6 @@ function mapRow(row, columnTypes) {
|
|
|
171
171
|
return result;
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
// src/errors.ts
|
|
175
|
-
var SQLITE_BUSY = 5;
|
|
176
|
-
var PRIMARY_ERROR_CODE_MASK = 255;
|
|
177
|
-
function convertDriverError(error) {
|
|
178
|
-
if (!isDbError(error)) {
|
|
179
|
-
throw error;
|
|
180
|
-
}
|
|
181
|
-
const rawCode = error.rawCode ?? error.cause?.["rawCode"];
|
|
182
|
-
switch (rawCode) {
|
|
183
|
-
case 2067:
|
|
184
|
-
case 1555:
|
|
185
|
-
return {
|
|
186
|
-
kind: "UniqueConstraintViolation",
|
|
187
|
-
fields: error.message.split("constraint failed: ").at(1)?.split(", ").map((field) => field.split(".").pop()) ?? []
|
|
188
|
-
};
|
|
189
|
-
case 1299:
|
|
190
|
-
return {
|
|
191
|
-
kind: "NullConstraintViolation",
|
|
192
|
-
fields: error.message.split("constraint failed: ").at(1)?.split(", ").map((field) => field.split(".").pop()) ?? []
|
|
193
|
-
};
|
|
194
|
-
case 787:
|
|
195
|
-
case 1811:
|
|
196
|
-
return {
|
|
197
|
-
kind: "ForeignKeyConstraintViolation",
|
|
198
|
-
constraint: { foreignKey: {} }
|
|
199
|
-
};
|
|
200
|
-
default:
|
|
201
|
-
if (rawCode && (rawCode & PRIMARY_ERROR_CODE_MASK) === SQLITE_BUSY) {
|
|
202
|
-
return {
|
|
203
|
-
kind: "SocketTimeout"
|
|
204
|
-
};
|
|
205
|
-
} else if (error.message.startsWith("no such table")) {
|
|
206
|
-
return {
|
|
207
|
-
kind: "TableDoesNotExist",
|
|
208
|
-
table: error.message.split(": ").pop()
|
|
209
|
-
};
|
|
210
|
-
} else if (error.message.startsWith("no such column")) {
|
|
211
|
-
return {
|
|
212
|
-
kind: "ColumnNotFound",
|
|
213
|
-
column: error.message.split(": ").pop()
|
|
214
|
-
};
|
|
215
|
-
} else if (error.message.includes("has no column named ")) {
|
|
216
|
-
return {
|
|
217
|
-
kind: "ColumnNotFound",
|
|
218
|
-
column: error.message.split("has no column named ").pop()
|
|
219
|
-
};
|
|
220
|
-
}
|
|
221
|
-
return {
|
|
222
|
-
kind: "sqlite",
|
|
223
|
-
extendedCode: rawCode,
|
|
224
|
-
message: error.message
|
|
225
|
-
};
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
function isDbError(error) {
|
|
229
|
-
return typeof error.code === "string" && typeof error.message === "string" && (typeof error.rawCode === "number" || error.rawCode === void 0);
|
|
230
|
-
}
|
|
231
|
-
|
|
232
174
|
// src/libsql.ts
|
|
233
175
|
var debug2 = (0, import_driver_adapter_utils2.Debug)("prisma:driver-adapter:libsql");
|
|
234
176
|
var LOCK_TAG = Symbol();
|
|
@@ -281,7 +223,15 @@ var LibSqlQueryable = class {
|
|
|
281
223
|
}
|
|
282
224
|
onError(error) {
|
|
283
225
|
debug2("Error in performIO: %O", error);
|
|
284
|
-
|
|
226
|
+
const rawCode = error["rawCode"] ?? error.cause?.["rawCode"];
|
|
227
|
+
if (typeof rawCode === "number") {
|
|
228
|
+
throw new import_driver_adapter_utils2.DriverAdapterError({
|
|
229
|
+
kind: "sqlite",
|
|
230
|
+
extendedCode: rawCode,
|
|
231
|
+
message: error.message
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
throw error;
|
|
285
235
|
}
|
|
286
236
|
};
|
|
287
237
|
var LibSqlTransaction = class extends LibSqlQueryable {
|
|
@@ -341,7 +291,7 @@ var PrismaLibSQLAdapter = class extends LibSqlQueryable {
|
|
|
341
291
|
return new LibSqlTransaction(tx, options, release);
|
|
342
292
|
} catch (e) {
|
|
343
293
|
release();
|
|
344
|
-
|
|
294
|
+
throw e;
|
|
345
295
|
}
|
|
346
296
|
}
|
|
347
297
|
dispose() {
|
package/dist/index-node.mjs
CHANGED
|
@@ -145,64 +145,6 @@ function mapRow(row, columnTypes) {
|
|
|
145
145
|
return result;
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
// src/errors.ts
|
|
149
|
-
var SQLITE_BUSY = 5;
|
|
150
|
-
var PRIMARY_ERROR_CODE_MASK = 255;
|
|
151
|
-
function convertDriverError(error) {
|
|
152
|
-
if (!isDbError(error)) {
|
|
153
|
-
throw error;
|
|
154
|
-
}
|
|
155
|
-
const rawCode = error.rawCode ?? error.cause?.["rawCode"];
|
|
156
|
-
switch (rawCode) {
|
|
157
|
-
case 2067:
|
|
158
|
-
case 1555:
|
|
159
|
-
return {
|
|
160
|
-
kind: "UniqueConstraintViolation",
|
|
161
|
-
fields: error.message.split("constraint failed: ").at(1)?.split(", ").map((field) => field.split(".").pop()) ?? []
|
|
162
|
-
};
|
|
163
|
-
case 1299:
|
|
164
|
-
return {
|
|
165
|
-
kind: "NullConstraintViolation",
|
|
166
|
-
fields: error.message.split("constraint failed: ").at(1)?.split(", ").map((field) => field.split(".").pop()) ?? []
|
|
167
|
-
};
|
|
168
|
-
case 787:
|
|
169
|
-
case 1811:
|
|
170
|
-
return {
|
|
171
|
-
kind: "ForeignKeyConstraintViolation",
|
|
172
|
-
constraint: { foreignKey: {} }
|
|
173
|
-
};
|
|
174
|
-
default:
|
|
175
|
-
if (rawCode && (rawCode & PRIMARY_ERROR_CODE_MASK) === SQLITE_BUSY) {
|
|
176
|
-
return {
|
|
177
|
-
kind: "SocketTimeout"
|
|
178
|
-
};
|
|
179
|
-
} else if (error.message.startsWith("no such table")) {
|
|
180
|
-
return {
|
|
181
|
-
kind: "TableDoesNotExist",
|
|
182
|
-
table: error.message.split(": ").pop()
|
|
183
|
-
};
|
|
184
|
-
} else if (error.message.startsWith("no such column")) {
|
|
185
|
-
return {
|
|
186
|
-
kind: "ColumnNotFound",
|
|
187
|
-
column: error.message.split(": ").pop()
|
|
188
|
-
};
|
|
189
|
-
} else if (error.message.includes("has no column named ")) {
|
|
190
|
-
return {
|
|
191
|
-
kind: "ColumnNotFound",
|
|
192
|
-
column: error.message.split("has no column named ").pop()
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
return {
|
|
196
|
-
kind: "sqlite",
|
|
197
|
-
extendedCode: rawCode,
|
|
198
|
-
message: error.message
|
|
199
|
-
};
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
function isDbError(error) {
|
|
203
|
-
return typeof error.code === "string" && typeof error.message === "string" && (typeof error.rawCode === "number" || error.rawCode === void 0);
|
|
204
|
-
}
|
|
205
|
-
|
|
206
148
|
// src/libsql.ts
|
|
207
149
|
var debug2 = Debug2("prisma:driver-adapter:libsql");
|
|
208
150
|
var LOCK_TAG = Symbol();
|
|
@@ -255,7 +197,15 @@ var LibSqlQueryable = class {
|
|
|
255
197
|
}
|
|
256
198
|
onError(error) {
|
|
257
199
|
debug2("Error in performIO: %O", error);
|
|
258
|
-
|
|
200
|
+
const rawCode = error["rawCode"] ?? error.cause?.["rawCode"];
|
|
201
|
+
if (typeof rawCode === "number") {
|
|
202
|
+
throw new DriverAdapterError({
|
|
203
|
+
kind: "sqlite",
|
|
204
|
+
extendedCode: rawCode,
|
|
205
|
+
message: error.message
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
throw error;
|
|
259
209
|
}
|
|
260
210
|
};
|
|
261
211
|
var LibSqlTransaction = class extends LibSqlQueryable {
|
|
@@ -315,7 +265,7 @@ var PrismaLibSQLAdapter = class extends LibSqlQueryable {
|
|
|
315
265
|
return new LibSqlTransaction(tx, options, release);
|
|
316
266
|
} catch (e) {
|
|
317
267
|
release();
|
|
318
|
-
|
|
268
|
+
throw e;
|
|
319
269
|
}
|
|
320
270
|
}
|
|
321
271
|
dispose() {
|
package/dist/index-web.js
CHANGED
|
@@ -171,64 +171,6 @@ function mapRow(row, columnTypes) {
|
|
|
171
171
|
return result;
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
// src/errors.ts
|
|
175
|
-
var SQLITE_BUSY = 5;
|
|
176
|
-
var PRIMARY_ERROR_CODE_MASK = 255;
|
|
177
|
-
function convertDriverError(error) {
|
|
178
|
-
if (!isDbError(error)) {
|
|
179
|
-
throw error;
|
|
180
|
-
}
|
|
181
|
-
const rawCode = error.rawCode ?? error.cause?.["rawCode"];
|
|
182
|
-
switch (rawCode) {
|
|
183
|
-
case 2067:
|
|
184
|
-
case 1555:
|
|
185
|
-
return {
|
|
186
|
-
kind: "UniqueConstraintViolation",
|
|
187
|
-
fields: error.message.split("constraint failed: ").at(1)?.split(", ").map((field) => field.split(".").pop()) ?? []
|
|
188
|
-
};
|
|
189
|
-
case 1299:
|
|
190
|
-
return {
|
|
191
|
-
kind: "NullConstraintViolation",
|
|
192
|
-
fields: error.message.split("constraint failed: ").at(1)?.split(", ").map((field) => field.split(".").pop()) ?? []
|
|
193
|
-
};
|
|
194
|
-
case 787:
|
|
195
|
-
case 1811:
|
|
196
|
-
return {
|
|
197
|
-
kind: "ForeignKeyConstraintViolation",
|
|
198
|
-
constraint: { foreignKey: {} }
|
|
199
|
-
};
|
|
200
|
-
default:
|
|
201
|
-
if (rawCode && (rawCode & PRIMARY_ERROR_CODE_MASK) === SQLITE_BUSY) {
|
|
202
|
-
return {
|
|
203
|
-
kind: "SocketTimeout"
|
|
204
|
-
};
|
|
205
|
-
} else if (error.message.startsWith("no such table")) {
|
|
206
|
-
return {
|
|
207
|
-
kind: "TableDoesNotExist",
|
|
208
|
-
table: error.message.split(": ").pop()
|
|
209
|
-
};
|
|
210
|
-
} else if (error.message.startsWith("no such column")) {
|
|
211
|
-
return {
|
|
212
|
-
kind: "ColumnNotFound",
|
|
213
|
-
column: error.message.split(": ").pop()
|
|
214
|
-
};
|
|
215
|
-
} else if (error.message.includes("has no column named ")) {
|
|
216
|
-
return {
|
|
217
|
-
kind: "ColumnNotFound",
|
|
218
|
-
column: error.message.split("has no column named ").pop()
|
|
219
|
-
};
|
|
220
|
-
}
|
|
221
|
-
return {
|
|
222
|
-
kind: "sqlite",
|
|
223
|
-
extendedCode: rawCode,
|
|
224
|
-
message: error.message
|
|
225
|
-
};
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
function isDbError(error) {
|
|
229
|
-
return typeof error.code === "string" && typeof error.message === "string" && (typeof error.rawCode === "number" || error.rawCode === void 0);
|
|
230
|
-
}
|
|
231
|
-
|
|
232
174
|
// src/libsql.ts
|
|
233
175
|
var debug2 = (0, import_driver_adapter_utils2.Debug)("prisma:driver-adapter:libsql");
|
|
234
176
|
var LOCK_TAG = Symbol();
|
|
@@ -281,7 +223,15 @@ var LibSqlQueryable = class {
|
|
|
281
223
|
}
|
|
282
224
|
onError(error) {
|
|
283
225
|
debug2("Error in performIO: %O", error);
|
|
284
|
-
|
|
226
|
+
const rawCode = error["rawCode"] ?? error.cause?.["rawCode"];
|
|
227
|
+
if (typeof rawCode === "number") {
|
|
228
|
+
throw new import_driver_adapter_utils2.DriverAdapterError({
|
|
229
|
+
kind: "sqlite",
|
|
230
|
+
extendedCode: rawCode,
|
|
231
|
+
message: error.message
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
throw error;
|
|
285
235
|
}
|
|
286
236
|
};
|
|
287
237
|
var LibSqlTransaction = class extends LibSqlQueryable {
|
|
@@ -341,7 +291,7 @@ var PrismaLibSQLAdapter = class extends LibSqlQueryable {
|
|
|
341
291
|
return new LibSqlTransaction(tx, options, release);
|
|
342
292
|
} catch (e) {
|
|
343
293
|
release();
|
|
344
|
-
|
|
294
|
+
throw e;
|
|
345
295
|
}
|
|
346
296
|
}
|
|
347
297
|
dispose() {
|
package/dist/index-web.mjs
CHANGED
|
@@ -145,64 +145,6 @@ function mapRow(row, columnTypes) {
|
|
|
145
145
|
return result;
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
// src/errors.ts
|
|
149
|
-
var SQLITE_BUSY = 5;
|
|
150
|
-
var PRIMARY_ERROR_CODE_MASK = 255;
|
|
151
|
-
function convertDriverError(error) {
|
|
152
|
-
if (!isDbError(error)) {
|
|
153
|
-
throw error;
|
|
154
|
-
}
|
|
155
|
-
const rawCode = error.rawCode ?? error.cause?.["rawCode"];
|
|
156
|
-
switch (rawCode) {
|
|
157
|
-
case 2067:
|
|
158
|
-
case 1555:
|
|
159
|
-
return {
|
|
160
|
-
kind: "UniqueConstraintViolation",
|
|
161
|
-
fields: error.message.split("constraint failed: ").at(1)?.split(", ").map((field) => field.split(".").pop()) ?? []
|
|
162
|
-
};
|
|
163
|
-
case 1299:
|
|
164
|
-
return {
|
|
165
|
-
kind: "NullConstraintViolation",
|
|
166
|
-
fields: error.message.split("constraint failed: ").at(1)?.split(", ").map((field) => field.split(".").pop()) ?? []
|
|
167
|
-
};
|
|
168
|
-
case 787:
|
|
169
|
-
case 1811:
|
|
170
|
-
return {
|
|
171
|
-
kind: "ForeignKeyConstraintViolation",
|
|
172
|
-
constraint: { foreignKey: {} }
|
|
173
|
-
};
|
|
174
|
-
default:
|
|
175
|
-
if (rawCode && (rawCode & PRIMARY_ERROR_CODE_MASK) === SQLITE_BUSY) {
|
|
176
|
-
return {
|
|
177
|
-
kind: "SocketTimeout"
|
|
178
|
-
};
|
|
179
|
-
} else if (error.message.startsWith("no such table")) {
|
|
180
|
-
return {
|
|
181
|
-
kind: "TableDoesNotExist",
|
|
182
|
-
table: error.message.split(": ").pop()
|
|
183
|
-
};
|
|
184
|
-
} else if (error.message.startsWith("no such column")) {
|
|
185
|
-
return {
|
|
186
|
-
kind: "ColumnNotFound",
|
|
187
|
-
column: error.message.split(": ").pop()
|
|
188
|
-
};
|
|
189
|
-
} else if (error.message.includes("has no column named ")) {
|
|
190
|
-
return {
|
|
191
|
-
kind: "ColumnNotFound",
|
|
192
|
-
column: error.message.split("has no column named ").pop()
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
return {
|
|
196
|
-
kind: "sqlite",
|
|
197
|
-
extendedCode: rawCode,
|
|
198
|
-
message: error.message
|
|
199
|
-
};
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
function isDbError(error) {
|
|
203
|
-
return typeof error.code === "string" && typeof error.message === "string" && (typeof error.rawCode === "number" || error.rawCode === void 0);
|
|
204
|
-
}
|
|
205
|
-
|
|
206
148
|
// src/libsql.ts
|
|
207
149
|
var debug2 = Debug2("prisma:driver-adapter:libsql");
|
|
208
150
|
var LOCK_TAG = Symbol();
|
|
@@ -255,7 +197,15 @@ var LibSqlQueryable = class {
|
|
|
255
197
|
}
|
|
256
198
|
onError(error) {
|
|
257
199
|
debug2("Error in performIO: %O", error);
|
|
258
|
-
|
|
200
|
+
const rawCode = error["rawCode"] ?? error.cause?.["rawCode"];
|
|
201
|
+
if (typeof rawCode === "number") {
|
|
202
|
+
throw new DriverAdapterError({
|
|
203
|
+
kind: "sqlite",
|
|
204
|
+
extendedCode: rawCode,
|
|
205
|
+
message: error.message
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
throw error;
|
|
259
209
|
}
|
|
260
210
|
};
|
|
261
211
|
var LibSqlTransaction = class extends LibSqlQueryable {
|
|
@@ -315,7 +265,7 @@ var PrismaLibSQLAdapter = class extends LibSqlQueryable {
|
|
|
315
265
|
return new LibSqlTransaction(tx, options, release);
|
|
316
266
|
} catch (e) {
|
|
317
267
|
release();
|
|
318
|
-
|
|
268
|
+
throw e;
|
|
319
269
|
}
|
|
320
270
|
}
|
|
321
271
|
dispose() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/adapter-libsql",
|
|
3
|
-
"version": "6.7.0-
|
|
3
|
+
"version": "6.7.0-integration-push-sunrovnkrkpv.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",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"dependencies": {
|
|
44
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": "6.7.0-
|
|
46
|
+
"@prisma/driver-adapter-utils": "6.7.0-integration-push-sunrovnkrkpv.1"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"jest": "29.7.0",
|