@veloxts/orm 0.4.13 → 0.6.23
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 +2 -46
- package/dist/client.d.ts +1 -1
- package/dist/client.js +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -9
- package/dist/index.js.map +1 -1
- package/dist/plugin.d.ts +7 -30
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +5 -28
- package/dist/plugin.js.map +1 -1
- package/dist/types.d.ts +3 -3
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,52 +1,8 @@
|
|
|
1
1
|
# @veloxts/orm
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
> **Early Preview (v0.6.x)** - APIs are stabilizing but may still change. Use with caution in production.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Prisma ORM integration package for the VeloxTS Framework, providing enhanced developer experience for database operations.
|
|
8
|
-
|
|
9
|
-
## Part of @veloxts/velox
|
|
10
|
-
|
|
11
|
-
This package is part of the VeloxTS Framework. For the complete framework experience, install:
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
npm install @veloxts/velox
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
Visit [@veloxts/velox](https://www.npmjs.com/package/@veloxts/velox) for the complete framework documentation.
|
|
18
|
-
|
|
19
|
-
## Standalone Installation
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
npm install @veloxts/orm @prisma/client
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
Note: `@prisma/client` is a peer dependency. You'll also need the `prisma` CLI as a dev dependency.
|
|
26
|
-
|
|
27
|
-
## Documentation
|
|
28
|
-
|
|
29
|
-
For detailed documentation, usage examples, and API reference, see [GUIDE.md](./GUIDE.md).
|
|
30
|
-
|
|
31
|
-
## Quick Example
|
|
32
|
-
|
|
33
|
-
```typescript
|
|
34
|
-
import { veloxApp } from '@veloxts/core';
|
|
35
|
-
import { createDatabasePlugin } from '@veloxts/orm';
|
|
36
|
-
import { PrismaClient } from '@prisma/client';
|
|
37
|
-
|
|
38
|
-
const prisma = new PrismaClient();
|
|
39
|
-
const app = await veloxApp({ port: 3210 });
|
|
40
|
-
|
|
41
|
-
await app.register(createDatabasePlugin({ client: prisma }));
|
|
42
|
-
await app.start();
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
## Learn More
|
|
46
|
-
|
|
47
|
-
- [Full Documentation](./GUIDE.md)
|
|
48
|
-
- [VeloxTS Framework](https://www.npmjs.com/package/@veloxts/velox)
|
|
49
|
-
- [GitHub Repository](https://github.com/veloxts/velox-ts-framework)
|
|
5
|
+
Prisma ORM integration for VeloxTS Framework - provides database plugin with connection lifecycle management and context integration. Learn more at [@veloxts/velox](https://www.npmjs.com/package/@veloxts/velox).
|
|
50
6
|
|
|
51
7
|
## License
|
|
52
8
|
|
package/dist/client.d.ts
CHANGED
|
@@ -73,7 +73,7 @@ export interface Database<TClient extends DatabaseClient> {
|
|
|
73
73
|
* - Type-safe access to the underlying client
|
|
74
74
|
*
|
|
75
75
|
* The client is NOT automatically connected - call `connect()` explicitly
|
|
76
|
-
* or use `
|
|
76
|
+
* or use `databasePlugin` for automatic lifecycle management.
|
|
77
77
|
*
|
|
78
78
|
* @template TClient - Type of the Prisma client
|
|
79
79
|
* @param config - Database configuration with client instance
|
package/dist/client.js
CHANGED
|
@@ -17,7 +17,7 @@ import { isDatabaseClient } from './types.js';
|
|
|
17
17
|
* - Type-safe access to the underlying client
|
|
18
18
|
*
|
|
19
19
|
* The client is NOT automatically connected - call `connect()` explicitly
|
|
20
|
-
* or use `
|
|
20
|
+
* or use `databasePlugin` for automatic lifecycle management.
|
|
21
21
|
*
|
|
22
22
|
* @template TClient - Type of the Prisma client
|
|
23
23
|
* @param config - Database configuration with client instance
|
package/dist/index.d.ts
CHANGED
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
* @example
|
|
10
10
|
* ```typescript
|
|
11
11
|
* // Setup
|
|
12
|
-
* import {
|
|
12
|
+
* import { veloxApp } from '@veloxts/core';
|
|
13
13
|
* import { PrismaClient } from '@prisma/client';
|
|
14
|
-
* import {
|
|
14
|
+
* import { databasePlugin } from '@veloxts/orm';
|
|
15
15
|
*
|
|
16
16
|
* const prisma = new PrismaClient();
|
|
17
|
-
* const app = await
|
|
17
|
+
* const app = await veloxApp({ port: 3030 });
|
|
18
18
|
*
|
|
19
|
-
* await app.use(
|
|
19
|
+
* await app.use(databasePlugin({ client: prisma }));
|
|
20
20
|
* await app.start();
|
|
21
21
|
* ```
|
|
22
22
|
*
|
|
@@ -74,7 +74,7 @@ export {
|
|
|
74
74
|
* Create a database wrapper with connection lifecycle management
|
|
75
75
|
*
|
|
76
76
|
* Use this for manual connection management. For automatic lifecycle
|
|
77
|
-
* management with VeloxApp, use `
|
|
77
|
+
* management with VeloxApp, use `databasePlugin` instead.
|
|
78
78
|
*
|
|
79
79
|
* @example
|
|
80
80
|
* ```typescript
|
|
@@ -87,7 +87,7 @@ export {
|
|
|
87
87
|
* ```
|
|
88
88
|
*/
|
|
89
89
|
createDatabase, } from './client.js';
|
|
90
|
-
export {
|
|
90
|
+
export {
|
|
91
91
|
/**
|
|
92
92
|
* Create a database plugin for VeloxApp integration
|
|
93
93
|
*
|
|
@@ -104,7 +104,7 @@ export { createDatabasePlugin,
|
|
|
104
104
|
* import { databasePlugin } from '@veloxts/orm';
|
|
105
105
|
*
|
|
106
106
|
* const prisma = new PrismaClient();
|
|
107
|
-
* const app = await veloxApp({ port:
|
|
107
|
+
* const app = await veloxApp({ port: 3030 });
|
|
108
108
|
*
|
|
109
109
|
* await app.register(databasePlugin({ client: prisma }));
|
|
110
110
|
* await app.start();
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAYH,0BAA0B;AAC1B,eAAO,MAAM,WAAW,EAAE,MAA+C,CAAC;AAM1E,YAAY;AACV;;GAEG;AACH,eAAe;AACf;;GAEG;AACH,gBAAgB;AAChB;;GAEG;AACH,cAAc;AACd;;GAEG;AACH,qBAAqB;AACrB;;GAEG;AACH,eAAe;AACf;;GAEG;AACH,mBAAmB;AACnB;;GAEG;AACH,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAM9C,YAAY;AACV;;GAEG;AACH,QAAQ,GACT,MAAM,aAAa,CAAC;AACrB,OAAO;AACL;;;;;;;;;;;;;;;GAeG;AACH,cAAc,GACf,MAAM,aAAa,CAAC;AAMrB,OAAO
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAYH,0BAA0B;AAC1B,eAAO,MAAM,WAAW,EAAE,MAA+C,CAAC;AAM1E,YAAY;AACV;;GAEG;AACH,eAAe;AACf;;GAEG;AACH,gBAAgB;AAChB;;GAEG;AACH,cAAc;AACd;;GAEG;AACH,qBAAqB;AACrB;;GAEG;AACH,eAAe;AACf;;GAEG;AACH,mBAAmB;AACnB;;GAEG;AACH,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAM9C,YAAY;AACV;;GAEG;AACH,QAAQ,GACT,MAAM,aAAa,CAAC;AACrB,OAAO;AACL;;;;;;;;;;;;;;;GAeG;AACH,cAAc,GACf,MAAM,aAAa,CAAC;AAMrB,OAAO;AACL;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,cAAc,GACf,MAAM,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
* @example
|
|
10
10
|
* ```typescript
|
|
11
11
|
* // Setup
|
|
12
|
-
* import {
|
|
12
|
+
* import { veloxApp } from '@veloxts/core';
|
|
13
13
|
* import { PrismaClient } from '@prisma/client';
|
|
14
|
-
* import {
|
|
14
|
+
* import { databasePlugin } from '@veloxts/orm';
|
|
15
15
|
*
|
|
16
16
|
* const prisma = new PrismaClient();
|
|
17
|
-
* const app = await
|
|
17
|
+
* const app = await veloxApp({ port: 3030 });
|
|
18
18
|
*
|
|
19
|
-
* await app.use(
|
|
19
|
+
* await app.use(databasePlugin({ client: prisma }));
|
|
20
20
|
* await app.start();
|
|
21
21
|
* ```
|
|
22
22
|
*
|
|
@@ -47,7 +47,7 @@ export {
|
|
|
47
47
|
* Create a database wrapper with connection lifecycle management
|
|
48
48
|
*
|
|
49
49
|
* Use this for manual connection management. For automatic lifecycle
|
|
50
|
-
* management with VeloxApp, use `
|
|
50
|
+
* management with VeloxApp, use `databasePlugin` instead.
|
|
51
51
|
*
|
|
52
52
|
* @example
|
|
53
53
|
* ```typescript
|
|
@@ -64,8 +64,6 @@ createDatabase, } from './client.js';
|
|
|
64
64
|
// Plugin
|
|
65
65
|
// ============================================================================
|
|
66
66
|
export {
|
|
67
|
-
// Legacy (deprecated)
|
|
68
|
-
createDatabasePlugin,
|
|
69
67
|
/**
|
|
70
68
|
* Create a database plugin for VeloxApp integration
|
|
71
69
|
*
|
|
@@ -82,12 +80,11 @@ createDatabasePlugin,
|
|
|
82
80
|
* import { databasePlugin } from '@veloxts/orm';
|
|
83
81
|
*
|
|
84
82
|
* const prisma = new PrismaClient();
|
|
85
|
-
* const app = await veloxApp({ port:
|
|
83
|
+
* const app = await veloxApp({ port: 3030 });
|
|
86
84
|
*
|
|
87
85
|
* await app.register(databasePlugin({ client: prisma }));
|
|
88
86
|
* await app.start();
|
|
89
87
|
* ```
|
|
90
88
|
*/
|
|
91
|
-
// Succinct API (preferred)
|
|
92
89
|
databasePlugin, } from './plugin.js';
|
|
93
90
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,+EAA+E;AAC/E,UAAU;AACV,+EAA+E;AAE/E,6CAA6C;AAC7C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,WAAW,GAAG,OAAO,CAAC,iBAAiB,CAAwB,CAAC;AAEtE,0BAA0B;AAC1B,MAAM,CAAC,MAAM,WAAW,GAAW,WAAW,CAAC,OAAO,IAAI,eAAe,CAAC;AAoC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAY9C,OAAO;AACL;;;;;;;;;;;;;;;GAeG;AACH,cAAc,GACf,MAAM,aAAa,CAAC;AAErB,+EAA+E;AAC/E,SAAS;AACT,+EAA+E;AAE/E,OAAO;AACL
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,+EAA+E;AAC/E,UAAU;AACV,+EAA+E;AAE/E,6CAA6C;AAC7C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,WAAW,GAAG,OAAO,CAAC,iBAAiB,CAAwB,CAAC;AAEtE,0BAA0B;AAC1B,MAAM,CAAC,MAAM,WAAW,GAAW,WAAW,CAAC,OAAO,IAAI,eAAe,CAAC;AAoC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAY9C,OAAO;AACL;;;;;;;;;;;;;;;GAeG;AACH,cAAc,GACf,MAAM,aAAa,CAAC;AAErB,+EAA+E;AAC/E,SAAS;AACT,+EAA+E;AAE/E,OAAO;AACL;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,cAAc,GACf,MAAM,aAAa,CAAC"}
|
package/dist/plugin.d.ts
CHANGED
|
@@ -17,10 +17,10 @@ import type { DatabaseClient, OrmPluginConfig } from './types.js';
|
|
|
17
17
|
* ```typescript
|
|
18
18
|
* // In your app setup
|
|
19
19
|
* import { PrismaClient } from '@prisma/client';
|
|
20
|
-
* import {
|
|
20
|
+
* import { databasePlugin } from '@veloxts/orm';
|
|
21
21
|
*
|
|
22
22
|
* const prisma = new PrismaClient();
|
|
23
|
-
* await app.use(
|
|
23
|
+
* await app.use(databasePlugin({ client: prisma }));
|
|
24
24
|
*
|
|
25
25
|
* // In your procedure handlers
|
|
26
26
|
* getUser: procedure()
|
|
@@ -74,15 +74,15 @@ declare module '@veloxts/core' {
|
|
|
74
74
|
*
|
|
75
75
|
* @example
|
|
76
76
|
* ```typescript
|
|
77
|
-
* import {
|
|
77
|
+
* import { veloxApp } from '@veloxts/core';
|
|
78
78
|
* import { PrismaClient } from '@prisma/client';
|
|
79
|
-
* import {
|
|
79
|
+
* import { databasePlugin } from '@veloxts/orm';
|
|
80
80
|
*
|
|
81
81
|
* const prisma = new PrismaClient();
|
|
82
|
-
* const app = await
|
|
82
|
+
* const app = await veloxApp({ port: 3030 });
|
|
83
83
|
*
|
|
84
84
|
* // Register the database plugin
|
|
85
|
-
* await app.use(
|
|
85
|
+
* await app.use(databasePlugin({ client: prisma }));
|
|
86
86
|
*
|
|
87
87
|
* // Start the app (database connects automatically)
|
|
88
88
|
* await app.start();
|
|
@@ -113,28 +113,5 @@ declare module '@veloxts/core' {
|
|
|
113
113
|
* });
|
|
114
114
|
* ```
|
|
115
115
|
*/
|
|
116
|
-
export declare function
|
|
117
|
-
/**
|
|
118
|
-
* Creates a database plugin for VeloxApp integration (succinct API)
|
|
119
|
-
*
|
|
120
|
-
* This is the preferred, shorter form of `createDatabasePlugin`.
|
|
121
|
-
*
|
|
122
|
-
* @template TClient - Type of the Prisma client
|
|
123
|
-
* @param config - Plugin configuration with Prisma client
|
|
124
|
-
* @returns A VeloxPlugin that can be registered with `app.register()`
|
|
125
|
-
*
|
|
126
|
-
* @example
|
|
127
|
-
* ```typescript
|
|
128
|
-
* import { veloxApp } from '@veloxts/core';
|
|
129
|
-
* import { PrismaClient } from '@prisma/client';
|
|
130
|
-
* import { databasePlugin } from '@veloxts/orm';
|
|
131
|
-
*
|
|
132
|
-
* const prisma = new PrismaClient();
|
|
133
|
-
* const app = await veloxApp({ port: 3210 });
|
|
134
|
-
*
|
|
135
|
-
* await app.register(databasePlugin({ client: prisma }));
|
|
136
|
-
* await app.start();
|
|
137
|
-
* ```
|
|
138
|
-
*/
|
|
139
|
-
export declare const databasePlugin: typeof createDatabasePlugin;
|
|
116
|
+
export declare function databasePlugin<TClient extends DatabaseClient>(config: OrmPluginConfig<TClient>): import("@veloxts/core").VeloxPlugin<import("fastify").FastifyPluginOptions>;
|
|
140
117
|
//# sourceMappingURL=plugin.d.ts.map
|
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAOlE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,OAAO,QAAQ,eAAe,CAAC;IAC7B,UAAU,WAAW;QACnB;;;;;WAKG;QACH,EAAE,EAAE,cAAc,CAAC;KACpB;CACF;AA0BD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,wBAAgB,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAOlE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,OAAO,QAAQ,eAAe,CAAC;IAC7B,UAAU,WAAW;QACnB;;;;;WAKG;QACH,EAAE,EAAE,cAAc,CAAC;KACpB;CACF;AA0BD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,wBAAgB,cAAc,CAAC,OAAO,SAAS,cAAc,EAAE,MAAM,EAAE,eAAe,CAAC,OAAO,CAAC,+EA0E9F"}
|
package/dist/plugin.js
CHANGED
|
@@ -37,15 +37,15 @@ const DEFAULT_PLUGIN_NAME = '@veloxts/orm';
|
|
|
37
37
|
*
|
|
38
38
|
* @example
|
|
39
39
|
* ```typescript
|
|
40
|
-
* import {
|
|
40
|
+
* import { veloxApp } from '@veloxts/core';
|
|
41
41
|
* import { PrismaClient } from '@prisma/client';
|
|
42
|
-
* import {
|
|
42
|
+
* import { databasePlugin } from '@veloxts/orm';
|
|
43
43
|
*
|
|
44
44
|
* const prisma = new PrismaClient();
|
|
45
|
-
* const app = await
|
|
45
|
+
* const app = await veloxApp({ port: 3030 });
|
|
46
46
|
*
|
|
47
47
|
* // Register the database plugin
|
|
48
|
-
* await app.use(
|
|
48
|
+
* await app.use(databasePlugin({ client: prisma }));
|
|
49
49
|
*
|
|
50
50
|
* // Start the app (database connects automatically)
|
|
51
51
|
* await app.start();
|
|
@@ -76,7 +76,7 @@ const DEFAULT_PLUGIN_NAME = '@veloxts/orm';
|
|
|
76
76
|
* });
|
|
77
77
|
* ```
|
|
78
78
|
*/
|
|
79
|
-
export function
|
|
79
|
+
export function databasePlugin(config) {
|
|
80
80
|
// Validate configuration at plugin creation time
|
|
81
81
|
if (!config || typeof config !== 'object') {
|
|
82
82
|
throw new ConfigurationError('Database plugin configuration is required');
|
|
@@ -135,27 +135,4 @@ export function createDatabasePlugin(config) {
|
|
|
135
135
|
},
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
|
-
/**
|
|
139
|
-
* Creates a database plugin for VeloxApp integration (succinct API)
|
|
140
|
-
*
|
|
141
|
-
* This is the preferred, shorter form of `createDatabasePlugin`.
|
|
142
|
-
*
|
|
143
|
-
* @template TClient - Type of the Prisma client
|
|
144
|
-
* @param config - Plugin configuration with Prisma client
|
|
145
|
-
* @returns A VeloxPlugin that can be registered with `app.register()`
|
|
146
|
-
*
|
|
147
|
-
* @example
|
|
148
|
-
* ```typescript
|
|
149
|
-
* import { veloxApp } from '@veloxts/core';
|
|
150
|
-
* import { PrismaClient } from '@prisma/client';
|
|
151
|
-
* import { databasePlugin } from '@veloxts/orm';
|
|
152
|
-
*
|
|
153
|
-
* const prisma = new PrismaClient();
|
|
154
|
-
* const app = await veloxApp({ port: 3210 });
|
|
155
|
-
*
|
|
156
|
-
* await app.register(databasePlugin({ client: prisma }));
|
|
157
|
-
* await app.start();
|
|
158
|
-
* ```
|
|
159
|
-
*/
|
|
160
|
-
export const databasePlugin = createDatabasePlugin;
|
|
161
138
|
//# sourceMappingURL=plugin.js.map
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAEjE,OAAO,EAAE,cAAc,EAAiB,MAAM,aAAa,CAAC;AAE5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAyD9C,+EAA+E;AAC/E,wBAAwB;AACxB,+EAA+E;AAE/E;;GAEG;AACH,MAAM,kBAAkB,GAAG,OAAO,CAAC;AAEnC;;GAEG;AACH,MAAM,mBAAmB,GAAG,cAAc,CAAC;AAY3C;;;;;;;;;;;;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AAC;YACH,CAAC,CAAC,CAAC;YAEH,8BAA8B;YAC9B,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,oBAAoB,UAAU,2BAA2B,CAAC,CAAC;QAC7E,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -34,14 +34,14 @@ export interface DatabaseClient {
|
|
|
34
34
|
/**
|
|
35
35
|
* Establishes connection to the database
|
|
36
36
|
*
|
|
37
|
-
* Called automatically when using
|
|
37
|
+
* Called automatically when using databasePlugin,
|
|
38
38
|
* or can be called manually with createDatabase.
|
|
39
39
|
*/
|
|
40
40
|
$connect: () => Promise<void>;
|
|
41
41
|
/**
|
|
42
42
|
* Disconnects from the database
|
|
43
43
|
*
|
|
44
|
-
* Called automatically during app shutdown when using
|
|
44
|
+
* Called automatically during app shutdown when using databasePlugin,
|
|
45
45
|
* or can be called manually with createDatabase.
|
|
46
46
|
*/
|
|
47
47
|
$disconnect: () => Promise<void>;
|
|
@@ -78,7 +78,7 @@ export interface OrmPluginConfig<TClient extends DatabaseClient> {
|
|
|
78
78
|
* @example
|
|
79
79
|
* ```typescript
|
|
80
80
|
* const prisma = new PrismaClient();
|
|
81
|
-
* const plugin =
|
|
81
|
+
* const plugin = databasePlugin({ client: prisma });
|
|
82
82
|
* ```
|
|
83
83
|
*/
|
|
84
84
|
client: TClient;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veloxts/orm",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.23",
|
|
4
4
|
"description": "Prisma wrapper with enhanced DX for VeloxTS framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -13,15 +13,15 @@
|
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"fastify": "5.6.2",
|
|
16
|
-
"@veloxts/core": "0.
|
|
16
|
+
"@veloxts/core": "0.6.23"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@vitest/coverage-v8": "4.0.
|
|
19
|
+
"@vitest/coverage-v8": "4.0.16",
|
|
20
20
|
"typescript": "5.9.3",
|
|
21
|
-
"vitest": "4.0.
|
|
21
|
+
"vitest": "4.0.16"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"@prisma/client": ">=
|
|
24
|
+
"@prisma/client": ">=7.0.0"
|
|
25
25
|
},
|
|
26
26
|
"peerDependenciesMeta": {
|
|
27
27
|
"@prisma/client": {
|