Skip to content

Commit 0ec94bf

Browse files
committed
update driver example to prisma v7 and nestjs-prisma@0.27.0-dev.0
1 parent c56ee9f commit 0ec94bf

File tree

14 files changed

+633
-216
lines changed

14 files changed

+633
-216
lines changed

examples/driver/package-lock.json

Lines changed: 548 additions & 115 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/driver/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
"@nestjs/common": "^11.0.1",
2424
"@nestjs/core": "^11.0.1",
2525
"@nestjs/platform-express": "^11.0.1",
26-
"@prisma/adapter-better-sqlite3": "^6.16.2",
27-
"@prisma/client": "^6.16.2",
28-
"nestjs-prisma": "^0.26.0",
26+
"@prisma/adapter-better-sqlite3": "^7.0.0",
27+
"@prisma/client": "^7.0.0",
28+
"nestjs-prisma": "^0.27.0-dev.0",
2929
"reflect-metadata": "^0.2.2",
3030
"rxjs": "^7.8.1"
3131
},
@@ -45,6 +45,7 @@
4545
"globals": "^16.0.0",
4646
"jest": "^30.0.0",
4747
"prettier": "^3.4.2",
48+
"prisma": "^7.0.0",
4849
"source-map-support": "^0.5.21",
4950
"supertest": "^7.0.0",
5051
"ts-jest": "^29.2.5",

examples/driver/prisma.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,7 @@ export default defineConfig({
77
path: './prisma/migrations',
88
seed: 'tsx ./prisma/seed.ts',
99
},
10+
datasource: {
11+
url: 'file:./prisma/dev.db',
12+
}
1013
});

examples/driver/prisma/schema.prisma

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ generator client {
77

88
datasource db {
99
provider = "sqlite"
10-
url = "file:dev.db"
1110
}
1211

1312
model User {

examples/driver/src/generated/prisma/browser.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
33
/* eslint-disable */
4+
// biome-ignore-all lint: generated file
45
// @ts-nocheck
56
/*
67
* This file should be your main import to use Prisma-related types and utilities in a browser.

examples/driver/src/generated/prisma/client.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11

22
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
33
/* eslint-disable */
4+
// biome-ignore-all lint: generated file
45
// @ts-nocheck
56
/*
67
* This file should be your main import to use Prisma. Through it you get access to all the models, enums, and input types.
78
* If you're looking for something you can import in the client-side of your application, please refer to the `browser.ts` file instead.
8-
*
9+
*
910
* 🟢 You can import this file directly.
1011
*/
1112

@@ -32,12 +33,10 @@ export * from "./enums.js"
3233
*
3334
* Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client).
3435
*/
35-
export const PrismaClient = $Class.getPrismaClientClass(__dirname)
36+
export const PrismaClient = $Class.getPrismaClientClass()
3637
export type PrismaClient<LogOpts extends Prisma.LogLevel = never, OmitOpts extends Prisma.PrismaClientOptions["omit"] = Prisma.PrismaClientOptions["omit"], ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = $Class.PrismaClient<LogOpts, OmitOpts, ExtArgs>
3738
export { Prisma }
3839

39-
40-
4140
/**
4241
* Model User
4342
*

examples/driver/src/generated/prisma/commonInputTypes.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
33
/* eslint-disable */
4+
// biome-ignore-all lint: generated file
45
// @ts-nocheck
56
/*
67
* This file exports various common sort, input & filter types that are not directly linked to a particular model.

examples/driver/src/generated/prisma/enums.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
33
/* eslint-disable */
4+
// biome-ignore-all lint: generated file
45
// @ts-nocheck
56
/*
67
* This file exports all enum related types from the schema.

examples/driver/src/generated/prisma/internal/class.ts

Lines changed: 9 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
33
/* eslint-disable */
4+
// biome-ignore-all lint: generated file
45
// @ts-nocheck
56
/*
67
* WARNING: This is an internal file that is subject to change!
@@ -15,60 +16,19 @@ import type * as Prisma from "./prismaNamespace.js"
1516

1617

1718
const config: runtime.GetPrismaClientConfig = {
18-
"generator": {
19-
"name": "client",
20-
"provider": {
21-
"fromEnvVar": null,
22-
"value": "prisma-client"
23-
},
24-
"output": {
25-
"value": "/Users/m/Dev/me/nestjs-prisma/examples/driver/src/generated/prisma",
26-
"fromEnvVar": null
27-
},
28-
"config": {
29-
"moduleFormat": "cjs",
30-
"engineType": "client"
31-
},
32-
"binaryTargets": [
33-
{
34-
"fromEnvVar": null,
35-
"value": "darwin-arm64",
36-
"native": true
37-
}
38-
],
39-
"previewFeatures": [],
40-
"sourceFilePath": "/Users/m/Dev/me/nestjs-prisma/examples/driver/prisma/schema.prisma",
41-
"isCustomOutput": true
42-
},
43-
"relativePath": "../../../prisma",
44-
"clientVersion": "6.16.2",
45-
"engineVersion": "1c57fdcd7e44b29b9313256c76699e91c3ac3c43",
46-
"datasourceNames": [
47-
"db"
48-
],
19+
"previewFeatures": [],
20+
"clientVersion": "7.0.0",
21+
"engineVersion": "0c19ccc313cf9911a90d99d2ac2eb0280c76c513",
4922
"activeProvider": "sqlite",
50-
"postinstall": false,
51-
"inlineDatasources": {
52-
"db": {
53-
"url": {
54-
"fromEnvVar": null,
55-
"value": "file:dev.db"
56-
}
57-
}
58-
},
59-
"inlineSchema": "generator client {\n provider = \"prisma-client\"\n output = \"../src/generated/prisma\"\n engineType = \"client\"\n moduleFormat = \"cjs\"\n}\n\ndatasource db {\n provider = \"sqlite\"\n url = \"file:dev.db\"\n}\n\nmodel User {\n id String @id @default(cuid())\n email String @unique\n name String?\n}\n",
60-
"inlineSchemaHash": "2b68a464f8f7060f5c42f62195b6b763e3a7cd2e7117652711d7a751d5ac3089",
61-
"copyEngine": true,
23+
"inlineSchema": "generator client {\n provider = \"prisma-client\"\n output = \"../src/generated/prisma\"\n engineType = \"client\"\n moduleFormat = \"cjs\"\n}\n\ndatasource db {\n provider = \"sqlite\"\n}\n\nmodel User {\n id String @id @default(cuid())\n email String @unique\n name String?\n}\n",
6224
"runtimeDataModel": {
6325
"models": {},
6426
"enums": {},
6527
"types": {}
66-
},
67-
"dirname": ""
28+
}
6829
}
6930

7031
config.runtimeDataModel = JSON.parse("{\"models\":{\"User\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"email\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"}],\"dbName\":null}},\"enums\":{},\"types\":{}}")
71-
config.engineWasm = undefined
7232

7333
async function decodeBase64AsWasm(wasmBase64: string): Promise<WebAssembly.Module> {
7434
const { Buffer } = await import('node:buffer')
@@ -87,7 +47,6 @@ config.compilerWasm = {
8747

8848

8949

90-
9150
export type LogOptions<ClientOptions extends Prisma.PrismaClientOptions> =
9251
'log' extends keyof ClientOptions ? ClientOptions['log'] extends Array<Prisma.LogLevel | Prisma.LogDefinition> ? Prisma.GetEvents<ClientOptions['log']> : never : never
9352

@@ -111,7 +70,7 @@ export interface PrismaClientConstructor {
11170
LogOpts extends LogOptions<Options> = LogOptions<Options>,
11271
OmitOpts extends Prisma.PrismaClientOptions['omit'] = Options extends { omit: infer U } ? U : Prisma.PrismaClientOptions['omit'],
11372
ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs
114-
>(options?: Prisma.Subset<Options, Prisma.PrismaClientOptions> ): PrismaClient<LogOpts, OmitOpts, ExtArgs>
73+
>(options: Prisma.Subset<Options, Prisma.PrismaClientOptions> ): PrismaClient<LogOpts, OmitOpts, ExtArgs>
11574
}
11675

11776
/**
@@ -130,7 +89,7 @@ export interface PrismaClientConstructor {
13089

13190
export interface PrismaClient<
13291
in LogOpts extends Prisma.LogLevel = never,
133-
in out OmitOpts extends Prisma.PrismaClientOptions['omit'] = Prisma.PrismaClientOptions['omit'],
92+
in out OmitOpts extends Prisma.PrismaClientOptions['omit'] = undefined,
13493
in out ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs
13594
> {
13695
[K: symbol]: { types: Prisma.TypeMap<ExtArgs>['other'] }
@@ -211,7 +170,6 @@ export interface PrismaClient<
211170

212171
$transaction<R>(fn: (prisma: Omit<PrismaClient, runtime.ITXClientDenyList>) => runtime.Types.Utils.JsPromise<R>, options?: { maxWait?: number, timeout?: number, isolationLevel?: Prisma.TransactionIsolationLevel }): runtime.Types.Utils.JsPromise<R>
213172

214-
215173
$extends: runtime.Types.Extensions.ExtendsHook<"extends", Prisma.TypeMapCb<OmitOpts>, ExtArgs, runtime.Types.Utils.Call<Prisma.TypeMapCb<OmitOpts>, {
216174
extArgs: ExtArgs
217175
}>>
@@ -227,7 +185,6 @@ export interface PrismaClient<
227185
get user(): Prisma.UserDelegate<ExtArgs, { omit: OmitOpts }>;
228186
}
229187

230-
export function getPrismaClientClass(dirname: string): PrismaClientConstructor {
231-
config.dirname = dirname
188+
export function getPrismaClientClass(): PrismaClientConstructor {
232189
return runtime.getPrismaClient(config) as unknown as PrismaClientConstructor
233190
}

examples/driver/src/generated/prisma/internal/prismaNamespace.ts

Lines changed: 23 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
33
/* eslint-disable */
4+
// biome-ignore-all lint: generated file
45
// @ts-nocheck
56
/*
67
* WARNING: This is an internal file that is subject to change!
@@ -63,14 +64,6 @@ export type Decimal = runtime.Decimal
6364

6465
export type DecimalJsLike = runtime.DecimalJsLike
6566

66-
/**
67-
* Metrics
68-
*/
69-
export type Metrics = runtime.Metrics
70-
export type Metric<T> = runtime.Metric<T>
71-
export type MetricHistogram = runtime.MetricHistogram
72-
export type MetricHistogramBucket = runtime.MetricHistogramBucket
73-
7467
/**
7568
* Extensions
7669
*/
@@ -87,51 +80,53 @@ export type PrismaVersion = {
8780
}
8881

8982
/**
90-
* Prisma Client JS version: 6.16.2
91-
* Query Engine version: 1c57fdcd7e44b29b9313256c76699e91c3ac3c43
83+
* Prisma Client JS version: 7.0.0
84+
* Query Engine version: 0c19ccc313cf9911a90d99d2ac2eb0280c76c513
9285
*/
9386
export const prismaVersion: PrismaVersion = {
94-
client: "6.16.2",
95-
engine: "1c57fdcd7e44b29b9313256c76699e91c3ac3c43"
87+
client: "7.0.0",
88+
engine: "0c19ccc313cf9911a90d99d2ac2eb0280c76c513"
9689
}
9790

9891
/**
9992
* Utility Types
10093
*/
10194

95+
export type Bytes = runtime.Bytes
10296
export type JsonObject = runtime.JsonObject
10397
export type JsonArray = runtime.JsonArray
10498
export type JsonValue = runtime.JsonValue
10599
export type InputJsonObject = runtime.InputJsonObject
106100
export type InputJsonArray = runtime.InputJsonArray
107101
export type InputJsonValue = runtime.InputJsonValue
108102

103+
109104
export const NullTypes = {
110-
DbNull: runtime.objectEnumValues.classes.DbNull as (new (secret: never) => typeof runtime.objectEnumValues.instances.DbNull),
111-
JsonNull: runtime.objectEnumValues.classes.JsonNull as (new (secret: never) => typeof runtime.objectEnumValues.instances.JsonNull),
112-
AnyNull: runtime.objectEnumValues.classes.AnyNull as (new (secret: never) => typeof runtime.objectEnumValues.instances.AnyNull),
105+
DbNull: runtime.NullTypes.DbNull as (new (secret: never) => typeof runtime.DbNull),
106+
JsonNull: runtime.NullTypes.JsonNull as (new (secret: never) => typeof runtime.JsonNull),
107+
AnyNull: runtime.NullTypes.AnyNull as (new (secret: never) => typeof runtime.AnyNull),
113108
}
114-
115109
/**
116110
* Helper for filtering JSON entries that have `null` on the database (empty on the db)
117111
*
118112
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
119113
*/
120-
export const DbNull = runtime.objectEnumValues.instances.DbNull
114+
export const DbNull = runtime.DbNull
121115

122116
/**
123117
* Helper for filtering JSON entries that have JSON `null` values (not empty on the db)
124118
*
125119
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
126120
*/
127-
export const JsonNull = runtime.objectEnumValues.instances.JsonNull
121+
export const JsonNull = runtime.JsonNull
128122

129123
/**
130124
* Helper for filtering JSON entries that are `Prisma.DbNull` or `Prisma.JsonNull`
131125
*
132126
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
133127
*/
134-
export const AnyNull = runtime.objectEnumValues.instances.AnyNull
128+
export const AnyNull = runtime.AnyNull
129+
135130

136131
type SelectAndInclude = {
137132
select: any
@@ -570,26 +565,22 @@ export type BatchPayload = {
570565
count: number
571566
}
572567

573-
574-
export type Datasource = {
575-
url?: string
576-
}
577-
export type Datasources = {
578-
db?: Datasource
579-
}
580-
581568
export const defineExtension = runtime.Extensions.defineExtension as unknown as runtime.Types.Extensions.ExtendsHook<"define", TypeMapCb, runtime.Types.Extensions.DefaultArgs>
582569
export type DefaultPrismaClient = PrismaClient
583570
export type ErrorFormat = 'pretty' | 'colorless' | 'minimal'
584-
export interface PrismaClientOptions {
571+
export type PrismaClientOptions = ({
585572
/**
586-
* Overwrites the datasource url from your schema.prisma file
573+
* Instance of a Driver Adapter, e.g., like one provided by `@prisma/adapter-pg`.
587574
*/
588-
datasources?: Datasources
575+
adapter: runtime.SqlDriverAdapterFactory
576+
accelerateUrl?: never
577+
} | {
589578
/**
590-
* Overwrites the datasource url from your schema.prisma file
579+
* Prisma Accelerate URL allowing the client to connect through Accelerate instead of a direct database.
591580
*/
592-
datasourceUrl?: string
581+
accelerateUrl: string
582+
adapter?: never
583+
}) & {
593584
/**
594585
* @default "colorless"
595586
*/
@@ -629,10 +620,6 @@ export interface PrismaClientOptions {
629620
timeout?: number
630621
isolationLevel?: TransactionIsolationLevel
631622
}
632-
/**
633-
* Instance of a Driver Adapter, e.g., like one provided by `@prisma/adapter-planetscale`
634-
*/
635-
adapter?: runtime.SqlDriverAdapterFactory | null
636623
/**
637624
* Global configuration for omitting model fields by default.
638625
*

0 commit comments

Comments
 (0)