prisma-extension-kysely 3.0.0 → 4.0.0
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 +59 -30
- package/dist/cjs/connection.d.ts +2 -2
- package/dist/cjs/connection.d.ts.map +1 -1
- package/dist/cjs/connection.js +25 -11
- package/dist/cjs/driver.d.ts +1 -1
- package/dist/cjs/driver.d.ts.map +1 -1
- package/dist/cjs/index.d.ts +7 -13
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +4 -3
- package/dist/cjs/package.json +31 -32
- package/dist/esm/connection.d.ts +2 -2
- package/dist/esm/connection.d.ts.map +1 -1
- package/dist/esm/connection.js +25 -11
- package/dist/esm/driver.d.ts +1 -1
- package/dist/esm/driver.d.ts.map +1 -1
- package/dist/esm/index.d.ts +7 -13
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +3 -2
- package/dist/esm/package.json +31 -32
- package/package.json +31 -32
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +0 -1
- package/dist/esm/tsconfig.tsbuildinfo +0 -1
package/README.md
CHANGED
|
@@ -2,11 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://badge.fury.io/js/prisma-extension-kysely)
|
|
4
4
|
[](https://www.npmjs.com/package/prisma-extension-kysely)
|
|
5
|
-
[](https://www.npmjs.com/package/prisma-extension-kysely)
|
|
6
|
+
[](https://bundlephobia.com/package/prisma-extension-kysely)
|
|
6
7
|
[](https://github.com/eoin-obrien/prisma-extension-kysely/actions/workflows/ci.yml)
|
|
7
|
-
[](https://github.com/eoin-obrien/prisma-extension-kysely/actions/workflows/npm-publish.yml)
|
|
8
8
|
[](https://codecov.io/gh/eoin-obrien/prisma-extension-kysely)
|
|
9
|
-
[](https://conventionalcommits.org)
|
|
10
|
+
[](https://github.com/eoin-obrien/prisma-extension-kysely/blob/main/LICENSE)
|
|
11
|
+
|
|
12
|
+
> [!IMPORTANT]
|
|
13
|
+
> **v4.0 now requires Prisma 7.** Prisma 7 makes driver adapters a required part of `PrismaClient` — see the [Prisma 7 upgrade guide](https://www.prisma.io/docs/guides/upgrade-prisma-orm/v7) to migrate your project. If you are on Prisma 5 or 6, continue using `prisma-extension-kysely` v3.
|
|
10
14
|
|
|
11
15
|
Writing and maintaining raw SQL queries for Prisma can be a tedious and error-prone task. The moment you need to write a query that is not supported out-of-the-box by Prisma, you lose all of that type-safety and autocompletion. This is where `prisma-extension-kysely` comes in! It allows you to easily write raw SQL queries in a type-safe manner with [`kysely`](https://kysely.dev/) and integrate them seamlessly with Prisma.
|
|
12
16
|
|
|
@@ -27,9 +31,14 @@ You don't have to take our word for it, though:
|
|
|
27
31
|
- **Autocompletion** — Get autocompletion for your queries in your IDE
|
|
28
32
|
- **Type inference** — Get type inference for your queries in your IDE
|
|
29
33
|
|
|
30
|
-
##
|
|
34
|
+
## Compatibility
|
|
31
35
|
|
|
32
|
-
|
|
36
|
+
| prisma-extension-kysely | Prisma | Kysely |
|
|
37
|
+
| ----------------------- | ------------ | -------------- |
|
|
38
|
+
| v3.x | ^5.0 \| ^6.0 | ^0.27 \| ^0.28 |
|
|
39
|
+
| v4.x | ^7.0 | ^0.27 \| ^0.28 |
|
|
40
|
+
|
|
41
|
+
## Get started
|
|
33
42
|
|
|
34
43
|
Install the dependencies:
|
|
35
44
|
|
|
@@ -37,6 +46,12 @@ Install the dependencies:
|
|
|
37
46
|
npm install prisma-extension-kysely kysely
|
|
38
47
|
```
|
|
39
48
|
|
|
49
|
+
Install the driver adapter for your database. For example, for PostgreSQL:
|
|
50
|
+
|
|
51
|
+
```shell
|
|
52
|
+
npm install @prisma/adapter-pg pg
|
|
53
|
+
```
|
|
54
|
+
|
|
40
55
|
Set up the excellent [`prisma-kysely`](https://www.npmjs.com/package/prisma-kysely) library to automatically generate types for your database:
|
|
41
56
|
|
|
42
57
|
```shell
|
|
@@ -60,10 +75,21 @@ npx prisma generate
|
|
|
60
75
|
Extend your Prisma Client:
|
|
61
76
|
|
|
62
77
|
```typescript
|
|
78
|
+
import { PrismaPg } from "@prisma/adapter-pg";
|
|
79
|
+
import {
|
|
80
|
+
Kysely,
|
|
81
|
+
PostgresAdapter,
|
|
82
|
+
PostgresIntrospector,
|
|
83
|
+
PostgresQueryCompiler,
|
|
84
|
+
} from "kysely";
|
|
63
85
|
import kyselyExtension from "prisma-extension-kysely";
|
|
64
|
-
import type { DB } from "./
|
|
86
|
+
import type { DB } from "./generated/kysely/types"; // Your path may vary depending on your setup in schema.prisma
|
|
87
|
+
|
|
88
|
+
const adapter = new PrismaPg({
|
|
89
|
+
connectionString: process.env.DATABASE_URL,
|
|
90
|
+
});
|
|
65
91
|
|
|
66
|
-
const prisma = new PrismaClient().$extends(
|
|
92
|
+
const prisma = new PrismaClient({ adapter }).$extends(
|
|
67
93
|
kyselyExtension({
|
|
68
94
|
kysely: (driver) =>
|
|
69
95
|
new Kysely<DB>({
|
|
@@ -104,7 +130,7 @@ await prisma.$kysely.deleteFrom("User").where("id", "=", id).execute();
|
|
|
104
130
|
|
|
105
131
|
## Transactions
|
|
106
132
|
|
|
107
|
-
Prisma's interactive transactions are fully supported by `prisma-extension-kysely`! Just
|
|
133
|
+
Prisma's interactive transactions are fully supported by `prisma-extension-kysely`! Just remember to use `tx.$kysely` instead of `prisma.$kysely`, and you're good to go:
|
|
108
134
|
|
|
109
135
|
```typescript
|
|
110
136
|
await prisma.$transaction(async (tx) => {
|
|
@@ -132,7 +158,11 @@ await prisma.$kysely.transaction().execute(async (trx) => {});
|
|
|
132
158
|
Do you love Kysely's plugins? So do we! You can use them with `prisma-extension-kysely` as well:
|
|
133
159
|
|
|
134
160
|
```typescript
|
|
135
|
-
const
|
|
161
|
+
const adapter = new PrismaPg({
|
|
162
|
+
connectionString: process.env.DATABASE_URL,
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
const prisma = new PrismaClient({ adapter }).$extends(
|
|
136
166
|
kyselyExtension({
|
|
137
167
|
kysely: (driver) =>
|
|
138
168
|
new Kysely<DB>({
|
|
@@ -172,22 +202,28 @@ const kyselyExtensionArgs: PrismaKyselyExtensionArgs<DB> = {
|
|
|
172
202
|
kysely: (driver) =>
|
|
173
203
|
new Kysely<DB>({
|
|
174
204
|
dialect: {
|
|
175
|
-
createAdapter: () => new
|
|
205
|
+
createAdapter: () => new PostgresAdapter(),
|
|
176
206
|
createDriver: () => driver,
|
|
177
|
-
createIntrospector: (db) => new
|
|
178
|
-
createQueryCompiler: () => new
|
|
207
|
+
createIntrospector: (db) => new PostgresIntrospector(db),
|
|
208
|
+
createQueryCompiler: () => new PostgresQueryCompiler(),
|
|
179
209
|
},
|
|
180
210
|
}),
|
|
181
211
|
};
|
|
182
212
|
|
|
183
|
-
// Initialize the replica client(s) and add the Kysely extension
|
|
184
|
-
const
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
}).$extends(
|
|
213
|
+
// Initialize the replica client(s) with its own adapter and add the Kysely extension
|
|
214
|
+
const replicaAdapter = new PrismaPg({
|
|
215
|
+
connectionString: process.env.REPLICA_DATABASE_URL,
|
|
216
|
+
});
|
|
217
|
+
const replicaClient = new PrismaClient({ adapter: replicaAdapter }).$extends(
|
|
218
|
+
kyselyExtension(kyselyExtensionArgs),
|
|
219
|
+
);
|
|
188
220
|
|
|
189
|
-
// Initialize the primary client
|
|
190
|
-
|
|
221
|
+
// Initialize the primary client with its own adapter, then add the Kysely
|
|
222
|
+
// extension and the read replicas extension
|
|
223
|
+
const primaryAdapter = new PrismaPg({
|
|
224
|
+
connectionString: process.env.DATABASE_URL,
|
|
225
|
+
});
|
|
226
|
+
const prisma = new PrismaClient({ adapter: primaryAdapter })
|
|
191
227
|
.$extends(kyselyExtension(kyselyExtensionArgs)) // Apply the Kysely extension before the read replicas extension!
|
|
192
228
|
.$extends(
|
|
193
229
|
readReplicas({
|
|
@@ -197,19 +233,12 @@ const prisma = new PrismaClient()
|
|
|
197
233
|
```
|
|
198
234
|
|
|
199
235
|
See how we're setting up the replica client as a fully-fledged Prisma client and extending it separately? That's the secret sauce!
|
|
200
|
-
It
|
|
236
|
+
It makes sure that the replica client has a separate Kysely instance. If you try to use bare URLs, you'll run into trouble;
|
|
201
237
|
it'll share the same Kysely instance as the primary client, and you'll get unpleasant surprises!
|
|
202
238
|
|
|
203
|
-
```typescript
|
|
204
|
-
// Don't do this! It won't work as expected.
|
|
205
|
-
readReplicas({
|
|
206
|
-
url: "postgresql://user:password@localhost:5432/dbname",
|
|
207
|
-
});
|
|
208
|
-
```
|
|
209
|
-
|
|
210
239
|
Also, note that we're applying the Kysely extension before the read replicas extension. This is important! If you apply the read replicas extension first, you won't get `.$kysely` on the primary client.
|
|
211
240
|
|
|
212
|
-
Check out the [read replicas example](examples/read-
|
|
241
|
+
Check out the [read replicas example](examples/read-replica/) for a runnable example!
|
|
213
242
|
|
|
214
243
|
## Examples
|
|
215
244
|
|
|
@@ -218,14 +247,14 @@ Check out the [examples](examples) directory for a sample project!
|
|
|
218
247
|
```shell
|
|
219
248
|
cd examples/basic
|
|
220
249
|
npm install
|
|
221
|
-
|
|
222
|
-
npm run dev
|
|
250
|
+
npm start
|
|
223
251
|
```
|
|
224
252
|
|
|
225
253
|
## Learn more
|
|
226
254
|
|
|
227
255
|
- [Kysely](https://kysely.dev/)
|
|
228
256
|
- [`prisma-kysely`](https://www.npmjs.com/package/prisma-kysely)
|
|
257
|
+
- [Prisma 7 upgrade guide](https://www.prisma.io/docs/guides/upgrade-prisma-orm/v7)
|
|
229
258
|
|
|
230
259
|
## License
|
|
231
260
|
|
package/dist/cjs/connection.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PrismaClient } from "@prisma/client/extension";
|
|
2
|
-
import { CompiledQuery, DatabaseConnection, QueryResult } from "kysely";
|
|
1
|
+
import type { PrismaClient } from "@prisma/client/extension";
|
|
2
|
+
import { type CompiledQuery, type DatabaseConnection, type QueryResult } from "kysely";
|
|
3
3
|
/**
|
|
4
4
|
* A Kysely database connection that uses Prisma as the driver
|
|
5
5
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../src/connection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../src/connection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,kBAAkB,EAGvB,KAAK,WAAW,EAEjB,MAAM,QAAQ,CAAC;AAEhB;;GAEG;AACH,qBAAa,gBAAiB,YAAW,kBAAkB;IAC7C,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,YAAY;IAE3C,YAAY,CAAC,CAAC,EAClB,aAAa,EAAE,aAAa,CAAC,OAAO,CAAC,GACpC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IA2C1B,WAAW,CAAC,CAAC,EACX,cAAc,EAAE,aAAa,CAAC,OAAO,CAAC,EACtC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,GAC9B,qBAAqB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;CAKzC"}
|
package/dist/cjs/connection.js
CHANGED
|
@@ -20,24 +20,38 @@ class PrismaConnection {
|
|
|
20
20
|
}
|
|
21
21
|
executeQuery(compiledQuery) {
|
|
22
22
|
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
var _a;
|
|
23
24
|
const { sql, parameters, query } = compiledQuery;
|
|
25
|
+
// Capture the caller stack trace to provide better error messages when a query fails
|
|
26
|
+
const callerStack = {};
|
|
27
|
+
Error.captureStackTrace(callerStack, PrismaConnection.prototype.executeQuery);
|
|
24
28
|
// Delete, update and insert queries return the number of affected rows if no returning clause is specified
|
|
25
29
|
const supportsReturning = kysely_1.DeleteQueryNode.is(query) ||
|
|
26
30
|
kysely_1.UpdateQueryNode.is(query) ||
|
|
27
31
|
kysely_1.InsertQueryNode.is(query);
|
|
28
32
|
const shouldReturnAffectedRows = supportsReturning && !query.returning;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
try {
|
|
34
|
+
// Execute the query with $executeRawUnsafe to get the number of affected rows
|
|
35
|
+
if (shouldReturnAffectedRows) {
|
|
36
|
+
const numAffectedRows = BigInt(yield this.prisma.$executeRawUnsafe(sql, ...parameters));
|
|
37
|
+
return {
|
|
38
|
+
rows: [],
|
|
39
|
+
numAffectedRows: numAffectedRows,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
// Otherwise, execute it with $queryRawUnsafe to get the query results
|
|
43
|
+
const rows = yield this.prisma.$queryRawUnsafe(sql, ...parameters);
|
|
44
|
+
return { rows };
|
|
45
|
+
}
|
|
46
|
+
catch (err) {
|
|
47
|
+
if (err instanceof Error && callerStack.stack) {
|
|
48
|
+
err.stack =
|
|
49
|
+
((_a = err.stack) !== null && _a !== void 0 ? _a : "") +
|
|
50
|
+
"\nFrom prisma-extension-kysely:\n" +
|
|
51
|
+
callerStack.stack;
|
|
52
|
+
}
|
|
53
|
+
throw err;
|
|
37
54
|
}
|
|
38
|
-
// Otherwise, execute it with $queryRawUnsafe to get the query results
|
|
39
|
-
const rows = yield this.prisma.$queryRawUnsafe(sql, ...parameters);
|
|
40
|
-
return { rows };
|
|
41
55
|
});
|
|
42
56
|
}
|
|
43
57
|
streamQuery(_compiledQuery, _chunkSize) {
|
package/dist/cjs/driver.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PrismaClient } from "@prisma/client/extension";
|
|
2
|
-
import { DatabaseConnection, Driver, TransactionSettings } from "kysely";
|
|
2
|
+
import type { DatabaseConnection, Driver, TransactionSettings } from "kysely";
|
|
3
3
|
export declare class PrismaDriver<T extends PrismaClient> implements Driver {
|
|
4
4
|
private readonly prisma;
|
|
5
5
|
constructor(prisma: T);
|
package/dist/cjs/driver.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../src/driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../src/driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAG9E,qBAAa,YAAY,CAAC,CAAC,SAAS,YAAY,CAAE,YAAW,MAAM;IACrD,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,CAAC;IAEhC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAErB,iBAAiB,IAAI,OAAO,CAAC,kBAAkB,CAAC;IAIhD,gBAAgB,CACpB,WAAW,EAAE,kBAAkB,EAC/B,SAAS,EAAE,mBAAmB,GAC7B,OAAO,CAAC,IAAI,CAAC;IAIV,iBAAiB,CAAC,WAAW,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjE,mBAAmB,CAAC,WAAW,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAInE,iBAAiB,CAAC,WAAW,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAEjE,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAC/B"}
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Kysely } from "kysely";
|
|
1
|
+
import type { Kysely } from "kysely";
|
|
2
2
|
import { PrismaDriver } from "./driver.js";
|
|
3
3
|
/**
|
|
4
4
|
* The configuration object for the Prisma Kysely extension
|
|
@@ -16,17 +16,11 @@ export declare class PrismaKyselyExtensionError extends Error {
|
|
|
16
16
|
* Define a Prisma extension that adds Kysely query builder methods to the Prisma client
|
|
17
17
|
* @param extensionArgs The extension configuration object
|
|
18
18
|
*/
|
|
19
|
-
declare const _default: <Database>(extensionArgs: PrismaKyselyExtensionArgs<Database>) => (client: any) => {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
client: {
|
|
26
|
-
$kysely: () => Kysely<Database>;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
};
|
|
19
|
+
declare const _default: <Database>(extensionArgs: PrismaKyselyExtensionArgs<Database>) => (client: any) => import("@prisma/client/extension").PrismaClientExtends<import("@prisma/client/runtime/client.js").InternalArgs<{}, {}, {}, {
|
|
20
|
+
/**
|
|
21
|
+
* The Kysely instance used by the Prisma client
|
|
22
|
+
*/
|
|
23
|
+
$kysely: Kysely<Database>;
|
|
24
|
+
}> & import("@prisma/client/runtime/client.js").DefaultArgs>;
|
|
31
25
|
export default _default;
|
|
32
26
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/cjs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C;;GAEG;AACH,MAAM,MAAM,yBAAyB,CAAC,QAAQ,IAAI;IAChD;;OAEG;IACH,MAAM,EAAE,CAAC,MAAM,EAAE,YAAY,CAAC,OAAO,CAAC,KAAK,MAAM,CAAC,QAAQ,CAAC,CAAC;CAC7D,CAAC;AAEF,qBAAa,0BAA2B,SAAQ,KAAK;gBACvC,OAAO,EAAE,MAAM;CAI5B;AAED;;;GAGG;yBACa,QAAQ,EAAE,eAAe,yBAAyB,CAAC,QAAQ,CAAC;IAepE;;OAEG;;;AAjBX,wBA0DK"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.PrismaKyselyExtensionError = void 0;
|
|
13
|
-
const
|
|
13
|
+
const extension_1 = require("@prisma/client/extension");
|
|
14
14
|
const driver_js_1 = require("./driver.js");
|
|
15
15
|
class PrismaKyselyExtensionError extends Error {
|
|
16
16
|
constructor(message) {
|
|
@@ -23,7 +23,7 @@ exports.PrismaKyselyExtensionError = PrismaKyselyExtensionError;
|
|
|
23
23
|
* Define a Prisma extension that adds Kysely query builder methods to the Prisma client
|
|
24
24
|
* @param extensionArgs The extension configuration object
|
|
25
25
|
*/
|
|
26
|
-
exports.default = (extensionArgs) =>
|
|
26
|
+
exports.default = (extensionArgs) => extension_1.Prisma.defineExtension((client) => {
|
|
27
27
|
// Check if the client is already extended
|
|
28
28
|
if ("$kysely" in client) {
|
|
29
29
|
throw new PrismaKyselyExtensionError("The Prisma client is already extended with Kysely");
|
|
@@ -42,12 +42,13 @@ exports.default = (extensionArgs) => client_1.Prisma.defineExtension((client) =>
|
|
|
42
42
|
// Wrap the $transaction method to attach a fresh Kysely instance to the transaction client
|
|
43
43
|
const kyselyTransaction = (target) => (...args) => {
|
|
44
44
|
if (typeof args[0] === "function") {
|
|
45
|
-
// If the first argument is a function, add a fresh Kysely instance to the transaction client
|
|
46
45
|
const [fn, options] = args;
|
|
47
46
|
return target.$transaction((tx) => __awaiter(void 0, void 0, void 0, function* () {
|
|
48
47
|
// The Kysely instance should call the transaction client, not the original client
|
|
49
48
|
const driver = new driver_js_1.PrismaDriver(tx);
|
|
50
49
|
const kysely = extensionArgs.kysely(driver);
|
|
50
|
+
// Attach the Kysely instance to the transaction client so that it can be accessed in the transaction function
|
|
51
|
+
// biome-ignore lint/suspicious/noExplicitAny: @prisma/client/extension types $transaction overloads differently
|
|
51
52
|
tx.$kysely = kysely;
|
|
52
53
|
return fn(tx);
|
|
53
54
|
}), options);
|
package/dist/cjs/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prisma-extension-kysely",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "Eoin O'Brien",
|
|
6
6
|
"url": "https://eoin.ai",
|
|
@@ -31,23 +31,23 @@
|
|
|
31
31
|
],
|
|
32
32
|
"type": "commonjs",
|
|
33
33
|
"files": [
|
|
34
|
-
"dist"
|
|
34
|
+
"dist",
|
|
35
|
+
"!**/*.tsbuildinfo"
|
|
35
36
|
],
|
|
36
37
|
"scripts": {
|
|
37
|
-
"pretest": "prisma db push",
|
|
38
|
-
"test": "
|
|
39
|
-
"test:watch": "
|
|
40
|
-
"
|
|
38
|
+
"pretest": "prisma db push && prisma generate",
|
|
39
|
+
"test": "vitest run",
|
|
40
|
+
"test:watch": "vitest",
|
|
41
|
+
"pretest:coverage": "prisma db push && prisma generate",
|
|
42
|
+
"test:coverage": "vitest run --coverage",
|
|
41
43
|
"build:clean": "rm -rf ./dist",
|
|
42
44
|
"build:compile": "tsc -b tsconfig.json tsconfig.cjs.json && tsconfig-to-dual-package",
|
|
43
45
|
"build": "npm run build:clean && npm run build:compile",
|
|
44
46
|
"prepack": "npm run build",
|
|
45
|
-
"prepare": "husky
|
|
47
|
+
"prepare": "husky || true",
|
|
46
48
|
"commit": "git-cz",
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"format": "prettier --write .",
|
|
50
|
-
"format:check": "prettier --check ."
|
|
49
|
+
"check": "biome check .",
|
|
50
|
+
"check:write": "biome check --write ."
|
|
51
51
|
},
|
|
52
52
|
"config": {
|
|
53
53
|
"commitizen": {
|
|
@@ -55,31 +55,30 @@
|
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"@prisma/client": "
|
|
58
|
+
"@prisma/client": "^7.0.0",
|
|
59
|
+
"kysely": "^0.27.0 || ^0.28.0"
|
|
59
60
|
},
|
|
60
61
|
"devDependencies": {
|
|
61
|
-
"@
|
|
62
|
-
"@commitlint/
|
|
63
|
-
"@commitlint/
|
|
64
|
-
"@
|
|
65
|
-
"@prisma/
|
|
66
|
-
"@
|
|
67
|
-
"@
|
|
68
|
-
"@
|
|
62
|
+
"@biomejs/biome": "^2.4.4",
|
|
63
|
+
"@commitlint/cli": "^20.0.0",
|
|
64
|
+
"@commitlint/config-conventional": "^20.0.0",
|
|
65
|
+
"@commitlint/cz-commitlint": "^20.0.0",
|
|
66
|
+
"@prisma/adapter-better-sqlite3": "^7.4.1",
|
|
67
|
+
"@prisma/client": "^7.0.0",
|
|
68
|
+
"@prisma/extension-read-replicas": "^0.5.0",
|
|
69
|
+
"@semantic-release/changelog": "^6.0.0",
|
|
70
|
+
"@semantic-release/git": "^10.0.0",
|
|
71
|
+
"@vitest/coverage-v8": "^3.0.0",
|
|
69
72
|
"commitizen": "^4.3.0",
|
|
70
|
-
"
|
|
71
|
-
"eslint-config-prettier": "^9.0.0",
|
|
72
|
-
"eslint-plugin-require-extensions": "^0.1.3",
|
|
73
|
+
"dotenv": "^17.3.1",
|
|
73
74
|
"husky": "^9.0.0",
|
|
74
|
-
"inquirer": "^
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"kysely": "^0.
|
|
78
|
-
"
|
|
79
|
-
"prisma": "latest",
|
|
80
|
-
"prisma-kysely": "^1.7.1",
|
|
81
|
-
"ts-jest": "^29.1.1",
|
|
75
|
+
"inquirer": "^9.0.0",
|
|
76
|
+
"kysely": "^0.28.0",
|
|
77
|
+
"prisma": "^7.0.0",
|
|
78
|
+
"prisma-kysely": "^3.0.0",
|
|
79
|
+
"semantic-release": "^25.0.3",
|
|
82
80
|
"tsconfig-to-dual-package": "^1.2.0",
|
|
83
|
-
"typescript": "^5.0.0"
|
|
81
|
+
"typescript": "^5.0.0",
|
|
82
|
+
"vitest": "^3.0.0"
|
|
84
83
|
}
|
|
85
84
|
}
|
package/dist/esm/connection.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PrismaClient } from "@prisma/client/extension";
|
|
2
|
-
import { CompiledQuery, DatabaseConnection, QueryResult } from "kysely";
|
|
1
|
+
import type { PrismaClient } from "@prisma/client/extension";
|
|
2
|
+
import { type CompiledQuery, type DatabaseConnection, type QueryResult } from "kysely";
|
|
3
3
|
/**
|
|
4
4
|
* A Kysely database connection that uses Prisma as the driver
|
|
5
5
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../src/connection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../src/connection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,kBAAkB,EAGvB,KAAK,WAAW,EAEjB,MAAM,QAAQ,CAAC;AAEhB;;GAEG;AACH,qBAAa,gBAAiB,YAAW,kBAAkB;IAC7C,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,YAAY;IAE3C,YAAY,CAAC,CAAC,EAClB,aAAa,EAAE,aAAa,CAAC,OAAO,CAAC,GACpC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IA2C1B,WAAW,CAAC,CAAC,EACX,cAAc,EAAE,aAAa,CAAC,OAAO,CAAC,EACtC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,GAC9B,qBAAqB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;CAKzC"}
|
package/dist/esm/connection.js
CHANGED
|
@@ -17,24 +17,38 @@ export class PrismaConnection {
|
|
|
17
17
|
}
|
|
18
18
|
executeQuery(compiledQuery) {
|
|
19
19
|
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
var _a;
|
|
20
21
|
const { sql, parameters, query } = compiledQuery;
|
|
22
|
+
// Capture the caller stack trace to provide better error messages when a query fails
|
|
23
|
+
const callerStack = {};
|
|
24
|
+
Error.captureStackTrace(callerStack, PrismaConnection.prototype.executeQuery);
|
|
21
25
|
// Delete, update and insert queries return the number of affected rows if no returning clause is specified
|
|
22
26
|
const supportsReturning = DeleteQueryNode.is(query) ||
|
|
23
27
|
UpdateQueryNode.is(query) ||
|
|
24
28
|
InsertQueryNode.is(query);
|
|
25
29
|
const shouldReturnAffectedRows = supportsReturning && !query.returning;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
try {
|
|
31
|
+
// Execute the query with $executeRawUnsafe to get the number of affected rows
|
|
32
|
+
if (shouldReturnAffectedRows) {
|
|
33
|
+
const numAffectedRows = BigInt(yield this.prisma.$executeRawUnsafe(sql, ...parameters));
|
|
34
|
+
return {
|
|
35
|
+
rows: [],
|
|
36
|
+
numAffectedRows: numAffectedRows,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
// Otherwise, execute it with $queryRawUnsafe to get the query results
|
|
40
|
+
const rows = yield this.prisma.$queryRawUnsafe(sql, ...parameters);
|
|
41
|
+
return { rows };
|
|
42
|
+
}
|
|
43
|
+
catch (err) {
|
|
44
|
+
if (err instanceof Error && callerStack.stack) {
|
|
45
|
+
err.stack =
|
|
46
|
+
((_a = err.stack) !== null && _a !== void 0 ? _a : "") +
|
|
47
|
+
"\nFrom prisma-extension-kysely:\n" +
|
|
48
|
+
callerStack.stack;
|
|
49
|
+
}
|
|
50
|
+
throw err;
|
|
34
51
|
}
|
|
35
|
-
// Otherwise, execute it with $queryRawUnsafe to get the query results
|
|
36
|
-
const rows = yield this.prisma.$queryRawUnsafe(sql, ...parameters);
|
|
37
|
-
return { rows };
|
|
38
52
|
});
|
|
39
53
|
}
|
|
40
54
|
streamQuery(_compiledQuery, _chunkSize) {
|
package/dist/esm/driver.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PrismaClient } from "@prisma/client/extension";
|
|
2
|
-
import { DatabaseConnection, Driver, TransactionSettings } from "kysely";
|
|
2
|
+
import type { DatabaseConnection, Driver, TransactionSettings } from "kysely";
|
|
3
3
|
export declare class PrismaDriver<T extends PrismaClient> implements Driver {
|
|
4
4
|
private readonly prisma;
|
|
5
5
|
constructor(prisma: T);
|
package/dist/esm/driver.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../src/driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../src/driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAG9E,qBAAa,YAAY,CAAC,CAAC,SAAS,YAAY,CAAE,YAAW,MAAM;IACrD,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,CAAC;IAEhC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAErB,iBAAiB,IAAI,OAAO,CAAC,kBAAkB,CAAC;IAIhD,gBAAgB,CACpB,WAAW,EAAE,kBAAkB,EAC/B,SAAS,EAAE,mBAAmB,GAC7B,OAAO,CAAC,IAAI,CAAC;IAIV,iBAAiB,CAAC,WAAW,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjE,mBAAmB,CAAC,WAAW,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAInE,iBAAiB,CAAC,WAAW,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAEjE,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAC/B"}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Kysely } from "kysely";
|
|
1
|
+
import type { Kysely } from "kysely";
|
|
2
2
|
import { PrismaDriver } from "./driver.js";
|
|
3
3
|
/**
|
|
4
4
|
* The configuration object for the Prisma Kysely extension
|
|
@@ -16,17 +16,11 @@ export declare class PrismaKyselyExtensionError extends Error {
|
|
|
16
16
|
* Define a Prisma extension that adds Kysely query builder methods to the Prisma client
|
|
17
17
|
* @param extensionArgs The extension configuration object
|
|
18
18
|
*/
|
|
19
|
-
declare const _default: <Database>(extensionArgs: PrismaKyselyExtensionArgs<Database>) => (client: any) => {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
client: {
|
|
26
|
-
$kysely: () => Kysely<Database>;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
};
|
|
19
|
+
declare const _default: <Database>(extensionArgs: PrismaKyselyExtensionArgs<Database>) => (client: any) => import("@prisma/client/extension").PrismaClientExtends<import("@prisma/client/runtime/client.js").InternalArgs<{}, {}, {}, {
|
|
20
|
+
/**
|
|
21
|
+
* The Kysely instance used by the Prisma client
|
|
22
|
+
*/
|
|
23
|
+
$kysely: Kysely<Database>;
|
|
24
|
+
}> & import("@prisma/client/runtime/client.js").DefaultArgs>;
|
|
31
25
|
export default _default;
|
|
32
26
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C;;GAEG;AACH,MAAM,MAAM,yBAAyB,CAAC,QAAQ,IAAI;IAChD;;OAEG;IACH,MAAM,EAAE,CAAC,MAAM,EAAE,YAAY,CAAC,OAAO,CAAC,KAAK,MAAM,CAAC,QAAQ,CAAC,CAAC;CAC7D,CAAC;AAEF,qBAAa,0BAA2B,SAAQ,KAAK;gBACvC,OAAO,EAAE,MAAM;CAI5B;AAED;;;GAGG;yBACa,QAAQ,EAAE,eAAe,yBAAyB,CAAC,QAAQ,CAAC;IAepE;;OAEG;;;AAjBX,wBA0DK"}
|
package/dist/esm/index.js
CHANGED
|
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { Prisma } from "@prisma/client";
|
|
10
|
+
import { Prisma } from "@prisma/client/extension";
|
|
11
11
|
import { PrismaDriver } from "./driver.js";
|
|
12
12
|
export class PrismaKyselyExtensionError extends Error {
|
|
13
13
|
constructor(message) {
|
|
@@ -38,12 +38,13 @@ export default (extensionArgs) => Prisma.defineExtension((client) => {
|
|
|
38
38
|
// Wrap the $transaction method to attach a fresh Kysely instance to the transaction client
|
|
39
39
|
const kyselyTransaction = (target) => (...args) => {
|
|
40
40
|
if (typeof args[0] === "function") {
|
|
41
|
-
// If the first argument is a function, add a fresh Kysely instance to the transaction client
|
|
42
41
|
const [fn, options] = args;
|
|
43
42
|
return target.$transaction((tx) => __awaiter(void 0, void 0, void 0, function* () {
|
|
44
43
|
// The Kysely instance should call the transaction client, not the original client
|
|
45
44
|
const driver = new PrismaDriver(tx);
|
|
46
45
|
const kysely = extensionArgs.kysely(driver);
|
|
46
|
+
// Attach the Kysely instance to the transaction client so that it can be accessed in the transaction function
|
|
47
|
+
// biome-ignore lint/suspicious/noExplicitAny: @prisma/client/extension types $transaction overloads differently
|
|
47
48
|
tx.$kysely = kysely;
|
|
48
49
|
return fn(tx);
|
|
49
50
|
}), options);
|
package/dist/esm/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prisma-extension-kysely",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "Eoin O'Brien",
|
|
6
6
|
"url": "https://eoin.ai",
|
|
@@ -31,23 +31,23 @@
|
|
|
31
31
|
],
|
|
32
32
|
"type": "module",
|
|
33
33
|
"files": [
|
|
34
|
-
"dist"
|
|
34
|
+
"dist",
|
|
35
|
+
"!**/*.tsbuildinfo"
|
|
35
36
|
],
|
|
36
37
|
"scripts": {
|
|
37
|
-
"pretest": "prisma db push",
|
|
38
|
-
"test": "
|
|
39
|
-
"test:watch": "
|
|
40
|
-
"
|
|
38
|
+
"pretest": "prisma db push && prisma generate",
|
|
39
|
+
"test": "vitest run",
|
|
40
|
+
"test:watch": "vitest",
|
|
41
|
+
"pretest:coverage": "prisma db push && prisma generate",
|
|
42
|
+
"test:coverage": "vitest run --coverage",
|
|
41
43
|
"build:clean": "rm -rf ./dist",
|
|
42
44
|
"build:compile": "tsc -b tsconfig.json tsconfig.cjs.json && tsconfig-to-dual-package",
|
|
43
45
|
"build": "npm run build:clean && npm run build:compile",
|
|
44
46
|
"prepack": "npm run build",
|
|
45
|
-
"prepare": "husky
|
|
47
|
+
"prepare": "husky || true",
|
|
46
48
|
"commit": "git-cz",
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"format": "prettier --write .",
|
|
50
|
-
"format:check": "prettier --check ."
|
|
49
|
+
"check": "biome check .",
|
|
50
|
+
"check:write": "biome check --write ."
|
|
51
51
|
},
|
|
52
52
|
"config": {
|
|
53
53
|
"commitizen": {
|
|
@@ -55,31 +55,30 @@
|
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"@prisma/client": "
|
|
58
|
+
"@prisma/client": "^7.0.0",
|
|
59
|
+
"kysely": "^0.27.0 || ^0.28.0"
|
|
59
60
|
},
|
|
60
61
|
"devDependencies": {
|
|
61
|
-
"@
|
|
62
|
-
"@commitlint/
|
|
63
|
-
"@commitlint/
|
|
64
|
-
"@
|
|
65
|
-
"@prisma/
|
|
66
|
-
"@
|
|
67
|
-
"@
|
|
68
|
-
"@
|
|
62
|
+
"@biomejs/biome": "^2.4.4",
|
|
63
|
+
"@commitlint/cli": "^20.0.0",
|
|
64
|
+
"@commitlint/config-conventional": "^20.0.0",
|
|
65
|
+
"@commitlint/cz-commitlint": "^20.0.0",
|
|
66
|
+
"@prisma/adapter-better-sqlite3": "^7.4.1",
|
|
67
|
+
"@prisma/client": "^7.0.0",
|
|
68
|
+
"@prisma/extension-read-replicas": "^0.5.0",
|
|
69
|
+
"@semantic-release/changelog": "^6.0.0",
|
|
70
|
+
"@semantic-release/git": "^10.0.0",
|
|
71
|
+
"@vitest/coverage-v8": "^3.0.0",
|
|
69
72
|
"commitizen": "^4.3.0",
|
|
70
|
-
"
|
|
71
|
-
"eslint-config-prettier": "^9.0.0",
|
|
72
|
-
"eslint-plugin-require-extensions": "^0.1.3",
|
|
73
|
+
"dotenv": "^17.3.1",
|
|
73
74
|
"husky": "^9.0.0",
|
|
74
|
-
"inquirer": "^
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"kysely": "^0.
|
|
78
|
-
"
|
|
79
|
-
"prisma": "latest",
|
|
80
|
-
"prisma-kysely": "^1.7.1",
|
|
81
|
-
"ts-jest": "^29.1.1",
|
|
75
|
+
"inquirer": "^9.0.0",
|
|
76
|
+
"kysely": "^0.28.0",
|
|
77
|
+
"prisma": "^7.0.0",
|
|
78
|
+
"prisma-kysely": "^3.0.0",
|
|
79
|
+
"semantic-release": "^25.0.3",
|
|
82
80
|
"tsconfig-to-dual-package": "^1.2.0",
|
|
83
|
-
"typescript": "^5.0.0"
|
|
81
|
+
"typescript": "^5.0.0",
|
|
82
|
+
"vitest": "^3.0.0"
|
|
84
83
|
}
|
|
85
84
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prisma-extension-kysely",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "Eoin O'Brien",
|
|
6
6
|
"url": "https://eoin.ai",
|
|
@@ -48,23 +48,23 @@
|
|
|
48
48
|
"./package.json": "./package.json"
|
|
49
49
|
},
|
|
50
50
|
"files": [
|
|
51
|
-
"dist"
|
|
51
|
+
"dist",
|
|
52
|
+
"!**/*.tsbuildinfo"
|
|
52
53
|
],
|
|
53
54
|
"scripts": {
|
|
54
|
-
"pretest": "prisma db push",
|
|
55
|
-
"test": "
|
|
56
|
-
"test:watch": "
|
|
57
|
-
"
|
|
55
|
+
"pretest": "prisma db push && prisma generate",
|
|
56
|
+
"test": "vitest run",
|
|
57
|
+
"test:watch": "vitest",
|
|
58
|
+
"pretest:coverage": "prisma db push && prisma generate",
|
|
59
|
+
"test:coverage": "vitest run --coverage",
|
|
58
60
|
"build:clean": "rm -rf ./dist",
|
|
59
61
|
"build:compile": "tsc -b tsconfig.json tsconfig.cjs.json && tsconfig-to-dual-package",
|
|
60
62
|
"build": "npm run build:clean && npm run build:compile",
|
|
61
63
|
"prepack": "npm run build",
|
|
62
|
-
"prepare": "husky
|
|
64
|
+
"prepare": "husky || true",
|
|
63
65
|
"commit": "git-cz",
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"format": "prettier --write .",
|
|
67
|
-
"format:check": "prettier --check ."
|
|
66
|
+
"check": "biome check .",
|
|
67
|
+
"check:write": "biome check --write ."
|
|
68
68
|
},
|
|
69
69
|
"config": {
|
|
70
70
|
"commitizen": {
|
|
@@ -72,31 +72,30 @@
|
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
|
-
"@prisma/client": "
|
|
75
|
+
"@prisma/client": "^7.0.0",
|
|
76
|
+
"kysely": "^0.27.0 || ^0.28.0"
|
|
76
77
|
},
|
|
77
78
|
"devDependencies": {
|
|
78
|
-
"@
|
|
79
|
-
"@commitlint/
|
|
80
|
-
"@commitlint/
|
|
81
|
-
"@
|
|
82
|
-
"@prisma/
|
|
83
|
-
"@
|
|
84
|
-
"@
|
|
85
|
-
"@
|
|
79
|
+
"@biomejs/biome": "^2.4.4",
|
|
80
|
+
"@commitlint/cli": "^20.0.0",
|
|
81
|
+
"@commitlint/config-conventional": "^20.0.0",
|
|
82
|
+
"@commitlint/cz-commitlint": "^20.0.0",
|
|
83
|
+
"@prisma/adapter-better-sqlite3": "^7.4.1",
|
|
84
|
+
"@prisma/client": "^7.0.0",
|
|
85
|
+
"@prisma/extension-read-replicas": "^0.5.0",
|
|
86
|
+
"@semantic-release/changelog": "^6.0.0",
|
|
87
|
+
"@semantic-release/git": "^10.0.0",
|
|
88
|
+
"@vitest/coverage-v8": "^3.0.0",
|
|
86
89
|
"commitizen": "^4.3.0",
|
|
87
|
-
"
|
|
88
|
-
"eslint-config-prettier": "^9.0.0",
|
|
89
|
-
"eslint-plugin-require-extensions": "^0.1.3",
|
|
90
|
+
"dotenv": "^17.3.1",
|
|
90
91
|
"husky": "^9.0.0",
|
|
91
|
-
"inquirer": "^
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"kysely": "^0.
|
|
95
|
-
"
|
|
96
|
-
"prisma": "latest",
|
|
97
|
-
"prisma-kysely": "^1.7.1",
|
|
98
|
-
"ts-jest": "^29.1.1",
|
|
92
|
+
"inquirer": "^9.0.0",
|
|
93
|
+
"kysely": "^0.28.0",
|
|
94
|
+
"prisma": "^7.0.0",
|
|
95
|
+
"prisma-kysely": "^3.0.0",
|
|
96
|
+
"semantic-release": "^25.0.3",
|
|
99
97
|
"tsconfig-to-dual-package": "^1.2.0",
|
|
100
|
-
"typescript": "^5.0.0"
|
|
98
|
+
"typescript": "^5.0.0",
|
|
99
|
+
"vitest": "^3.0.0"
|
|
101
100
|
}
|
|
102
101
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"root":["../../src/connection.ts","../../src/driver.ts","../../src/index.ts"],"version":"5.6.3"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"root":["../../src/connection.ts","../../src/driver.ts","../../src/index.ts"],"version":"5.6.3"}
|