@dismissible/nestjs-postgres-storage 0.0.2-canary.c91edbc.0 → 0.0.2-canary.d2f56d7.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 +108 -10
- package/bin/dismissible-prisma.js +4 -2
- package/package.json +13 -5
- package/prisma/generated/prisma/commonInputTypes.ts +0 -75
- package/prisma/generated/prisma/internal/class.ts +2 -2
- package/prisma/generated/prisma/internal/prismaNamespace.ts +1 -33
- package/prisma/generated/prisma/internal/prismaNamespaceBrowser.ts +1 -19
- package/prisma/generated/prisma/models/DismissibleItem.ts +1 -23
- package/prisma/migrations/20251219094936_init/migration.sql +12 -0
- package/prisma/migrations/migration_lock.toml +3 -0
- package/prisma/schema.prisma +0 -1
- package/prisma.config.mjs +35 -0
- package/src/index.ts +1 -0
- package/src/postgres-storage.adapter.spec.ts +0 -85
- package/src/postgres-storage.adapter.ts +6 -17
- package/src/postgres-storage.module.ts +2 -2
- package/src/prisma-config.spec.ts +93 -0
- package/src/prisma-config.ts +63 -0
- package/src/prisma.service.spec.ts +131 -0
- package/src/schema-path.spec.ts +24 -0
- package/src/schema-path.ts +3 -3
- package/jest.config.ts +0 -10
- package/project.json +0 -73
- package/tsconfig.json +0 -13
- package/tsconfig.lib.json +0 -14
package/README.md
CHANGED
|
@@ -40,28 +40,60 @@ First, set up your PostgreSQL database connection string:
|
|
|
40
40
|
DISMISSIBLE_POSTGRES_STORAGE_CONNECTION_STRING=postgresql://user:password@localhost:5432/dismissible
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
### 2. Database
|
|
43
|
+
### 2. Initialize Database Schema
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
**⚠️ CRITICAL**: You must initialize the database schema before using the storage module. The API will fail to start if the database tables don't exist.
|
|
46
|
+
|
|
47
|
+
#### Option A: Using the CLI Tool (Recommended)
|
|
48
|
+
|
|
49
|
+
The package includes a CLI helper that automatically uses the correct schema path:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# Step 1: Generate Prisma Client (required before migrations)
|
|
53
|
+
npx dismissible-prisma generate
|
|
54
|
+
|
|
55
|
+
# Step 2: Initialize the database schema
|
|
56
|
+
# For development (creates migration files):
|
|
57
|
+
npx dismissible-prisma migrate dev --name init
|
|
58
|
+
|
|
59
|
+
# For production (applies existing migrations):
|
|
60
|
+
npx dismissible-prisma migrate deploy
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
#### Option B: Using Prisma Directly
|
|
64
|
+
|
|
65
|
+
If you prefer using Prisma directly, specify the schema path:
|
|
46
66
|
|
|
47
67
|
```bash
|
|
48
68
|
# Generate Prisma client
|
|
49
69
|
npx prisma generate --schema=node_modules/@dismissible/nestjs-postgres-storage/prisma/schema.prisma
|
|
50
70
|
|
|
51
|
-
#
|
|
52
|
-
npx prisma
|
|
71
|
+
# For development: Create and apply migrations
|
|
72
|
+
npx prisma migrate dev --schema=node_modules/@dismissible/nestjs-postgres-storage/prisma/schema.prisma --name init
|
|
53
73
|
|
|
54
|
-
#
|
|
55
|
-
npx prisma migrate
|
|
74
|
+
# For production: Apply existing migrations
|
|
75
|
+
npx prisma migrate deploy --schema=node_modules/@dismissible/nestjs-postgres-storage/prisma/schema.prisma
|
|
56
76
|
```
|
|
57
77
|
|
|
58
|
-
|
|
78
|
+
#### Quick Development Setup (Not for Production)
|
|
79
|
+
|
|
80
|
+
For rapid development, you can use `db push` (⚠️ development only, may cause data loss):
|
|
59
81
|
|
|
60
82
|
```bash
|
|
83
|
+
# Generate client
|
|
61
84
|
npx dismissible-prisma generate
|
|
62
|
-
|
|
85
|
+
|
|
86
|
+
# Push schema without migrations
|
|
87
|
+
npx dismissible-prisma db push
|
|
63
88
|
```
|
|
64
89
|
|
|
90
|
+
> 💡 **Migration Commands Explained**:
|
|
91
|
+
>
|
|
92
|
+
> - `migrate dev` - Creates migration files and applies them (use when schema changes)
|
|
93
|
+
> - `migrate deploy` - Applies existing migrations (use in production, CI/CD, or fresh database setup)
|
|
94
|
+
> - `db push` - Syncs schema without migrations (development only, not version-controlled)
|
|
95
|
+
> - `generate` - Generates Prisma Client (required before using the storage module)
|
|
96
|
+
|
|
65
97
|
### 3. Module Configuration
|
|
66
98
|
|
|
67
99
|
Import and configure the module in your NestJS application:
|
|
@@ -181,20 +213,86 @@ npx dismissible-prisma db push
|
|
|
181
213
|
npx dismissible-prisma studio
|
|
182
214
|
```
|
|
183
215
|
|
|
216
|
+
The CLI automatically uses the bundled Prisma configuration, so you don't need to create your own `prisma.config.mjs` file.
|
|
217
|
+
|
|
218
|
+
## Prisma v7 Configuration
|
|
219
|
+
|
|
220
|
+
This package is compatible with Prisma v7+ which uses a configuration file (`prisma.config.ts` or `prisma.config.mjs`) for datasource configuration.
|
|
221
|
+
|
|
222
|
+
### Zero-Config Approach (Recommended)
|
|
223
|
+
|
|
224
|
+
Simply use the CLI tool - it handles all configuration automatically:
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
npx dismissible-prisma migrate dev
|
|
228
|
+
npx dismissible-prisma generate
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### Custom Configuration
|
|
232
|
+
|
|
233
|
+
If you need to customize the Prisma configuration (e.g., add seeding), create your own `prisma.config.mjs` and import from this package:
|
|
234
|
+
|
|
235
|
+
```javascript
|
|
236
|
+
// prisma.config.mjs
|
|
237
|
+
import { defineConfig } from 'prisma/config';
|
|
238
|
+
import { basePrismaConfig } from '@dismissible/nestjs-postgres-storage';
|
|
239
|
+
|
|
240
|
+
export default defineConfig(basePrismaConfig);
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
### Extending the Configuration
|
|
244
|
+
|
|
245
|
+
You can extend the base configuration with additional options:
|
|
246
|
+
|
|
247
|
+
```javascript
|
|
248
|
+
// prisma.config.mjs
|
|
249
|
+
import { defineConfig } from 'prisma/config';
|
|
250
|
+
import { basePrismaConfig } from '@dismissible/nestjs-postgres-storage';
|
|
251
|
+
|
|
252
|
+
export default defineConfig({
|
|
253
|
+
...basePrismaConfig,
|
|
254
|
+
migrations: {
|
|
255
|
+
...basePrismaConfig.migrations,
|
|
256
|
+
seed: 'tsx prisma/seed.ts',
|
|
257
|
+
},
|
|
258
|
+
});
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### Programmatic Access
|
|
262
|
+
|
|
263
|
+
For advanced use cases, you can also use the config factory:
|
|
264
|
+
|
|
265
|
+
```typescript
|
|
266
|
+
import { createPrismaConfig, basePrismaConfig } from '@dismissible/nestjs-postgres-storage';
|
|
267
|
+
|
|
268
|
+
// Get the base config object
|
|
269
|
+
console.log(basePrismaConfig.schema);
|
|
270
|
+
|
|
271
|
+
// Or create a fresh config
|
|
272
|
+
const config = createPrismaConfig();
|
|
273
|
+
```
|
|
274
|
+
|
|
184
275
|
## Environment Variables
|
|
185
276
|
|
|
186
|
-
- `
|
|
277
|
+
- `DATABASE_URL` - PostgreSQL connection string (standard Prisma convention)
|
|
278
|
+
- `DISMISSIBLE_POSTGRES_STORAGE_CONNECTION_STRING` - Alternative PostgreSQL connection string (fallback if `DATABASE_URL` is not set)
|
|
187
279
|
|
|
188
280
|
## Production Considerations
|
|
189
281
|
|
|
190
282
|
1. **Connection Pooling**: The adapter uses `pg` connection pooling. Configure your pool size based on your application's needs.
|
|
191
283
|
|
|
192
|
-
2. **Migrations**: Always use Prisma migrations in production:
|
|
284
|
+
2. **Migrations**: Always use Prisma migrations in production. Run migrations before starting your application:
|
|
193
285
|
|
|
194
286
|
```bash
|
|
287
|
+
# Using the CLI helper (recommended)
|
|
288
|
+
npx dismissible-prisma migrate deploy
|
|
289
|
+
|
|
290
|
+
# Or using Prisma directly
|
|
195
291
|
npx prisma migrate deploy --schema=node_modules/@dismissible/nestjs-postgres-storage/prisma/schema.prisma
|
|
196
292
|
```
|
|
197
293
|
|
|
294
|
+
> ⚠️ **Critical**: The database schema must be initialized before your application starts. The storage adapter will fail if tables don't exist.
|
|
295
|
+
|
|
198
296
|
3. **Monitoring**: Monitor database connections and query performance.
|
|
199
297
|
|
|
200
298
|
4. **Backups**: Ensure regular database backups are in place.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* CLI helper for @dismissible/nestjs-postgres-storage
|
|
5
|
-
* Runs Prisma commands with the correct schema
|
|
5
|
+
* Runs Prisma commands with the correct schema and config paths.
|
|
6
6
|
*
|
|
7
7
|
* Usage:
|
|
8
8
|
* npx dismissible-prisma generate
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
const { execSync } = require('child_process');
|
|
16
16
|
const path = require('path');
|
|
17
17
|
|
|
18
|
+
const configPath = path.join(__dirname, '..', 'prisma.config.mjs');
|
|
18
19
|
const schemaPath = path.join(__dirname, '..', 'prisma', 'schema.prisma');
|
|
19
20
|
const args = process.argv.slice(2);
|
|
20
21
|
|
|
@@ -39,12 +40,13 @@ Examples:
|
|
|
39
40
|
npx dismissible-prisma migrate dev --name init
|
|
40
41
|
npx dismissible-prisma db push
|
|
41
42
|
|
|
43
|
+
Config location: ${configPath}
|
|
42
44
|
Schema location: ${schemaPath}
|
|
43
45
|
`);
|
|
44
46
|
process.exit(0);
|
|
45
47
|
}
|
|
46
48
|
|
|
47
|
-
const command = `npx prisma ${args.join(' ')} --
|
|
49
|
+
const command = `npx prisma ${args.join(' ')} --config="${configPath}"`;
|
|
48
50
|
|
|
49
51
|
console.log(`Running: ${command}\n`);
|
|
50
52
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dismissible/nestjs-postgres-storage",
|
|
3
|
-
"version": "0.0.2-canary.
|
|
3
|
+
"version": "0.0.2-canary.d2f56d7.0",
|
|
4
4
|
"description": "PostgreSQL storage adapter for Dismissible using Prisma",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"types": "./src/index.d.ts",
|
|
@@ -13,16 +13,24 @@
|
|
|
13
13
|
"require": "./src/index.js",
|
|
14
14
|
"types": "./src/index.d.ts"
|
|
15
15
|
},
|
|
16
|
-
"./prisma/schema.prisma": "./prisma/schema.prisma"
|
|
16
|
+
"./prisma/schema.prisma": "./prisma/schema.prisma",
|
|
17
|
+
"./prisma.config": "./prisma.config.mjs"
|
|
17
18
|
},
|
|
18
19
|
"prisma": {
|
|
19
20
|
"schema": "prisma/schema.prisma"
|
|
20
21
|
},
|
|
22
|
+
"files": [
|
|
23
|
+
"src",
|
|
24
|
+
"bin",
|
|
25
|
+
"prisma",
|
|
26
|
+
"prisma.config.mjs",
|
|
27
|
+
"README.md"
|
|
28
|
+
],
|
|
21
29
|
"peerDependencies": {
|
|
22
30
|
"@nestjs/common": "^11.0.0",
|
|
23
|
-
"@dismissible/nestjs-storage": "^0.0.2-canary.
|
|
24
|
-
"@dismissible/nestjs-dismissible-item": "^0.0.2-canary.
|
|
25
|
-
"@dismissible/nestjs-logger": "^0.0.2-canary.
|
|
31
|
+
"@dismissible/nestjs-storage": "^0.0.2-canary.d2f56d7.0",
|
|
32
|
+
"@dismissible/nestjs-dismissible-item": "^0.0.2-canary.d2f56d7.0",
|
|
33
|
+
"@dismissible/nestjs-logger": "^0.0.2-canary.d2f56d7.0",
|
|
26
34
|
"prisma": "^7.0.0"
|
|
27
35
|
},
|
|
28
36
|
"peerDependenciesMeta": {
|
|
@@ -51,30 +51,6 @@ export type DateTimeNullableFilter<$PrismaModel = never> = {
|
|
|
51
51
|
not?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
export type JsonNullableFilter<$PrismaModel = never> =
|
|
55
|
-
| Prisma.PatchUndefined<
|
|
56
|
-
Prisma.Either<Required<JsonNullableFilterBase<$PrismaModel>>, Exclude<keyof Required<JsonNullableFilterBase<$PrismaModel>>, 'path'>>,
|
|
57
|
-
Required<JsonNullableFilterBase<$PrismaModel>>
|
|
58
|
-
>
|
|
59
|
-
| Prisma.OptionalFlat<Omit<Required<JsonNullableFilterBase<$PrismaModel>>, 'path'>>
|
|
60
|
-
|
|
61
|
-
export type JsonNullableFilterBase<$PrismaModel = never> = {
|
|
62
|
-
equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
|
63
|
-
path?: string[]
|
|
64
|
-
mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel>
|
|
65
|
-
string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
|
66
|
-
string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
|
67
|
-
string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
|
68
|
-
array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
|
69
|
-
array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
|
70
|
-
array_contains?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
|
71
|
-
lt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
|
72
|
-
lte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
|
73
|
-
gt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
|
74
|
-
gte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
|
75
|
-
not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
|
76
|
-
}
|
|
77
|
-
|
|
78
54
|
export type SortOrderInput = {
|
|
79
55
|
sort: Prisma.SortOrder
|
|
80
56
|
nulls?: Prisma.NullsOrder
|
|
@@ -126,33 +102,6 @@ export type DateTimeNullableWithAggregatesFilter<$PrismaModel = never> = {
|
|
|
126
102
|
_max?: Prisma.NestedDateTimeNullableFilter<$PrismaModel>
|
|
127
103
|
}
|
|
128
104
|
|
|
129
|
-
export type JsonNullableWithAggregatesFilter<$PrismaModel = never> =
|
|
130
|
-
| Prisma.PatchUndefined<
|
|
131
|
-
Prisma.Either<Required<JsonNullableWithAggregatesFilterBase<$PrismaModel>>, Exclude<keyof Required<JsonNullableWithAggregatesFilterBase<$PrismaModel>>, 'path'>>,
|
|
132
|
-
Required<JsonNullableWithAggregatesFilterBase<$PrismaModel>>
|
|
133
|
-
>
|
|
134
|
-
| Prisma.OptionalFlat<Omit<Required<JsonNullableWithAggregatesFilterBase<$PrismaModel>>, 'path'>>
|
|
135
|
-
|
|
136
|
-
export type JsonNullableWithAggregatesFilterBase<$PrismaModel = never> = {
|
|
137
|
-
equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
|
138
|
-
path?: string[]
|
|
139
|
-
mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel>
|
|
140
|
-
string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
|
141
|
-
string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
|
142
|
-
string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
|
143
|
-
array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
|
144
|
-
array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
|
145
|
-
array_contains?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
|
146
|
-
lt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
|
147
|
-
lte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
|
148
|
-
gt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
|
149
|
-
gte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
|
150
|
-
not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
|
151
|
-
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
|
|
152
|
-
_min?: Prisma.NestedJsonNullableFilter<$PrismaModel>
|
|
153
|
-
_max?: Prisma.NestedJsonNullableFilter<$PrismaModel>
|
|
154
|
-
}
|
|
155
|
-
|
|
156
105
|
export type NestedStringFilter<$PrismaModel = never> = {
|
|
157
106
|
equals?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
|
158
107
|
in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel>
|
|
@@ -256,28 +205,4 @@ export type NestedIntNullableFilter<$PrismaModel = never> = {
|
|
|
256
205
|
not?: Prisma.NestedIntNullableFilter<$PrismaModel> | number | null
|
|
257
206
|
}
|
|
258
207
|
|
|
259
|
-
export type NestedJsonNullableFilter<$PrismaModel = never> =
|
|
260
|
-
| Prisma.PatchUndefined<
|
|
261
|
-
Prisma.Either<Required<NestedJsonNullableFilterBase<$PrismaModel>>, Exclude<keyof Required<NestedJsonNullableFilterBase<$PrismaModel>>, 'path'>>,
|
|
262
|
-
Required<NestedJsonNullableFilterBase<$PrismaModel>>
|
|
263
|
-
>
|
|
264
|
-
| Prisma.OptionalFlat<Omit<Required<NestedJsonNullableFilterBase<$PrismaModel>>, 'path'>>
|
|
265
|
-
|
|
266
|
-
export type NestedJsonNullableFilterBase<$PrismaModel = never> = {
|
|
267
|
-
equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
|
268
|
-
path?: string[]
|
|
269
|
-
mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel>
|
|
270
|
-
string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
|
271
|
-
string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
|
272
|
-
string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
|
273
|
-
array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
|
274
|
-
array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
|
275
|
-
array_contains?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
|
276
|
-
lt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
|
277
|
-
lte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
|
278
|
-
gt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
|
279
|
-
gte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
|
280
|
-
not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
|
281
|
-
}
|
|
282
|
-
|
|
283
208
|
|
|
@@ -20,7 +20,7 @@ const config: runtime.GetPrismaClientConfig = {
|
|
|
20
20
|
"clientVersion": "7.1.0",
|
|
21
21
|
"engineVersion": "ab635e6b9d606fa5c8fb8b1a7f909c3c3c1c98ba",
|
|
22
22
|
"activeProvider": "postgresql",
|
|
23
|
-
"inlineSchema": "// Prisma schema for Dismissible PostgreSQL storage\n// https://pris.ly/d/prisma-schema\n\ngenerator client {\n provider = \"prisma-client\"\n output = \"./generated/prisma\"\n}\n\ndatasource db {\n provider = \"postgresql\"\n}\n\nmodel DismissibleItem {\n id String\n userId String @map(\"user_id\")\n createdAt DateTime @default(now()) @map(\"created_at\")\n dismissedAt DateTime? @map(\"dismissed_at\")\n
|
|
23
|
+
"inlineSchema": "// Prisma schema for Dismissible PostgreSQL storage\n// https://pris.ly/d/prisma-schema\n\ngenerator client {\n provider = \"prisma-client\"\n output = \"./generated/prisma\"\n}\n\ndatasource db {\n provider = \"postgresql\"\n}\n\nmodel DismissibleItem {\n id String\n userId String @map(\"user_id\")\n createdAt DateTime @default(now()) @map(\"created_at\")\n dismissedAt DateTime? @map(\"dismissed_at\")\n\n @@id([userId, id])\n @@index([userId])\n @@map(\"dismissible_items\")\n}\n",
|
|
24
24
|
"runtimeDataModel": {
|
|
25
25
|
"models": {},
|
|
26
26
|
"enums": {},
|
|
@@ -28,7 +28,7 @@ const config: runtime.GetPrismaClientConfig = {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
config.runtimeDataModel = JSON.parse("{\"models\":{\"DismissibleItem\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"userId\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"user_id\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"created_at\"},{\"name\":\"dismissedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"dismissed_at\"}
|
|
31
|
+
config.runtimeDataModel = JSON.parse("{\"models\":{\"DismissibleItem\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"userId\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"user_id\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"created_at\"},{\"name\":\"dismissedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"dismissed_at\"}],\"dbName\":\"dismissible_items\"}},\"enums\":{},\"types\":{}}")
|
|
32
32
|
|
|
33
33
|
async function decodeBase64AsWasm(wasmBase64: string): Promise<WebAssembly.Module> {
|
|
34
34
|
const { Buffer } = await import('node:buffer')
|
|
@@ -521,8 +521,7 @@ export const DismissibleItemScalarFieldEnum = {
|
|
|
521
521
|
id: 'id',
|
|
522
522
|
userId: 'userId',
|
|
523
523
|
createdAt: 'createdAt',
|
|
524
|
-
dismissedAt: 'dismissedAt'
|
|
525
|
-
metadata: 'metadata'
|
|
524
|
+
dismissedAt: 'dismissedAt'
|
|
526
525
|
} as const
|
|
527
526
|
|
|
528
527
|
export type DismissibleItemScalarFieldEnum = (typeof DismissibleItemScalarFieldEnum)[keyof typeof DismissibleItemScalarFieldEnum]
|
|
@@ -536,14 +535,6 @@ export const SortOrder = {
|
|
|
536
535
|
export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder]
|
|
537
536
|
|
|
538
537
|
|
|
539
|
-
export const NullableJsonNullValueInput = {
|
|
540
|
-
DbNull: DbNull,
|
|
541
|
-
JsonNull: JsonNull
|
|
542
|
-
} as const
|
|
543
|
-
|
|
544
|
-
export type NullableJsonNullValueInput = (typeof NullableJsonNullValueInput)[keyof typeof NullableJsonNullValueInput]
|
|
545
|
-
|
|
546
|
-
|
|
547
538
|
export const QueryMode = {
|
|
548
539
|
default: 'default',
|
|
549
540
|
insensitive: 'insensitive'
|
|
@@ -552,15 +543,6 @@ export const QueryMode = {
|
|
|
552
543
|
export type QueryMode = (typeof QueryMode)[keyof typeof QueryMode]
|
|
553
544
|
|
|
554
545
|
|
|
555
|
-
export const JsonNullValueFilter = {
|
|
556
|
-
DbNull: DbNull,
|
|
557
|
-
JsonNull: JsonNull,
|
|
558
|
-
AnyNull: AnyNull
|
|
559
|
-
} as const
|
|
560
|
-
|
|
561
|
-
export type JsonNullValueFilter = (typeof JsonNullValueFilter)[keyof typeof JsonNullValueFilter]
|
|
562
|
-
|
|
563
|
-
|
|
564
546
|
export const NullsOrder = {
|
|
565
547
|
first: 'first',
|
|
566
548
|
last: 'last'
|
|
@@ -603,20 +585,6 @@ export type ListDateTimeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaM
|
|
|
603
585
|
|
|
604
586
|
|
|
605
587
|
|
|
606
|
-
/**
|
|
607
|
-
* Reference to a field of type 'Json'
|
|
608
|
-
*/
|
|
609
|
-
export type JsonFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Json'>
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
/**
|
|
614
|
-
* Reference to a field of type 'QueryMode'
|
|
615
|
-
*/
|
|
616
|
-
export type EnumQueryModeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'QueryMode'>
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
588
|
/**
|
|
621
589
|
* Reference to a field of type 'Int'
|
|
622
590
|
*/
|
|
@@ -74,8 +74,7 @@ export const DismissibleItemScalarFieldEnum = {
|
|
|
74
74
|
id: 'id',
|
|
75
75
|
userId: 'userId',
|
|
76
76
|
createdAt: 'createdAt',
|
|
77
|
-
dismissedAt: 'dismissedAt'
|
|
78
|
-
metadata: 'metadata'
|
|
77
|
+
dismissedAt: 'dismissedAt'
|
|
79
78
|
} as const
|
|
80
79
|
|
|
81
80
|
export type DismissibleItemScalarFieldEnum = (typeof DismissibleItemScalarFieldEnum)[keyof typeof DismissibleItemScalarFieldEnum]
|
|
@@ -89,14 +88,6 @@ export const SortOrder = {
|
|
|
89
88
|
export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder]
|
|
90
89
|
|
|
91
90
|
|
|
92
|
-
export const NullableJsonNullValueInput = {
|
|
93
|
-
DbNull: 'DbNull',
|
|
94
|
-
JsonNull: 'JsonNull'
|
|
95
|
-
} as const
|
|
96
|
-
|
|
97
|
-
export type NullableJsonNullValueInput = (typeof NullableJsonNullValueInput)[keyof typeof NullableJsonNullValueInput]
|
|
98
|
-
|
|
99
|
-
|
|
100
91
|
export const QueryMode = {
|
|
101
92
|
default: 'default',
|
|
102
93
|
insensitive: 'insensitive'
|
|
@@ -105,15 +96,6 @@ export const QueryMode = {
|
|
|
105
96
|
export type QueryMode = (typeof QueryMode)[keyof typeof QueryMode]
|
|
106
97
|
|
|
107
98
|
|
|
108
|
-
export const JsonNullValueFilter = {
|
|
109
|
-
DbNull: 'DbNull',
|
|
110
|
-
JsonNull: 'JsonNull',
|
|
111
|
-
AnyNull: 'AnyNull'
|
|
112
|
-
} as const
|
|
113
|
-
|
|
114
|
-
export type JsonNullValueFilter = (typeof JsonNullValueFilter)[keyof typeof JsonNullValueFilter]
|
|
115
|
-
|
|
116
|
-
|
|
117
99
|
export const NullsOrder = {
|
|
118
100
|
first: 'first',
|
|
119
101
|
last: 'last'
|
|
@@ -43,7 +43,6 @@ export type DismissibleItemCountAggregateOutputType = {
|
|
|
43
43
|
userId: number
|
|
44
44
|
createdAt: number
|
|
45
45
|
dismissedAt: number
|
|
46
|
-
metadata: number
|
|
47
46
|
_all: number
|
|
48
47
|
}
|
|
49
48
|
|
|
@@ -67,7 +66,6 @@ export type DismissibleItemCountAggregateInputType = {
|
|
|
67
66
|
userId?: true
|
|
68
67
|
createdAt?: true
|
|
69
68
|
dismissedAt?: true
|
|
70
|
-
metadata?: true
|
|
71
69
|
_all?: true
|
|
72
70
|
}
|
|
73
71
|
|
|
@@ -148,7 +146,6 @@ export type DismissibleItemGroupByOutputType = {
|
|
|
148
146
|
userId: string
|
|
149
147
|
createdAt: Date
|
|
150
148
|
dismissedAt: Date | null
|
|
151
|
-
metadata: runtime.JsonValue | null
|
|
152
149
|
_count: DismissibleItemCountAggregateOutputType | null
|
|
153
150
|
_min: DismissibleItemMinAggregateOutputType | null
|
|
154
151
|
_max: DismissibleItemMaxAggregateOutputType | null
|
|
@@ -177,7 +174,6 @@ export type DismissibleItemWhereInput = {
|
|
|
177
174
|
userId?: Prisma.StringFilter<"DismissibleItem"> | string
|
|
178
175
|
createdAt?: Prisma.DateTimeFilter<"DismissibleItem"> | Date | string
|
|
179
176
|
dismissedAt?: Prisma.DateTimeNullableFilter<"DismissibleItem"> | Date | string | null
|
|
180
|
-
metadata?: Prisma.JsonNullableFilter<"DismissibleItem">
|
|
181
177
|
}
|
|
182
178
|
|
|
183
179
|
export type DismissibleItemOrderByWithRelationInput = {
|
|
@@ -185,7 +181,6 @@ export type DismissibleItemOrderByWithRelationInput = {
|
|
|
185
181
|
userId?: Prisma.SortOrder
|
|
186
182
|
createdAt?: Prisma.SortOrder
|
|
187
183
|
dismissedAt?: Prisma.SortOrderInput | Prisma.SortOrder
|
|
188
|
-
metadata?: Prisma.SortOrderInput | Prisma.SortOrder
|
|
189
184
|
}
|
|
190
185
|
|
|
191
186
|
export type DismissibleItemWhereUniqueInput = Prisma.AtLeast<{
|
|
@@ -197,7 +192,6 @@ export type DismissibleItemWhereUniqueInput = Prisma.AtLeast<{
|
|
|
197
192
|
userId?: Prisma.StringFilter<"DismissibleItem"> | string
|
|
198
193
|
createdAt?: Prisma.DateTimeFilter<"DismissibleItem"> | Date | string
|
|
199
194
|
dismissedAt?: Prisma.DateTimeNullableFilter<"DismissibleItem"> | Date | string | null
|
|
200
|
-
metadata?: Prisma.JsonNullableFilter<"DismissibleItem">
|
|
201
195
|
}, "userId_id">
|
|
202
196
|
|
|
203
197
|
export type DismissibleItemOrderByWithAggregationInput = {
|
|
@@ -205,7 +199,6 @@ export type DismissibleItemOrderByWithAggregationInput = {
|
|
|
205
199
|
userId?: Prisma.SortOrder
|
|
206
200
|
createdAt?: Prisma.SortOrder
|
|
207
201
|
dismissedAt?: Prisma.SortOrderInput | Prisma.SortOrder
|
|
208
|
-
metadata?: Prisma.SortOrderInput | Prisma.SortOrder
|
|
209
202
|
_count?: Prisma.DismissibleItemCountOrderByAggregateInput
|
|
210
203
|
_max?: Prisma.DismissibleItemMaxOrderByAggregateInput
|
|
211
204
|
_min?: Prisma.DismissibleItemMinOrderByAggregateInput
|
|
@@ -219,7 +212,6 @@ export type DismissibleItemScalarWhereWithAggregatesInput = {
|
|
|
219
212
|
userId?: Prisma.StringWithAggregatesFilter<"DismissibleItem"> | string
|
|
220
213
|
createdAt?: Prisma.DateTimeWithAggregatesFilter<"DismissibleItem"> | Date | string
|
|
221
214
|
dismissedAt?: Prisma.DateTimeNullableWithAggregatesFilter<"DismissibleItem"> | Date | string | null
|
|
222
|
-
metadata?: Prisma.JsonNullableWithAggregatesFilter<"DismissibleItem">
|
|
223
215
|
}
|
|
224
216
|
|
|
225
217
|
export type DismissibleItemCreateInput = {
|
|
@@ -227,7 +219,6 @@ export type DismissibleItemCreateInput = {
|
|
|
227
219
|
userId: string
|
|
228
220
|
createdAt?: Date | string
|
|
229
221
|
dismissedAt?: Date | string | null
|
|
230
|
-
metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
|
231
222
|
}
|
|
232
223
|
|
|
233
224
|
export type DismissibleItemUncheckedCreateInput = {
|
|
@@ -235,7 +226,6 @@ export type DismissibleItemUncheckedCreateInput = {
|
|
|
235
226
|
userId: string
|
|
236
227
|
createdAt?: Date | string
|
|
237
228
|
dismissedAt?: Date | string | null
|
|
238
|
-
metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
|
239
229
|
}
|
|
240
230
|
|
|
241
231
|
export type DismissibleItemUpdateInput = {
|
|
@@ -243,7 +233,6 @@ export type DismissibleItemUpdateInput = {
|
|
|
243
233
|
userId?: Prisma.StringFieldUpdateOperationsInput | string
|
|
244
234
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
245
235
|
dismissedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
|
246
|
-
metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
|
247
236
|
}
|
|
248
237
|
|
|
249
238
|
export type DismissibleItemUncheckedUpdateInput = {
|
|
@@ -251,7 +240,6 @@ export type DismissibleItemUncheckedUpdateInput = {
|
|
|
251
240
|
userId?: Prisma.StringFieldUpdateOperationsInput | string
|
|
252
241
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
253
242
|
dismissedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
|
254
|
-
metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
|
255
243
|
}
|
|
256
244
|
|
|
257
245
|
export type DismissibleItemCreateManyInput = {
|
|
@@ -259,7 +247,6 @@ export type DismissibleItemCreateManyInput = {
|
|
|
259
247
|
userId: string
|
|
260
248
|
createdAt?: Date | string
|
|
261
249
|
dismissedAt?: Date | string | null
|
|
262
|
-
metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
|
263
250
|
}
|
|
264
251
|
|
|
265
252
|
export type DismissibleItemUpdateManyMutationInput = {
|
|
@@ -267,7 +254,6 @@ export type DismissibleItemUpdateManyMutationInput = {
|
|
|
267
254
|
userId?: Prisma.StringFieldUpdateOperationsInput | string
|
|
268
255
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
269
256
|
dismissedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
|
270
|
-
metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
|
271
257
|
}
|
|
272
258
|
|
|
273
259
|
export type DismissibleItemUncheckedUpdateManyInput = {
|
|
@@ -275,7 +261,6 @@ export type DismissibleItemUncheckedUpdateManyInput = {
|
|
|
275
261
|
userId?: Prisma.StringFieldUpdateOperationsInput | string
|
|
276
262
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
277
263
|
dismissedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
|
278
|
-
metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
|
279
264
|
}
|
|
280
265
|
|
|
281
266
|
export type DismissibleItemUserIdIdCompoundUniqueInput = {
|
|
@@ -288,7 +273,6 @@ export type DismissibleItemCountOrderByAggregateInput = {
|
|
|
288
273
|
userId?: Prisma.SortOrder
|
|
289
274
|
createdAt?: Prisma.SortOrder
|
|
290
275
|
dismissedAt?: Prisma.SortOrder
|
|
291
|
-
metadata?: Prisma.SortOrder
|
|
292
276
|
}
|
|
293
277
|
|
|
294
278
|
export type DismissibleItemMaxOrderByAggregateInput = {
|
|
@@ -324,7 +308,6 @@ export type DismissibleItemSelect<ExtArgs extends runtime.Types.Extensions.Inter
|
|
|
324
308
|
userId?: boolean
|
|
325
309
|
createdAt?: boolean
|
|
326
310
|
dismissedAt?: boolean
|
|
327
|
-
metadata?: boolean
|
|
328
311
|
}, ExtArgs["result"]["dismissibleItem"]>
|
|
329
312
|
|
|
330
313
|
export type DismissibleItemSelectCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
|
@@ -332,7 +315,6 @@ export type DismissibleItemSelectCreateManyAndReturn<ExtArgs extends runtime.Typ
|
|
|
332
315
|
userId?: boolean
|
|
333
316
|
createdAt?: boolean
|
|
334
317
|
dismissedAt?: boolean
|
|
335
|
-
metadata?: boolean
|
|
336
318
|
}, ExtArgs["result"]["dismissibleItem"]>
|
|
337
319
|
|
|
338
320
|
export type DismissibleItemSelectUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
|
@@ -340,7 +322,6 @@ export type DismissibleItemSelectUpdateManyAndReturn<ExtArgs extends runtime.Typ
|
|
|
340
322
|
userId?: boolean
|
|
341
323
|
createdAt?: boolean
|
|
342
324
|
dismissedAt?: boolean
|
|
343
|
-
metadata?: boolean
|
|
344
325
|
}, ExtArgs["result"]["dismissibleItem"]>
|
|
345
326
|
|
|
346
327
|
export type DismissibleItemSelectScalar = {
|
|
@@ -348,10 +329,9 @@ export type DismissibleItemSelectScalar = {
|
|
|
348
329
|
userId?: boolean
|
|
349
330
|
createdAt?: boolean
|
|
350
331
|
dismissedAt?: boolean
|
|
351
|
-
metadata?: boolean
|
|
352
332
|
}
|
|
353
333
|
|
|
354
|
-
export type DismissibleItemOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "userId" | "createdAt" | "dismissedAt"
|
|
334
|
+
export type DismissibleItemOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "userId" | "createdAt" | "dismissedAt", ExtArgs["result"]["dismissibleItem"]>
|
|
355
335
|
|
|
356
336
|
export type $DismissibleItemPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
|
357
337
|
name: "DismissibleItem"
|
|
@@ -361,7 +341,6 @@ export type $DismissibleItemPayload<ExtArgs extends runtime.Types.Extensions.Int
|
|
|
361
341
|
userId: string
|
|
362
342
|
createdAt: Date
|
|
363
343
|
dismissedAt: Date | null
|
|
364
|
-
metadata: runtime.JsonValue | null
|
|
365
344
|
}, ExtArgs["result"]["dismissibleItem"]>
|
|
366
345
|
composites: {}
|
|
367
346
|
}
|
|
@@ -789,7 +768,6 @@ export interface DismissibleItemFieldRefs {
|
|
|
789
768
|
readonly userId: Prisma.FieldRef<"DismissibleItem", 'String'>
|
|
790
769
|
readonly createdAt: Prisma.FieldRef<"DismissibleItem", 'DateTime'>
|
|
791
770
|
readonly dismissedAt: Prisma.FieldRef<"DismissibleItem", 'DateTime'>
|
|
792
|
-
readonly metadata: Prisma.FieldRef<"DismissibleItem", 'Json'>
|
|
793
771
|
}
|
|
794
772
|
|
|
795
773
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
-- CreateTable
|
|
2
|
+
CREATE TABLE "dismissible_items" (
|
|
3
|
+
"id" TEXT NOT NULL,
|
|
4
|
+
"user_id" TEXT NOT NULL,
|
|
5
|
+
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
6
|
+
"dismissed_at" TIMESTAMP(3),
|
|
7
|
+
|
|
8
|
+
CONSTRAINT "dismissible_items_pkey" PRIMARY KEY ("user_id","id")
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
-- CreateIndex
|
|
12
|
+
CREATE INDEX "dismissible_items_user_id_idx" ON "dismissible_items"("user_id");
|