@casekit/orm2-fixtures 0.0.1 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.d.ts +528 -0
- package/{src/index.ts → build/index.js} +1 -9
- package/build/models/audit.d.ts +15 -0
- package/{src/models/audit.ts → build/models/audit.js} +1 -3
- package/build/models/color.d.ts +11 -0
- package/{src/models/color.ts → build/models/color.js} +1 -3
- package/build/models/counter.d.ts +8 -0
- package/build/models/counter.js +3 -0
- package/build/models/friendship.d.ts +32 -0
- package/{src/models/friendship.ts → build/models/friendship.js} +1 -3
- package/build/models/friendshipStats.d.ts +38 -0
- package/{src/models/friendshipStats.ts → build/models/friendshipStats.js} +1 -3
- package/build/models/index.d.ts +512 -0
- package/{src/models/index.ts → build/models/index.js} +0 -1
- package/build/models/kitchenSink.d.ts +209 -0
- package/{src/models/kitchenSink.ts → build/models/kitchenSink.js} +1 -3
- package/build/models/like.d.ts +50 -0
- package/{src/models/like.ts → build/models/like.js} +3 -5
- package/build/models/post.d.ts +87 -0
- package/{src/models/post.ts → build/models/post.js} +6 -11
- package/build/models/user.d.ts +62 -0
- package/{src/models/user.ts → build/models/user.js} +2 -5
- package/package.json +9 -9
- package/src/models/counter.ts +0 -5
package/build/index.d.ts
ADDED
|
@@ -0,0 +1,528 @@
|
|
|
1
|
+
import { snakeCase } from "es-toolkit";
|
|
2
|
+
import { models } from "./models/index.js";
|
|
3
|
+
export { models } from "./models/index.js";
|
|
4
|
+
export type Models = typeof models;
|
|
5
|
+
export type Operators = {
|
|
6
|
+
where: Record<symbol, never>;
|
|
7
|
+
};
|
|
8
|
+
export declare const config: {
|
|
9
|
+
schema: string;
|
|
10
|
+
models: {
|
|
11
|
+
audit: {
|
|
12
|
+
readonly fields: {
|
|
13
|
+
readonly id: {
|
|
14
|
+
readonly type: "serial";
|
|
15
|
+
readonly primaryKey: true;
|
|
16
|
+
};
|
|
17
|
+
readonly change: {
|
|
18
|
+
readonly type: "text";
|
|
19
|
+
readonly provided: true;
|
|
20
|
+
};
|
|
21
|
+
readonly userId: {
|
|
22
|
+
readonly type: "integer";
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
counter: {
|
|
27
|
+
readonly fields: {
|
|
28
|
+
readonly counter: {
|
|
29
|
+
readonly type: "serial";
|
|
30
|
+
readonly primaryKey: true;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
user: {
|
|
35
|
+
readonly fields: {
|
|
36
|
+
readonly id: {
|
|
37
|
+
readonly type: "serial";
|
|
38
|
+
readonly primaryKey: true;
|
|
39
|
+
};
|
|
40
|
+
readonly name: {
|
|
41
|
+
readonly type: "text";
|
|
42
|
+
};
|
|
43
|
+
readonly email: {
|
|
44
|
+
readonly type: "text";
|
|
45
|
+
readonly zodSchema: import("zod").ZodEmail;
|
|
46
|
+
};
|
|
47
|
+
readonly role: {
|
|
48
|
+
readonly type: "text";
|
|
49
|
+
readonly zodSchema: import("zod").ZodEnum<{
|
|
50
|
+
user: "user";
|
|
51
|
+
admin: "admin";
|
|
52
|
+
}>;
|
|
53
|
+
};
|
|
54
|
+
readonly preferences: {
|
|
55
|
+
readonly type: "jsonb";
|
|
56
|
+
readonly default: "{}";
|
|
57
|
+
};
|
|
58
|
+
readonly createdAt: {
|
|
59
|
+
readonly type: "timestamp";
|
|
60
|
+
readonly default: import("@casekit/sql").SQLStatement<import("pg").QueryResultRow>;
|
|
61
|
+
};
|
|
62
|
+
readonly deletedAt: {
|
|
63
|
+
readonly type: "timestamp";
|
|
64
|
+
readonly nullable: true;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
readonly uniqueConstraints: [{
|
|
68
|
+
readonly fields: ["email", "deletedAt"];
|
|
69
|
+
readonly nullsNotDistinct: true;
|
|
70
|
+
}];
|
|
71
|
+
readonly relations: {
|
|
72
|
+
readonly posts: {
|
|
73
|
+
readonly type: "1:N";
|
|
74
|
+
readonly model: "post";
|
|
75
|
+
readonly fromField: "id";
|
|
76
|
+
readonly toField: "authorId";
|
|
77
|
+
};
|
|
78
|
+
readonly friends: {
|
|
79
|
+
readonly type: "N:N";
|
|
80
|
+
readonly model: "user";
|
|
81
|
+
readonly through: {
|
|
82
|
+
readonly model: "friendship";
|
|
83
|
+
readonly fromRelation: "user";
|
|
84
|
+
readonly toRelation: "friend";
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
readonly friendships: {
|
|
88
|
+
readonly type: "1:N";
|
|
89
|
+
readonly model: "friendship";
|
|
90
|
+
readonly fromField: "id";
|
|
91
|
+
readonly toField: "userId";
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
post: {
|
|
96
|
+
readonly fields: {
|
|
97
|
+
readonly id: {
|
|
98
|
+
readonly type: "serial";
|
|
99
|
+
readonly primaryKey: true;
|
|
100
|
+
};
|
|
101
|
+
readonly title: {
|
|
102
|
+
readonly type: "text";
|
|
103
|
+
};
|
|
104
|
+
readonly content: {
|
|
105
|
+
readonly type: "text";
|
|
106
|
+
};
|
|
107
|
+
readonly tags: {
|
|
108
|
+
readonly type: "text[]";
|
|
109
|
+
readonly default: "{}";
|
|
110
|
+
};
|
|
111
|
+
readonly authorId: {
|
|
112
|
+
readonly type: "integer";
|
|
113
|
+
readonly references: {
|
|
114
|
+
readonly model: "user";
|
|
115
|
+
readonly field: "id";
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
readonly backgroundColorValue: {
|
|
119
|
+
readonly type: "text";
|
|
120
|
+
readonly nullable: true;
|
|
121
|
+
readonly references: {
|
|
122
|
+
readonly model: "color";
|
|
123
|
+
readonly field: "hex";
|
|
124
|
+
readonly onDelete: "SET NULL";
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
readonly metadata: {
|
|
128
|
+
readonly type: "jsonb";
|
|
129
|
+
readonly default: "{}";
|
|
130
|
+
readonly zodSchema: import("zod").ZodObject<{
|
|
131
|
+
foo: import("zod").ZodEnum<{
|
|
132
|
+
b: "b";
|
|
133
|
+
a: "a";
|
|
134
|
+
c: "c";
|
|
135
|
+
}>;
|
|
136
|
+
bar: import("zod").ZodArray<import("zod").ZodObject<{
|
|
137
|
+
baz: import("zod").ZodEnum<{
|
|
138
|
+
good: "good";
|
|
139
|
+
bad: "bad";
|
|
140
|
+
indifferent: "indifferent";
|
|
141
|
+
}>;
|
|
142
|
+
quux: import("zod").ZodBoolean;
|
|
143
|
+
}, import("zod/v4/core").$strip>>;
|
|
144
|
+
}, import("zod/v4/core").$strip>;
|
|
145
|
+
};
|
|
146
|
+
readonly createdAt: {
|
|
147
|
+
readonly type: "timestamp";
|
|
148
|
+
readonly default: import("@casekit/sql").SQLStatement<import("pg").QueryResultRow>;
|
|
149
|
+
};
|
|
150
|
+
readonly publishedAt: {
|
|
151
|
+
readonly type: "timestamp";
|
|
152
|
+
readonly nullable: true;
|
|
153
|
+
};
|
|
154
|
+
readonly deletedAt: {
|
|
155
|
+
readonly type: "timestamp";
|
|
156
|
+
readonly nullable: true;
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
readonly relations: {
|
|
160
|
+
readonly author: {
|
|
161
|
+
readonly type: "N:1";
|
|
162
|
+
readonly model: "user";
|
|
163
|
+
readonly fromField: "authorId";
|
|
164
|
+
readonly toField: "id";
|
|
165
|
+
};
|
|
166
|
+
readonly backgroundColor: {
|
|
167
|
+
readonly type: "N:1";
|
|
168
|
+
readonly model: "color";
|
|
169
|
+
readonly fromField: "backgroundColorValue";
|
|
170
|
+
readonly toField: "hex";
|
|
171
|
+
readonly optional: true;
|
|
172
|
+
};
|
|
173
|
+
readonly likes: {
|
|
174
|
+
readonly type: "1:N";
|
|
175
|
+
readonly model: "like";
|
|
176
|
+
readonly fromField: "id";
|
|
177
|
+
readonly toField: "postId";
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
like: {
|
|
182
|
+
readonly fields: {
|
|
183
|
+
readonly id: {
|
|
184
|
+
readonly type: "serial";
|
|
185
|
+
readonly primaryKey: true;
|
|
186
|
+
};
|
|
187
|
+
readonly userId: {
|
|
188
|
+
readonly type: "integer";
|
|
189
|
+
readonly references: {
|
|
190
|
+
readonly model: "user";
|
|
191
|
+
readonly field: "id";
|
|
192
|
+
readonly onDelete: "CASCADE";
|
|
193
|
+
};
|
|
194
|
+
};
|
|
195
|
+
readonly postId: {
|
|
196
|
+
readonly type: "integer";
|
|
197
|
+
readonly references: {
|
|
198
|
+
readonly model: "post";
|
|
199
|
+
readonly field: "id";
|
|
200
|
+
readonly onDelete: "CASCADE";
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
readonly createdAt: {
|
|
204
|
+
readonly type: "timestamp";
|
|
205
|
+
readonly default: import("@casekit/sql").SQLStatement<import("pg").QueryResultRow>;
|
|
206
|
+
};
|
|
207
|
+
readonly deletedAt: {
|
|
208
|
+
readonly type: "timestamp";
|
|
209
|
+
readonly nullable: true;
|
|
210
|
+
};
|
|
211
|
+
};
|
|
212
|
+
readonly uniqueConstraints: [{
|
|
213
|
+
readonly fields: ["userId", "postId"];
|
|
214
|
+
readonly where: import("@casekit/sql").SQLStatement<import("pg").QueryResultRow>;
|
|
215
|
+
}];
|
|
216
|
+
readonly relations: {
|
|
217
|
+
readonly user: {
|
|
218
|
+
readonly type: "N:1";
|
|
219
|
+
readonly model: "user";
|
|
220
|
+
readonly fromField: "userId";
|
|
221
|
+
readonly toField: "id";
|
|
222
|
+
};
|
|
223
|
+
readonly post: {
|
|
224
|
+
readonly type: "N:1";
|
|
225
|
+
readonly model: "post";
|
|
226
|
+
readonly fromField: "postId";
|
|
227
|
+
readonly toField: "id";
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
};
|
|
231
|
+
color: {
|
|
232
|
+
readonly fields: {
|
|
233
|
+
readonly hex: {
|
|
234
|
+
readonly type: "text";
|
|
235
|
+
readonly primaryKey: true;
|
|
236
|
+
};
|
|
237
|
+
readonly name: {
|
|
238
|
+
readonly type: "text";
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
friendship: {
|
|
243
|
+
readonly fields: {
|
|
244
|
+
readonly userId: {
|
|
245
|
+
readonly type: "integer";
|
|
246
|
+
};
|
|
247
|
+
readonly friendId: {
|
|
248
|
+
readonly type: "integer";
|
|
249
|
+
};
|
|
250
|
+
};
|
|
251
|
+
readonly primaryKey: ["userId", "friendId"];
|
|
252
|
+
readonly relations: {
|
|
253
|
+
readonly user: {
|
|
254
|
+
readonly type: "N:1";
|
|
255
|
+
readonly model: "user";
|
|
256
|
+
readonly fromField: "userId";
|
|
257
|
+
readonly toField: "id";
|
|
258
|
+
};
|
|
259
|
+
readonly friend: {
|
|
260
|
+
readonly type: "N:1";
|
|
261
|
+
readonly model: "user";
|
|
262
|
+
readonly fromField: "friendId";
|
|
263
|
+
readonly toField: "id";
|
|
264
|
+
};
|
|
265
|
+
readonly stats: {
|
|
266
|
+
readonly type: "N:1";
|
|
267
|
+
readonly model: "friendshipStats";
|
|
268
|
+
readonly fromField: ["userId", "friendId"];
|
|
269
|
+
readonly toField: ["userId", "friendId"];
|
|
270
|
+
readonly optional: true;
|
|
271
|
+
};
|
|
272
|
+
};
|
|
273
|
+
};
|
|
274
|
+
friendshipStats: {
|
|
275
|
+
readonly fields: {
|
|
276
|
+
readonly id: {
|
|
277
|
+
readonly type: "serial";
|
|
278
|
+
readonly primaryKey: true;
|
|
279
|
+
};
|
|
280
|
+
readonly userId: {
|
|
281
|
+
readonly type: "integer";
|
|
282
|
+
};
|
|
283
|
+
readonly friendId: {
|
|
284
|
+
readonly type: "integer";
|
|
285
|
+
};
|
|
286
|
+
readonly messagesSent: {
|
|
287
|
+
readonly type: "integer";
|
|
288
|
+
readonly default: 0;
|
|
289
|
+
};
|
|
290
|
+
readonly likesGiven: {
|
|
291
|
+
readonly type: "integer";
|
|
292
|
+
readonly default: 0;
|
|
293
|
+
};
|
|
294
|
+
};
|
|
295
|
+
readonly foreignKeys: [{
|
|
296
|
+
readonly fields: ["userId", "friendId"];
|
|
297
|
+
readonly references: {
|
|
298
|
+
readonly model: "friendship";
|
|
299
|
+
readonly fields: ["userId", "friendId"];
|
|
300
|
+
};
|
|
301
|
+
readonly onDelete: "CASCADE";
|
|
302
|
+
}];
|
|
303
|
+
readonly relations: {
|
|
304
|
+
readonly friendship: {
|
|
305
|
+
readonly type: "N:1";
|
|
306
|
+
readonly model: "friendship";
|
|
307
|
+
readonly fromField: ["userId", "friendId"];
|
|
308
|
+
readonly toField: ["userId", "friendId"];
|
|
309
|
+
};
|
|
310
|
+
};
|
|
311
|
+
};
|
|
312
|
+
kitchenSink: {
|
|
313
|
+
readonly fields: {
|
|
314
|
+
readonly id: {
|
|
315
|
+
readonly type: "serial";
|
|
316
|
+
readonly primaryKey: true;
|
|
317
|
+
};
|
|
318
|
+
readonly charField: {
|
|
319
|
+
readonly type: "char";
|
|
320
|
+
};
|
|
321
|
+
readonly characterField: {
|
|
322
|
+
readonly type: "character";
|
|
323
|
+
};
|
|
324
|
+
readonly characterNField: {
|
|
325
|
+
readonly type: "character(24)";
|
|
326
|
+
};
|
|
327
|
+
readonly varcharField: {
|
|
328
|
+
readonly type: "character varying";
|
|
329
|
+
};
|
|
330
|
+
readonly varcharNField: {
|
|
331
|
+
readonly type: "character varying(24)";
|
|
332
|
+
};
|
|
333
|
+
readonly textField: {
|
|
334
|
+
readonly type: "text";
|
|
335
|
+
};
|
|
336
|
+
readonly bitField: {
|
|
337
|
+
readonly type: "bit";
|
|
338
|
+
};
|
|
339
|
+
readonly bitNField: {
|
|
340
|
+
readonly type: "bit(3)";
|
|
341
|
+
};
|
|
342
|
+
readonly bitVaryingField: {
|
|
343
|
+
readonly type: "bit varying";
|
|
344
|
+
};
|
|
345
|
+
readonly bitVaryingNField: {
|
|
346
|
+
readonly type: "bit varying(3)";
|
|
347
|
+
};
|
|
348
|
+
readonly numericField: {
|
|
349
|
+
readonly type: "numeric";
|
|
350
|
+
};
|
|
351
|
+
readonly numericPrecisionField: {
|
|
352
|
+
readonly type: "numeric(5,2)";
|
|
353
|
+
};
|
|
354
|
+
readonly integerField: {
|
|
355
|
+
readonly type: "integer";
|
|
356
|
+
};
|
|
357
|
+
readonly bigintField: {
|
|
358
|
+
readonly type: "bigint";
|
|
359
|
+
};
|
|
360
|
+
readonly smallintField: {
|
|
361
|
+
readonly type: "smallint";
|
|
362
|
+
};
|
|
363
|
+
readonly serialField: {
|
|
364
|
+
readonly type: "serial";
|
|
365
|
+
};
|
|
366
|
+
readonly bigserialField: {
|
|
367
|
+
readonly type: "bigserial";
|
|
368
|
+
};
|
|
369
|
+
readonly smallserialField: {
|
|
370
|
+
readonly type: "smallserial";
|
|
371
|
+
};
|
|
372
|
+
readonly doublePrecisionField: {
|
|
373
|
+
readonly type: "double precision";
|
|
374
|
+
};
|
|
375
|
+
readonly realField: {
|
|
376
|
+
readonly type: "real";
|
|
377
|
+
};
|
|
378
|
+
readonly moneyField: {
|
|
379
|
+
readonly type: "money";
|
|
380
|
+
};
|
|
381
|
+
readonly booleanField: {
|
|
382
|
+
readonly type: "boolean";
|
|
383
|
+
};
|
|
384
|
+
readonly uuidField: {
|
|
385
|
+
readonly type: "uuid";
|
|
386
|
+
};
|
|
387
|
+
readonly dateField: {
|
|
388
|
+
readonly type: "date";
|
|
389
|
+
};
|
|
390
|
+
readonly timeField: {
|
|
391
|
+
readonly type: "time";
|
|
392
|
+
};
|
|
393
|
+
readonly timeWithPrecisionField: {
|
|
394
|
+
readonly type: "time(3)";
|
|
395
|
+
};
|
|
396
|
+
readonly timetzField: {
|
|
397
|
+
readonly type: "timetz";
|
|
398
|
+
};
|
|
399
|
+
readonly timeWithTzField: {
|
|
400
|
+
readonly type: "time with time zone";
|
|
401
|
+
};
|
|
402
|
+
readonly timestampField: {
|
|
403
|
+
readonly type: "timestamp";
|
|
404
|
+
};
|
|
405
|
+
readonly timestampWithPrecisionField: {
|
|
406
|
+
readonly type: "timestamp(6)";
|
|
407
|
+
};
|
|
408
|
+
readonly timestamptzField: {
|
|
409
|
+
readonly type: "timestamptz";
|
|
410
|
+
};
|
|
411
|
+
readonly timestampWithTzField: {
|
|
412
|
+
readonly type: "timestamp with time zone";
|
|
413
|
+
};
|
|
414
|
+
readonly jsonField: {
|
|
415
|
+
readonly type: "json";
|
|
416
|
+
};
|
|
417
|
+
readonly jsonbField: {
|
|
418
|
+
readonly type: "jsonb";
|
|
419
|
+
};
|
|
420
|
+
readonly lineField: {
|
|
421
|
+
readonly type: "line";
|
|
422
|
+
};
|
|
423
|
+
readonly lsegField: {
|
|
424
|
+
readonly type: "lseg";
|
|
425
|
+
};
|
|
426
|
+
readonly boxField: {
|
|
427
|
+
readonly type: "box";
|
|
428
|
+
};
|
|
429
|
+
readonly polygonField: {
|
|
430
|
+
readonly type: "polygon";
|
|
431
|
+
};
|
|
432
|
+
readonly cidrField: {
|
|
433
|
+
readonly type: "cidr";
|
|
434
|
+
};
|
|
435
|
+
readonly inetField: {
|
|
436
|
+
readonly type: "inet";
|
|
437
|
+
};
|
|
438
|
+
readonly macaddrField: {
|
|
439
|
+
readonly type: "macaddr";
|
|
440
|
+
};
|
|
441
|
+
readonly macaddr8Field: {
|
|
442
|
+
readonly type: "macaddr8";
|
|
443
|
+
};
|
|
444
|
+
readonly byteaField: {
|
|
445
|
+
readonly type: "bytea";
|
|
446
|
+
};
|
|
447
|
+
readonly xmlField: {
|
|
448
|
+
readonly type: "xml";
|
|
449
|
+
};
|
|
450
|
+
readonly pathField: {
|
|
451
|
+
readonly type: "path";
|
|
452
|
+
};
|
|
453
|
+
readonly tsqueryField: {
|
|
454
|
+
readonly type: "tsquery";
|
|
455
|
+
};
|
|
456
|
+
readonly tsvectorField: {
|
|
457
|
+
readonly type: "tsvector";
|
|
458
|
+
};
|
|
459
|
+
readonly int4rangeField: {
|
|
460
|
+
readonly type: "int4range";
|
|
461
|
+
};
|
|
462
|
+
readonly int8rangeField: {
|
|
463
|
+
readonly type: "int8range";
|
|
464
|
+
};
|
|
465
|
+
readonly numrangeField: {
|
|
466
|
+
readonly type: "numrange";
|
|
467
|
+
};
|
|
468
|
+
readonly tsrangeField: {
|
|
469
|
+
readonly type: "tsrange";
|
|
470
|
+
};
|
|
471
|
+
readonly tstzrangeField: {
|
|
472
|
+
readonly type: "tstzrange";
|
|
473
|
+
};
|
|
474
|
+
readonly daterangeField: {
|
|
475
|
+
readonly type: "daterange";
|
|
476
|
+
};
|
|
477
|
+
readonly int2vectorField: {
|
|
478
|
+
readonly type: "int2vector";
|
|
479
|
+
};
|
|
480
|
+
readonly oidField: {
|
|
481
|
+
readonly type: "oid";
|
|
482
|
+
};
|
|
483
|
+
readonly pglsnField: {
|
|
484
|
+
readonly type: "pg_lsn";
|
|
485
|
+
};
|
|
486
|
+
readonly regclassField: {
|
|
487
|
+
readonly type: "regclass";
|
|
488
|
+
};
|
|
489
|
+
readonly regnamespaceField: {
|
|
490
|
+
readonly type: "regnamespace";
|
|
491
|
+
};
|
|
492
|
+
readonly regprocField: {
|
|
493
|
+
readonly type: "regproc";
|
|
494
|
+
};
|
|
495
|
+
readonly regprocedureField: {
|
|
496
|
+
readonly type: "regprocedure";
|
|
497
|
+
};
|
|
498
|
+
readonly regroleField: {
|
|
499
|
+
readonly type: "regrole";
|
|
500
|
+
};
|
|
501
|
+
readonly regtypeField: {
|
|
502
|
+
readonly type: "regtype";
|
|
503
|
+
};
|
|
504
|
+
readonly tidField: {
|
|
505
|
+
readonly type: "tid";
|
|
506
|
+
};
|
|
507
|
+
readonly xidField: {
|
|
508
|
+
readonly type: "xid";
|
|
509
|
+
};
|
|
510
|
+
readonly txidSnapshotField: {
|
|
511
|
+
readonly type: "txid_snapshot";
|
|
512
|
+
};
|
|
513
|
+
readonly arrayField: {
|
|
514
|
+
readonly type: "text[]";
|
|
515
|
+
};
|
|
516
|
+
readonly multiArrayField: {
|
|
517
|
+
readonly type: "text[][][]";
|
|
518
|
+
};
|
|
519
|
+
};
|
|
520
|
+
};
|
|
521
|
+
};
|
|
522
|
+
naming: {
|
|
523
|
+
table: typeof snakeCase;
|
|
524
|
+
column: typeof snakeCase;
|
|
525
|
+
};
|
|
526
|
+
extensions: string[];
|
|
527
|
+
pool: true;
|
|
528
|
+
};
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import { snakeCase } from "es-toolkit";
|
|
2
|
-
|
|
3
|
-
import { Config } from "@casekit/orm2-schema";
|
|
4
|
-
|
|
5
2
|
import { models } from "./models/index.js";
|
|
6
|
-
|
|
7
3
|
export { models } from "./models/index.js";
|
|
8
|
-
|
|
9
|
-
export type Models = typeof models;
|
|
10
|
-
export type Operators = { where: Record<symbol, never> };
|
|
11
|
-
|
|
12
4
|
export const config = {
|
|
13
5
|
schema: "orm",
|
|
14
6
|
models,
|
|
@@ -18,4 +10,4 @@ export const config = {
|
|
|
18
10
|
},
|
|
19
11
|
extensions: ["uuid-ossp"],
|
|
20
12
|
pool: true,
|
|
21
|
-
}
|
|
13
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const audit: {
|
|
2
|
+
readonly fields: {
|
|
3
|
+
readonly id: {
|
|
4
|
+
readonly type: "serial";
|
|
5
|
+
readonly primaryKey: true;
|
|
6
|
+
};
|
|
7
|
+
readonly change: {
|
|
8
|
+
readonly type: "text";
|
|
9
|
+
readonly provided: true;
|
|
10
|
+
};
|
|
11
|
+
readonly userId: {
|
|
12
|
+
readonly type: "integer";
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { ModelDefinition } from "@casekit/orm2-schema";
|
|
2
|
-
|
|
3
1
|
export const audit = {
|
|
4
2
|
fields: {
|
|
5
3
|
id: { type: "serial", primaryKey: true },
|
|
6
4
|
change: { type: "text", provided: true },
|
|
7
5
|
userId: { type: "integer" },
|
|
8
6
|
},
|
|
9
|
-
}
|
|
7
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare const friendship: {
|
|
2
|
+
readonly fields: {
|
|
3
|
+
readonly userId: {
|
|
4
|
+
readonly type: "integer";
|
|
5
|
+
};
|
|
6
|
+
readonly friendId: {
|
|
7
|
+
readonly type: "integer";
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
readonly primaryKey: ["userId", "friendId"];
|
|
11
|
+
readonly relations: {
|
|
12
|
+
readonly user: {
|
|
13
|
+
readonly type: "N:1";
|
|
14
|
+
readonly model: "user";
|
|
15
|
+
readonly fromField: "userId";
|
|
16
|
+
readonly toField: "id";
|
|
17
|
+
};
|
|
18
|
+
readonly friend: {
|
|
19
|
+
readonly type: "N:1";
|
|
20
|
+
readonly model: "user";
|
|
21
|
+
readonly fromField: "friendId";
|
|
22
|
+
readonly toField: "id";
|
|
23
|
+
};
|
|
24
|
+
readonly stats: {
|
|
25
|
+
readonly type: "N:1";
|
|
26
|
+
readonly model: "friendshipStats";
|
|
27
|
+
readonly fromField: ["userId", "friendId"];
|
|
28
|
+
readonly toField: ["userId", "friendId"];
|
|
29
|
+
readonly optional: true;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
};
|