alepha 0.10.3 → 0.10.4
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 +3 -3
- package/api/files.cjs +8 -0
- package/api/files.d.ts +203 -0
- package/api/files.js +1 -0
- package/api/jobs.cjs +8 -0
- package/api/jobs.d.ts +276 -0
- package/api/jobs.js +1 -0
- package/api/users.cjs +8 -0
- package/api/users.d.ts +394 -0
- package/api/users.js +1 -0
- package/batch.d.ts +14 -14
- package/cache/redis.d.ts +1 -0
- package/cache.d.ts +5 -0
- package/command.d.ts +6 -6
- package/core.d.ts +58 -10
- package/datetime.d.ts +0 -2
- package/devtools.cjs +8 -0
- package/devtools.d.ts +368 -0
- package/devtools.js +1 -0
- package/email.d.ts +15 -15
- package/logger.d.ts +44 -29
- package/package.json +71 -43
- package/postgres.d.ts +104 -310
- package/queue.d.ts +21 -21
- package/react/form.d.ts +2 -2
- package/react.d.ts +29 -29
- package/scheduler.d.ts +22 -2
- package/security.d.ts +12 -4
- package/server/links.d.ts +35 -35
- package/server.d.ts +30 -30
- package/topic.d.ts +26 -161
package/postgres.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as _alepha_core1 from "alepha";
|
|
2
|
-
import { Alepha, AlephaError, Descriptor, KIND, Service, Static, TArray, TBigInt, TBoolean, TInteger,
|
|
2
|
+
import { Alepha, AlephaError, Descriptor, KIND, Service, Static, TArray, TBigInt, TBoolean, TInteger, TNull, TNumber, TNumberOptions, TObject, TObjectOptions, TOptional, TOptionalAdd, TRecord, TSchema as TSchema$1, TString, TStringOptions, TUnion } from "alepha";
|
|
3
3
|
import * as drizzle_orm6 from "drizzle-orm";
|
|
4
4
|
import { BuildColumns, BuildExtraConfigColumns, SQL, SQLWrapper, TableConfig, sql } from "drizzle-orm";
|
|
5
5
|
import * as pg$1 from "drizzle-orm/pg-core";
|
|
6
|
-
import { AnyPgColumn, LockConfig, LockStrength, PgColumn, PgColumnBuilderBase, PgDatabase, PgInsertValue, PgSequenceOptions, PgTableExtraConfigValue, PgTableWithColumns, PgTransaction, PgTransactionConfig, SelectedFields, TableConfig as TableConfig$1, UpdateDeleteAction } from "drizzle-orm/pg-core";
|
|
6
|
+
import { AnyPgColumn, AnyPgTable, LockConfig, LockStrength, PgColumn, PgColumnBuilderBase, PgDatabase, PgInsertValue, PgSequenceOptions, PgTableExtraConfigValue, PgTableWithColumns, PgTransaction, PgTransactionConfig, SelectedFields, TableConfig as TableConfig$1, UpdateDeleteAction } from "drizzle-orm/pg-core";
|
|
7
7
|
import { DateTime, DateTimeProvider } from "alepha/datetime";
|
|
8
8
|
import * as _alepha_logger1 from "alepha/logger";
|
|
9
9
|
import * as _alepha_lock0 from "alepha/lock";
|
|
@@ -28,12 +28,16 @@ declare const PG_UPDATED_AT: unique symbol;
|
|
|
28
28
|
declare const PG_DELETED_AT: unique symbol;
|
|
29
29
|
declare const PG_VERSION: unique symbol;
|
|
30
30
|
declare const PG_IDENTITY: unique symbol;
|
|
31
|
+
declare const PG_MANY: unique symbol;
|
|
32
|
+
declare const PG_ONE: unique symbol;
|
|
31
33
|
declare const PG_REF: unique symbol;
|
|
32
34
|
/**
|
|
33
35
|
* @deprecated Use `PG_IDENTITY` instead.
|
|
34
36
|
*/
|
|
35
37
|
declare const PG_SERIAL: unique symbol;
|
|
36
38
|
type PgDefault = typeof PG_DEFAULT;
|
|
39
|
+
type PgMany = typeof PG_MANY;
|
|
40
|
+
type PgOne = typeof PG_ONE;
|
|
37
41
|
type PgRef = typeof PG_REF;
|
|
38
42
|
type PgPrimaryKey = typeof PG_PRIMARY_KEY;
|
|
39
43
|
type PgSymbols = {
|
|
@@ -44,6 +48,8 @@ type PgSymbols = {
|
|
|
44
48
|
[PG_DELETED_AT]: {};
|
|
45
49
|
[PG_VERSION]: {};
|
|
46
50
|
[PG_IDENTITY]: PgIdentityOptions;
|
|
51
|
+
[PG_MANY]: PgManyOptions;
|
|
52
|
+
[PG_ONE]: PgManyOptions;
|
|
47
53
|
[PG_REF]: PgRefOptions;
|
|
48
54
|
/**
|
|
49
55
|
* @deprecated Use `PG_IDENTITY` instead.
|
|
@@ -56,6 +62,11 @@ type PgIdentityOptions = {
|
|
|
56
62
|
} & PgSequenceOptions & {
|
|
57
63
|
name?: string;
|
|
58
64
|
};
|
|
65
|
+
interface PgManyOptions {
|
|
66
|
+
table: AnyPgTable;
|
|
67
|
+
schema: TObject;
|
|
68
|
+
foreignKey: string;
|
|
69
|
+
}
|
|
59
70
|
interface PgRefOptions {
|
|
60
71
|
ref: () => AnyPgColumn;
|
|
61
72
|
actions?: {
|
|
@@ -305,10 +316,10 @@ type PgTableWithColumnsAndSchema<T extends TableConfig, R extends TObject> = PgT
|
|
|
305
316
|
* name: "users",
|
|
306
317
|
* schema: t.object({
|
|
307
318
|
* id: pg.primaryKey(t.uuid()),
|
|
308
|
-
* email: t.
|
|
309
|
-
* username: t.
|
|
310
|
-
* firstName: t.
|
|
311
|
-
* lastName: t.
|
|
319
|
+
* email: t.text({ format: "email" }),
|
|
320
|
+
* username: t.text({ minLength: 3, maxLength: 30 }),
|
|
321
|
+
* firstName: t.text(),
|
|
322
|
+
* lastName: t.text(),
|
|
312
323
|
* isActive: t.boolean({ default: true }),
|
|
313
324
|
* createdAt: pg.createdAt(),
|
|
314
325
|
* updatedAt: pg.updatedAt(),
|
|
@@ -330,15 +341,15 @@ type PgTableWithColumnsAndSchema<T extends TableConfig, R extends TObject> = PgT
|
|
|
330
341
|
* name: "products",
|
|
331
342
|
* schema: t.object({
|
|
332
343
|
* id: pg.primaryKey(t.uuid()),
|
|
333
|
-
* sku: t.
|
|
334
|
-
* name: t.
|
|
335
|
-
* description: t.optional(t.
|
|
344
|
+
* sku: t.text({ minLength: 3 }),
|
|
345
|
+
* name: t.text({ minLength: 1, maxLength: 200 }),
|
|
346
|
+
* description: t.optional(t.text()),
|
|
336
347
|
* price: t.number({ minimum: 0 }),
|
|
337
|
-
* categoryId: t.
|
|
348
|
+
* categoryId: t.text({ format: "uuid" }),
|
|
338
349
|
* inStock: t.boolean({ default: true }),
|
|
339
350
|
* stockQuantity: t.integer({ minimum: 0, default: 0 }),
|
|
340
|
-
* tags: t.optional(t.array(t.
|
|
341
|
-
* metadata: t.optional(t.record(t.
|
|
351
|
+
* tags: t.optional(t.array(t.text())), // PostgreSQL array column
|
|
352
|
+
* metadata: t.optional(t.record(t.text(), t.any())), // JSONB column
|
|
342
353
|
* version: pg.version(),
|
|
343
354
|
* createdAt: pg.createdAt(),
|
|
344
355
|
* updatedAt: pg.updatedAt()
|
|
@@ -367,15 +378,15 @@ type PgTableWithColumnsAndSchema<T extends TableConfig, R extends TObject> = PgT
|
|
|
367
378
|
* name: "audit_logs",
|
|
368
379
|
* schema: t.object({
|
|
369
380
|
* id: pg.primaryKey(t.uuid()),
|
|
370
|
-
* tableName: t.
|
|
371
|
-
* recordId: t.
|
|
381
|
+
* tableName: t.text(),
|
|
382
|
+
* recordId: t.text(),
|
|
372
383
|
* action: t.enum(["CREATE", "UPDATE", "DELETE"]),
|
|
373
|
-
* userId: t.optional(t.
|
|
374
|
-
* oldValues: t.optional(t.record(t.
|
|
375
|
-
* newValues: t.optional(t.record(t.
|
|
384
|
+
* userId: t.optional(t.text({ format: "uuid" })),
|
|
385
|
+
* oldValues: t.optional(t.record(t.text(), t.any())),
|
|
386
|
+
* newValues: t.optional(t.record(t.text(), t.any())),
|
|
376
387
|
* timestamp: pg.createdAt(),
|
|
377
|
-
* ipAddress: t.optional(t.
|
|
378
|
-
* userAgent: t.optional(t.
|
|
388
|
+
* ipAddress: t.optional(t.text()),
|
|
389
|
+
* userAgent: t.optional(t.text())
|
|
379
390
|
* }),
|
|
380
391
|
* indexes: [
|
|
381
392
|
* "tableName",
|
|
@@ -403,9 +414,9 @@ type PgTableWithColumnsAndSchema<T extends TableConfig, R extends TObject> = PgT
|
|
|
403
414
|
* name: "user_roles",
|
|
404
415
|
* schema: t.object({
|
|
405
416
|
* id: pg.primaryKey(t.uuid()),
|
|
406
|
-
* userId: t.
|
|
407
|
-
* roleId: t.
|
|
408
|
-
* assignedBy: t.
|
|
417
|
+
* userId: t.text({ format: "uuid" }),
|
|
418
|
+
* roleId: t.text({ format: "uuid" }),
|
|
419
|
+
* assignedBy: t.text({ format: "uuid" }),
|
|
409
420
|
* assignedAt: pg.createdAt(),
|
|
410
421
|
* expiresAt: t.optional(t.datetime())
|
|
411
422
|
* }),
|
|
@@ -440,12 +451,12 @@ type PgTableWithColumnsAndSchema<T extends TableConfig, R extends TObject> = PgT
|
|
|
440
451
|
* name: "orders",
|
|
441
452
|
* schema: t.object({
|
|
442
453
|
* id: pg.primaryKey(t.uuid()),
|
|
443
|
-
* orderNumber: t.
|
|
444
|
-
* customerId: t.
|
|
454
|
+
* orderNumber: t.text(),
|
|
455
|
+
* customerId: t.text({ format: "uuid" }),
|
|
445
456
|
* status: t.enum(["pending", "processing", "shipped", "delivered"]),
|
|
446
457
|
* totalAmount: t.number({ minimum: 0 }),
|
|
447
|
-
* currency: t.
|
|
448
|
-
* notes: t.optional(t.
|
|
458
|
+
* currency: t.text({ default: "USD" }),
|
|
459
|
+
* notes: t.optional(t.text()),
|
|
449
460
|
* createdAt: pg.createdAt(),
|
|
450
461
|
* updatedAt: pg.updatedAt(),
|
|
451
462
|
* version: pg.version()
|
|
@@ -511,11 +522,11 @@ interface EntityDescriptorOptions<TTableName extends string, T extends TObject,
|
|
|
511
522
|
*
|
|
512
523
|
* **Supported PostgreSQL Types**:
|
|
513
524
|
* - `pg.primaryKey(t.uuid())` - UUID primary key
|
|
514
|
-
* - `t.
|
|
525
|
+
* - `t.text()` - VARCHAR column
|
|
515
526
|
* - `t.integer()`, `t.number()` - Numeric columns
|
|
516
527
|
* - `t.boolean()` - Boolean column
|
|
517
|
-
* - `t.array(t.
|
|
518
|
-
* - `t.record(t.
|
|
528
|
+
* - `t.array(t.text())` - PostgreSQL array column
|
|
529
|
+
* - `t.record(t.text(), t.any())` - JSONB column
|
|
519
530
|
* - `pg.createdAt()`, `pg.updatedAt()`, `pg.deletedAt()` - Audit timestamps
|
|
520
531
|
* - `pg.version()` - Optimistic locking version field
|
|
521
532
|
*
|
|
@@ -530,13 +541,13 @@ interface EntityDescriptorOptions<TTableName extends string, T extends TObject,
|
|
|
530
541
|
* ```ts
|
|
531
542
|
* t.object({
|
|
532
543
|
* id: pg.primaryKey(t.uuid()),
|
|
533
|
-
* email: t.
|
|
534
|
-
* firstName: t.
|
|
535
|
-
* lastName: t.
|
|
544
|
+
* email: t.text({ format: "email" }),
|
|
545
|
+
* firstName: t.text({ minLength: 1, maxLength: 100 }),
|
|
546
|
+
* lastName: t.text({ minLength: 1, maxLength: 100 }),
|
|
536
547
|
* age: t.optional(t.integer({ minimum: 0, maximum: 150 })),
|
|
537
548
|
* isActive: t.boolean({ default: true }),
|
|
538
|
-
* preferences: t.optional(t.record(t.
|
|
539
|
-
* tags: t.optional(t.array(t.
|
|
549
|
+
* preferences: t.optional(t.record(t.text(), t.any())),
|
|
550
|
+
* tags: t.optional(t.array(t.text())),
|
|
540
551
|
* createdAt: pg.createdAt(),
|
|
541
552
|
* updatedAt: pg.updatedAt(),
|
|
542
553
|
* version: pg.version()
|
|
@@ -765,6 +776,7 @@ interface PgAttrField {
|
|
|
765
776
|
type: TSchema$1;
|
|
766
777
|
data: any;
|
|
767
778
|
nested?: any[];
|
|
779
|
+
one?: boolean;
|
|
768
780
|
}
|
|
769
781
|
//#endregion
|
|
770
782
|
//#region src/interfaces/FilterOperators.d.ts
|
|
@@ -1124,8 +1136,7 @@ interface FilterOperators<TValue> {
|
|
|
1124
1136
|
}
|
|
1125
1137
|
//#endregion
|
|
1126
1138
|
//#region src/interfaces/PgQueryWhere.d.ts
|
|
1127
|
-
type
|
|
1128
|
-
type PgQueryWhere<T extends object> = { [Key in keyof T]?: FilterOperators<T[Key]> | T[Key] } & {
|
|
1139
|
+
type PgQueryWhere<T extends TObject> = { [Key in keyof Static<T>]?: FilterOperators<Static<T>[Key]> | Static<T>[Key] } & {
|
|
1129
1140
|
/**
|
|
1130
1141
|
* Combine a list of conditions with the `and` operator. Conditions
|
|
1131
1142
|
* that are equal `undefined` are automatically ignored.
|
|
@@ -1194,6 +1205,26 @@ type PgQueryWhere<T extends object> = { [Key in keyof T]?: FilterOperators<T[Key
|
|
|
1194
1205
|
*/
|
|
1195
1206
|
exists?: SQLWrapper;
|
|
1196
1207
|
};
|
|
1208
|
+
type PgQueryWhereOrSQL<T extends TObject> = SQLWrapper | PgQueryWhere<T>;
|
|
1209
|
+
type PgQueryWhereWithManyOrSQL<T extends TObject> = SQLWrapper | PgQueryWhereWithMany<T>;
|
|
1210
|
+
type PgQueryWhereWithMany<T extends TObject> = PgQueryWhere<RemoveManyRelations<T>> & ExtractManyRelations<T>;
|
|
1211
|
+
type RelField = {
|
|
1212
|
+
[PG_MANY]: any;
|
|
1213
|
+
} | {
|
|
1214
|
+
[PG_ONE]: any;
|
|
1215
|
+
};
|
|
1216
|
+
type ExtractManyRelations<T extends TObject> = { [K in keyof T["properties"] as T["properties"][K] extends RelField ? T["properties"][K] extends TArray ? T["properties"][K]["items"] extends TObject ? K : never : never : T["properties"][K] extends TObject ? K : never]?: PgQueryWhere<T["properties"][K] extends TArray ? T["properties"][K]["items"] extends TObject ? T["properties"][K]["items"] : TObject : T["properties"][K] extends TObject ? T["properties"][K] : TObject> };
|
|
1217
|
+
type RemoveManyRelations<T extends TObject> = TObject<{ [K in keyof T["properties"] as T["properties"][K] extends RelField ? never : K]: T["properties"][K] }>;
|
|
1218
|
+
type PgQueryWithMap<T extends TObject> = { [K in keyof T["properties"] as T["properties"][K] extends RelField ? K : never]?: T["properties"][K] extends TArray ? T["properties"][K]["items"] extends TObject ? PgQueryWithMany<T["properties"][K]["items"]> : never : T["properties"][K] extends TObject ? PgQueryWithOne<T["properties"][K]> : T["properties"][K] extends PgAttr<PgAttr<TOptionalAdd<infer U>, PgOne>, PgDefault> ? U extends TObject ? PgQueryWithOne<U> : never : never };
|
|
1219
|
+
type PgQueryWithOne<T extends TObject> = true | {
|
|
1220
|
+
columns?: (keyof Static<T>)[];
|
|
1221
|
+
relations?: PgQueryWithMap<T>;
|
|
1222
|
+
};
|
|
1223
|
+
type PgQueryWithMany<T extends TObject> = true | {
|
|
1224
|
+
limit?: number;
|
|
1225
|
+
columns?: (keyof Static<T>)[];
|
|
1226
|
+
relations?: PgQueryWithMap<T>;
|
|
1227
|
+
};
|
|
1197
1228
|
//#endregion
|
|
1198
1229
|
//#region src/interfaces/PgQuery.d.ts
|
|
1199
1230
|
/**
|
|
@@ -1214,24 +1245,25 @@ interface OrderByClause<T> {
|
|
|
1214
1245
|
* 3. Array: orderBy: [{ column: "name", direction: "asc" }, { column: "age", direction: "desc" }]
|
|
1215
1246
|
*/
|
|
1216
1247
|
type OrderBy<T> = keyof T | OrderByClause<T> | Array<OrderByClause<T>>;
|
|
1217
|
-
interface PgQuery<T extends TObject> {
|
|
1248
|
+
interface PgQuery<T extends TObject = TObject> {
|
|
1218
1249
|
distinct?: boolean;
|
|
1219
|
-
where?:
|
|
1250
|
+
where?: PgQueryWhereWithMany<T> | SQLWrapper;
|
|
1220
1251
|
limit?: number;
|
|
1221
1252
|
offset?: number;
|
|
1222
1253
|
orderBy?: OrderBy<Static<T>>;
|
|
1223
1254
|
groupBy?: (keyof Static<T>)[];
|
|
1255
|
+
relations?: PgQueryWithMap<T>;
|
|
1224
1256
|
}
|
|
1225
|
-
type PgQueryResult<T extends TObject, Select extends (keyof Static<T>)[]> = TPick<T, TKeysToIndexer<Select>>;
|
|
1226
1257
|
//#endregion
|
|
1227
1258
|
//#region src/providers/drivers/PostgresProvider.d.ts
|
|
1228
1259
|
type SQLLike = SQLWrapper | string;
|
|
1229
1260
|
declare abstract class PostgresProvider {
|
|
1230
1261
|
protected readonly alepha: Alepha;
|
|
1231
1262
|
abstract get db(): PgDatabase<any>;
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1263
|
+
readonly dialect: "postgres" | "sqlite";
|
|
1264
|
+
get schema(): string;
|
|
1265
|
+
execute<T extends TObject | undefined>(query: SQLLike, schema?: T): Promise<Array<T extends TObject ? Static<T> : any>>;
|
|
1266
|
+
protected mapResult<T extends TObject = any>(result: Array<any>, schema?: T): Array<T extends TObject ? Static<T> : any>;
|
|
1235
1267
|
}
|
|
1236
1268
|
//#endregion
|
|
1237
1269
|
//#region src/schemas/pageQuerySchema.d.ts
|
|
@@ -1247,7 +1279,7 @@ type PageQuery = Static<typeof pageQuerySchema>;
|
|
|
1247
1279
|
* Create a pagination schema for the given object schema.
|
|
1248
1280
|
*
|
|
1249
1281
|
* @example
|
|
1250
|
-
* const userSchema = t.object({ id: t.int(), name: t.
|
|
1282
|
+
* const userSchema = t.object({ id: t.int(), name: t.text() });
|
|
1251
1283
|
* const pagedUserSchema = pageSchema(userSchema);
|
|
1252
1284
|
*
|
|
1253
1285
|
* @see {@link $repository#paginate}
|
|
@@ -1323,9 +1355,9 @@ type Page<T> = {
|
|
|
1323
1355
|
* name: "users",
|
|
1324
1356
|
* schema: t.object({
|
|
1325
1357
|
* id: pg.primaryKey(t.uuid()),
|
|
1326
|
-
* email: t.
|
|
1327
|
-
* firstName: t.
|
|
1328
|
-
* lastName: t.
|
|
1358
|
+
* email: t.text({ format: "email" }),
|
|
1359
|
+
* firstName: t.text(),
|
|
1360
|
+
* lastName: t.text(),
|
|
1329
1361
|
* isActive: t.boolean({ default: true }),
|
|
1330
1362
|
* createdAt: pg.createdAt(),
|
|
1331
1363
|
* updatedAt: pg.updatedAt()
|
|
@@ -1359,238 +1391,6 @@ type Page<T> = {
|
|
|
1359
1391
|
* }
|
|
1360
1392
|
* }
|
|
1361
1393
|
* ```
|
|
1362
|
-
*
|
|
1363
|
-
* @example
|
|
1364
|
-
* **Advanced querying and filtering:**
|
|
1365
|
-
* ```ts
|
|
1366
|
-
* const Product = $entity({
|
|
1367
|
-
* name: "products",
|
|
1368
|
-
* schema: t.object({
|
|
1369
|
-
* id: pg.primaryKey(t.uuid()),
|
|
1370
|
-
* name: t.string(),
|
|
1371
|
-
* price: t.number({ minimum: 0 }),
|
|
1372
|
-
* categoryId: t.string({ format: "uuid" }),
|
|
1373
|
-
* inStock: t.boolean(),
|
|
1374
|
-
* tags: t.optional(t.array(t.string())),
|
|
1375
|
-
* createdAt: pg.createdAt(),
|
|
1376
|
-
* updatedAt: pg.updatedAt()
|
|
1377
|
-
* }),
|
|
1378
|
-
* indexes: ["categoryId", "inStock", "price"]
|
|
1379
|
-
* });
|
|
1380
|
-
*
|
|
1381
|
-
* class ProductService {
|
|
1382
|
-
* products = $repository({ table: Product });
|
|
1383
|
-
*
|
|
1384
|
-
* async searchProducts(filters: {
|
|
1385
|
-
* categoryId?: string;
|
|
1386
|
-
* minPrice?: number;
|
|
1387
|
-
* maxPrice?: number;
|
|
1388
|
-
* inStock?: boolean;
|
|
1389
|
-
* searchTerm?: string;
|
|
1390
|
-
* }, page: number = 0, size: number = 20) {
|
|
1391
|
-
* const query = this.products.createQuery({
|
|
1392
|
-
* where: {
|
|
1393
|
-
* and: [
|
|
1394
|
-
* filters.categoryId ? { categoryId: filters.categoryId } : {},
|
|
1395
|
-
* filters.inStock !== undefined ? { inStock: filters.inStock } : {},
|
|
1396
|
-
* filters.minPrice ? { price: { gte: filters.minPrice } } : {},
|
|
1397
|
-
* filters.maxPrice ? { price: { lte: filters.maxPrice } } : {},
|
|
1398
|
-
* filters.searchTerm ? { name: { ilike: `%${filters.searchTerm}%` } } : {}
|
|
1399
|
-
* ]
|
|
1400
|
-
* },
|
|
1401
|
-
* orderBy: [{ column: "createdAt", direction: "desc" }]
|
|
1402
|
-
* });
|
|
1403
|
-
*
|
|
1404
|
-
* return await this.products.paginate({ page, size }, query, { count: true });
|
|
1405
|
-
* }
|
|
1406
|
-
*
|
|
1407
|
-
* async getTopSellingProducts(limit: number = 10) {
|
|
1408
|
-
* // Custom SQL query for complex analytics
|
|
1409
|
-
* return await this.products.query(
|
|
1410
|
-
* (table, db) => db
|
|
1411
|
-
* .select({
|
|
1412
|
-
* id: table.id,
|
|
1413
|
-
* name: table.name,
|
|
1414
|
-
* price: table.price,
|
|
1415
|
-
* salesCount: sql<number>`COALESCE(sales.count, 0)`
|
|
1416
|
-
* })
|
|
1417
|
-
* .from(table)
|
|
1418
|
-
* .leftJoin(
|
|
1419
|
-
* sql`(
|
|
1420
|
-
* SELECT product_id, COUNT(*) as count
|
|
1421
|
-
* FROM order_items
|
|
1422
|
-
* WHERE created_at > NOW() - INTERVAL '30 days'
|
|
1423
|
-
* GROUP BY product_id
|
|
1424
|
-
* ) sales`,
|
|
1425
|
-
* sql`sales.product_id = ${table.id}`
|
|
1426
|
-
* )
|
|
1427
|
-
* .orderBy(sql`sales.count DESC NULLS LAST`)
|
|
1428
|
-
* .limit(limit)
|
|
1429
|
-
* );
|
|
1430
|
-
* }
|
|
1431
|
-
* }
|
|
1432
|
-
* ```
|
|
1433
|
-
*
|
|
1434
|
-
* @example
|
|
1435
|
-
* **Transaction handling and data consistency:**
|
|
1436
|
-
* ```ts
|
|
1437
|
-
* class OrderService {
|
|
1438
|
-
* orders = $repository({ table: Order });
|
|
1439
|
-
* orderItems = $repository({ table: OrderItem });
|
|
1440
|
-
* products = $repository({ table: Product });
|
|
1441
|
-
*
|
|
1442
|
-
* async createOrderWithItems(orderData: {
|
|
1443
|
-
* customerId: string;
|
|
1444
|
-
* items: Array<{ productId: string; quantity: number; price: number }>;
|
|
1445
|
-
* }) {
|
|
1446
|
-
* return await this.orders.transaction(async (tx) => {
|
|
1447
|
-
* // Create the order
|
|
1448
|
-
* const order = await this.orders.create({
|
|
1449
|
-
* id: generateUUID(),
|
|
1450
|
-
* customerId: orderData.customerId,
|
|
1451
|
-
* status: 'pending',
|
|
1452
|
-
* totalAmount: orderData.items.reduce((sum, item) => sum + (item.price * item.quantity), 0)
|
|
1453
|
-
* }, { tx });
|
|
1454
|
-
*
|
|
1455
|
-
* // Create order items and update product inventory
|
|
1456
|
-
* for (const itemData of orderData.items) {
|
|
1457
|
-
* await this.orderItems.create({
|
|
1458
|
-
* id: generateUUID(),
|
|
1459
|
-
* orderId: order.id,
|
|
1460
|
-
* productId: itemData.productId,
|
|
1461
|
-
* quantity: itemData.quantity,
|
|
1462
|
-
* unitPrice: itemData.price
|
|
1463
|
-
* }, { tx });
|
|
1464
|
-
*
|
|
1465
|
-
* // Update product inventory using optimistic locking
|
|
1466
|
-
* const product = await this.products.findById(itemData.productId, { tx });
|
|
1467
|
-
* if (product.stockQuantity < itemData.quantity) {
|
|
1468
|
-
* throw new Error(`Insufficient stock for product ${itemData.productId}`);
|
|
1469
|
-
* }
|
|
1470
|
-
*
|
|
1471
|
-
* await this.products.save({
|
|
1472
|
-
* ...product,
|
|
1473
|
-
* stockQuantity: product.stockQuantity - itemData.quantity
|
|
1474
|
-
* }, { tx });
|
|
1475
|
-
* }
|
|
1476
|
-
*
|
|
1477
|
-
* return order;
|
|
1478
|
-
* });
|
|
1479
|
-
* }
|
|
1480
|
-
* }
|
|
1481
|
-
* ```
|
|
1482
|
-
*
|
|
1483
|
-
* @example
|
|
1484
|
-
* **Soft delete and audit trail:**
|
|
1485
|
-
* ```ts
|
|
1486
|
-
* const Document = $entity({
|
|
1487
|
-
* name: "documents",
|
|
1488
|
-
* schema: t.object({
|
|
1489
|
-
* id: pg.primaryKey(t.uuid()),
|
|
1490
|
-
* title: t.string(),
|
|
1491
|
-
* content: t.string(),
|
|
1492
|
-
* authorId: t.string({ format: "uuid" }),
|
|
1493
|
-
* version: pg.version(),
|
|
1494
|
-
* createdAt: pg.createdAt(),
|
|
1495
|
-
* updatedAt: pg.updatedAt(),
|
|
1496
|
-
* deletedAt: pg.deletedAt() // Enables soft delete
|
|
1497
|
-
* })
|
|
1498
|
-
* });
|
|
1499
|
-
*
|
|
1500
|
-
* class DocumentService {
|
|
1501
|
-
* documents = $repository({ table: Document });
|
|
1502
|
-
*
|
|
1503
|
-
* async updateDocument(id: string, updates: { title?: string; content?: string }) {
|
|
1504
|
-
* // This uses optimistic locking via the version field
|
|
1505
|
-
* const document = await this.documents.findById(id);
|
|
1506
|
-
* return await this.documents.save({
|
|
1507
|
-
* ...document,
|
|
1508
|
-
* ...updates // updatedAt will be set automatically
|
|
1509
|
-
* });
|
|
1510
|
-
* }
|
|
1511
|
-
*
|
|
1512
|
-
* async softDeleteDocument(id: string) {
|
|
1513
|
-
* // Soft delete - sets deletedAt timestamp
|
|
1514
|
-
* await this.documents.deleteById(id);
|
|
1515
|
-
* }
|
|
1516
|
-
*
|
|
1517
|
-
* async permanentDeleteDocument(id: string) {
|
|
1518
|
-
* // Hard delete - actually removes from database
|
|
1519
|
-
* await this.documents.deleteById(id, { force: true });
|
|
1520
|
-
* }
|
|
1521
|
-
*
|
|
1522
|
-
* async getActiveDocuments() {
|
|
1523
|
-
* // Automatically excludes soft-deleted records
|
|
1524
|
-
* return await this.documents.find({
|
|
1525
|
-
* where: { authorId: { isNotNull: true } },
|
|
1526
|
-
* orderBy: [{ column: "updatedAt", direction: "desc" }]
|
|
1527
|
-
* });
|
|
1528
|
-
* }
|
|
1529
|
-
*
|
|
1530
|
-
* async getAllDocumentsIncludingDeleted() {
|
|
1531
|
-
* // Include soft-deleted records
|
|
1532
|
-
* return await this.documents.find({}, { force: true });
|
|
1533
|
-
* }
|
|
1534
|
-
* }
|
|
1535
|
-
* ```
|
|
1536
|
-
*
|
|
1537
|
-
* @example
|
|
1538
|
-
* **Complex filtering and aggregation:**
|
|
1539
|
-
* ```ts
|
|
1540
|
-
* class AnalyticsService {
|
|
1541
|
-
* users = $repository({ table: User });
|
|
1542
|
-
* orders = $repository({ table: Order });
|
|
1543
|
-
*
|
|
1544
|
-
* async getUserStatistics(filters: {
|
|
1545
|
-
* startDate?: string;
|
|
1546
|
-
* endDate?: string;
|
|
1547
|
-
* isActive?: boolean;
|
|
1548
|
-
* }) {
|
|
1549
|
-
* const whereConditions = [];
|
|
1550
|
-
*
|
|
1551
|
-
* if (filters.startDate) {
|
|
1552
|
-
* whereConditions.push({ createdAt: { gte: filters.startDate } });
|
|
1553
|
-
* }
|
|
1554
|
-
* if (filters.endDate) {
|
|
1555
|
-
* whereConditions.push({ createdAt: { lte: filters.endDate } });
|
|
1556
|
-
* }
|
|
1557
|
-
* if (filters.isActive !== undefined) {
|
|
1558
|
-
* whereConditions.push({ isActive: filters.isActive });
|
|
1559
|
-
* }
|
|
1560
|
-
*
|
|
1561
|
-
* const totalUsers = await this.users.count({
|
|
1562
|
-
* and: whereConditions
|
|
1563
|
-
* });
|
|
1564
|
-
*
|
|
1565
|
-
* const activeUsers = await this.users.count({
|
|
1566
|
-
* and: [...whereConditions, { isActive: true }]
|
|
1567
|
-
* });
|
|
1568
|
-
*
|
|
1569
|
-
* // Complex aggregation query
|
|
1570
|
-
* const recentActivity = await this.users.query(
|
|
1571
|
-
* sql`
|
|
1572
|
-
* SELECT
|
|
1573
|
-
* DATE_TRUNC('day', created_at) as date,
|
|
1574
|
-
* COUNT(*) as new_users,
|
|
1575
|
-
* COUNT(*) FILTER (WHERE is_active = true) as active_users
|
|
1576
|
-
* FROM users
|
|
1577
|
-
* WHERE created_at >= NOW() - INTERVAL '30 days'
|
|
1578
|
-
* GROUP BY DATE_TRUNC('day', created_at)
|
|
1579
|
-
* ORDER BY date DESC
|
|
1580
|
-
* `
|
|
1581
|
-
* );
|
|
1582
|
-
*
|
|
1583
|
-
* return {
|
|
1584
|
-
* totalUsers,
|
|
1585
|
-
* activeUsers,
|
|
1586
|
-
* inactiveUsers: totalUsers - activeUsers,
|
|
1587
|
-
* recentActivity
|
|
1588
|
-
* };
|
|
1589
|
-
* }
|
|
1590
|
-
* }
|
|
1591
|
-
* ```
|
|
1592
|
-
*
|
|
1593
|
-
* @stability 3
|
|
1594
1394
|
*/
|
|
1595
1395
|
declare const $repository: {
|
|
1596
1396
|
<EntityTableConfig extends TableConfig, EntitySchema extends TObject>(optionsOrTable: RepositoryDescriptorOptions<EntityTableConfig, EntitySchema> | PgTableWithColumnsAndSchema<EntityTableConfig, EntitySchema>): RepositoryDescriptor<EntityTableConfig, EntitySchema>;
|
|
@@ -1623,8 +1423,8 @@ interface RepositoryDescriptorOptions<EntityTableConfig extends TableConfig, Ent
|
|
|
1623
1423
|
* name: "users",
|
|
1624
1424
|
* schema: t.object({
|
|
1625
1425
|
* id: pg.primaryKey(t.uuid()),
|
|
1626
|
-
* email: t.
|
|
1627
|
-
* name: t.
|
|
1426
|
+
* email: t.text({ format: "email" }),
|
|
1427
|
+
* name: t.text()
|
|
1628
1428
|
* })
|
|
1629
1429
|
* });
|
|
1630
1430
|
*
|
|
@@ -1753,7 +1553,7 @@ declare class RepositoryDescriptor<EntityTableConfig extends TableConfig, Entity
|
|
|
1753
1553
|
* @param opts The statement options.
|
|
1754
1554
|
* @returns The found entity.
|
|
1755
1555
|
*/
|
|
1756
|
-
findOne<T extends
|
|
1556
|
+
findOne<T extends EntitySchema = EntitySchema>(where: PgQueryWhereOrSQL<T>, opts?: StatementOptions): Promise<Static<EntitySchema>>;
|
|
1757
1557
|
/**
|
|
1758
1558
|
* Find an entity by ID.
|
|
1759
1559
|
*/
|
|
@@ -1765,7 +1565,7 @@ declare class RepositoryDescriptor<EntityTableConfig extends TableConfig, Entity
|
|
|
1765
1565
|
count?: boolean;
|
|
1766
1566
|
}): Promise<Page<Static<EntitySchema>>>;
|
|
1767
1567
|
createQuery(query?: PgQuery<EntitySchema>): PgQuery<EntitySchema>;
|
|
1768
|
-
createQueryWhere(where?: PgQueryWhere<
|
|
1568
|
+
createQueryWhere(where?: PgQueryWhere<EntitySchema>): PgQueryWhere<EntitySchema>;
|
|
1769
1569
|
/**
|
|
1770
1570
|
* Create an entity.
|
|
1771
1571
|
*
|
|
@@ -1785,7 +1585,7 @@ declare class RepositoryDescriptor<EntityTableConfig extends TableConfig, Entity
|
|
|
1785
1585
|
/**
|
|
1786
1586
|
* Find an entity and update it.
|
|
1787
1587
|
*/
|
|
1788
|
-
updateOne(where: PgQueryWhereOrSQL<
|
|
1588
|
+
updateOne(where: PgQueryWhereOrSQL<EntitySchema>, data: Partial<Static<TObjectUpdate<EntitySchema>>>, opts?: StatementOptions): Promise<Static<EntitySchema>>;
|
|
1789
1589
|
/**
|
|
1790
1590
|
* Save a given entity.
|
|
1791
1591
|
*
|
|
@@ -1815,11 +1615,11 @@ declare class RepositoryDescriptor<EntityTableConfig extends TableConfig, Entity
|
|
|
1815
1615
|
/**
|
|
1816
1616
|
* Find many entities and update all of them.
|
|
1817
1617
|
*/
|
|
1818
|
-
updateMany(where: PgQueryWhereOrSQL<
|
|
1618
|
+
updateMany(where: PgQueryWhereOrSQL<EntitySchema>, data: Partial<Static<TObjectUpdate<EntitySchema>>>, opts?: StatementOptions): Promise<void>;
|
|
1819
1619
|
/**
|
|
1820
1620
|
* Find many and delete all of them.
|
|
1821
1621
|
*/
|
|
1822
|
-
deleteMany(where?:
|
|
1622
|
+
deleteMany(where?: PgQueryWhereOrSQL<EntitySchema>, opts?: StatementOptions): Promise<void>;
|
|
1823
1623
|
/**
|
|
1824
1624
|
* Delete all entities.
|
|
1825
1625
|
*/
|
|
@@ -1833,7 +1633,7 @@ declare class RepositoryDescriptor<EntityTableConfig extends TableConfig, Entity
|
|
|
1833
1633
|
/**
|
|
1834
1634
|
* Find an entity and delete it.
|
|
1835
1635
|
*/
|
|
1836
|
-
deleteOne(where?:
|
|
1636
|
+
deleteOne(where?: PgQueryWhereOrSQL<EntitySchema>, opts?: StatementOptions): Promise<void>;
|
|
1837
1637
|
/**
|
|
1838
1638
|
* Find an entity by ID and delete it.
|
|
1839
1639
|
*/
|
|
@@ -1841,12 +1641,12 @@ declare class RepositoryDescriptor<EntityTableConfig extends TableConfig, Entity
|
|
|
1841
1641
|
/**
|
|
1842
1642
|
* Count entities.
|
|
1843
1643
|
*/
|
|
1844
|
-
count(where?: PgQueryWhereOrSQL<
|
|
1644
|
+
count(where?: PgQueryWhereOrSQL<EntitySchema>, opts?: StatementOptions): Promise<number>;
|
|
1845
1645
|
protected conflictMessagePattern: string;
|
|
1846
1646
|
protected handleError(error: unknown, message: string): PgError;
|
|
1847
|
-
protected withDeletedAt(where: PgQueryWhereOrSQL<
|
|
1647
|
+
protected withDeletedAt(where: PgQueryWhereOrSQL<EntitySchema>, opts?: {
|
|
1848
1648
|
force?: boolean;
|
|
1849
|
-
}): PgQueryWhereOrSQL<
|
|
1649
|
+
}): PgQueryWhereOrSQL<EntitySchema>;
|
|
1850
1650
|
protected get organization(): undefined;
|
|
1851
1651
|
protected deletedAt(): PgAttrField | undefined;
|
|
1852
1652
|
/**
|
|
@@ -1856,7 +1656,7 @@ declare class RepositoryDescriptor<EntityTableConfig extends TableConfig, Entity
|
|
|
1856
1656
|
* @param schema The schema to use.
|
|
1857
1657
|
* @param col The column to use.
|
|
1858
1658
|
*/
|
|
1859
|
-
protected jsonQueryToSql(query: PgQueryWhereOrSQL<
|
|
1659
|
+
protected jsonQueryToSql(query: PgQueryWhereOrSQL<EntitySchema>, schema?: TObject, col?: (key: string) => PgColumn): SQL | undefined;
|
|
1860
1660
|
/**
|
|
1861
1661
|
* Map a filter operator to a SQL query.
|
|
1862
1662
|
*
|
|
@@ -1921,7 +1721,7 @@ declare class RepositoryDescriptor<EntityTableConfig extends TableConfig, Entity
|
|
|
1921
1721
|
* @param id The ID to get the where clause for.
|
|
1922
1722
|
* @returns The where clause for the ID.
|
|
1923
1723
|
*/
|
|
1924
|
-
protected getWhereId(id: string | number):
|
|
1724
|
+
protected getWhereId(id: string | number): PgQueryWhereOrSQL<EntitySchema>;
|
|
1925
1725
|
/**
|
|
1926
1726
|
* Find a primary key in the schema.
|
|
1927
1727
|
*
|
|
@@ -2498,7 +2298,9 @@ declare class DrizzleKitProvider {
|
|
|
2498
2298
|
* @returns A promise that resolves once the migrations have been executed.
|
|
2499
2299
|
*/
|
|
2500
2300
|
synchronize(provider: PostgresProvider, schema?: string): Promise<void>;
|
|
2501
|
-
|
|
2301
|
+
/**
|
|
2302
|
+
* Get all tables from the provider's repositories.
|
|
2303
|
+
*/
|
|
2502
2304
|
protected getTables(provider: PostgresProvider, schema?: string): Promise<Record<string, any>>;
|
|
2503
2305
|
protected loadMigrationSnapshot(provider: PostgresProvider): Promise<any>;
|
|
2504
2306
|
protected saveMigrationSnapshot(provider: PostgresProvider, curr: Record<string, any>, entry?: {
|
|
@@ -2511,14 +2313,15 @@ declare class DrizzleKitProvider {
|
|
|
2511
2313
|
* Try to load the official Drizzle Kit API.
|
|
2512
2314
|
* If not available, fallback to the local kit import.
|
|
2513
2315
|
*/
|
|
2514
|
-
protected importDrizzleKit():
|
|
2316
|
+
protected importDrizzleKit(): typeof DrizzleKit;
|
|
2317
|
+
synchronizeSqlite(provider: PostgresProvider): Promise<void>;
|
|
2515
2318
|
}
|
|
2516
2319
|
//#endregion
|
|
2517
2320
|
//#region src/providers/drivers/NodePostgresProvider.d.ts
|
|
2518
2321
|
declare module "alepha" {
|
|
2519
2322
|
interface Env extends Partial<Static<typeof envSchema>> {}
|
|
2520
2323
|
}
|
|
2521
|
-
declare const envSchema: TObject<{
|
|
2324
|
+
declare const envSchema: _alepha_core1.TObject<{
|
|
2522
2325
|
/**
|
|
2523
2326
|
* Main configuration for database connection.
|
|
2524
2327
|
* Accept a string in the format of a Postgres connection URL.
|
|
@@ -2580,18 +2383,11 @@ declare class NodePostgresProvider extends PostgresProvider {
|
|
|
2580
2383
|
*/
|
|
2581
2384
|
get schema(): string;
|
|
2582
2385
|
get db(): PostgresJsDatabase;
|
|
2583
|
-
protected readonly
|
|
2584
|
-
protected readonly
|
|
2585
|
-
execute<T extends TObject | undefined = undefined>(query: SQLLike, schema?: T): Promise<Array<T extends TObject ? Static<T> : any>>;
|
|
2386
|
+
protected readonly onStart: _alepha_core1.HookDescriptor<"start">;
|
|
2387
|
+
protected readonly onStop: _alepha_core1.HookDescriptor<"stop">;
|
|
2586
2388
|
connect(): Promise<void>;
|
|
2587
2389
|
close(): Promise<void>;
|
|
2588
2390
|
protected migrate: _alepha_lock0.LockDescriptor<() => Promise<void>>;
|
|
2589
|
-
protected createClient(): {
|
|
2590
|
-
client: postgres.Sql<{}>;
|
|
2591
|
-
db: PostgresJsDatabase<Record<string, never>> & {
|
|
2592
|
-
$client: postgres.Sql<{}>;
|
|
2593
|
-
};
|
|
2594
|
-
};
|
|
2595
2391
|
/**
|
|
2596
2392
|
* Generate a minimal migration configuration.
|
|
2597
2393
|
*/
|
|
@@ -2605,12 +2401,8 @@ declare class NodePostgresProvider extends PostgresProvider {
|
|
|
2605
2401
|
* For testing purposes, generate a unique schema name.
|
|
2606
2402
|
* The schema name will be generated based on the current date and time.
|
|
2607
2403
|
* It will be in the format of `test_YYYYMMDD_HHMMSS_randomSuffix`.
|
|
2608
|
-
*
|
|
2609
|
-
* TODO: investigate for adding the test file name to the schema name if possible.
|
|
2610
|
-
* TODO: options to skip deletion on failure, in order to inspect the schema?
|
|
2611
2404
|
*/
|
|
2612
2405
|
protected generateTestSchemaName(): string;
|
|
2613
|
-
protected mapResult<T extends TObject = any>(result: Array<any>, schema?: T): Array<T extends TObject ? Static<T> : any>;
|
|
2614
2406
|
}
|
|
2615
2407
|
//#endregion
|
|
2616
2408
|
//#region src/providers/PostgresTypeProvider.d.ts
|
|
@@ -2681,6 +2473,8 @@ declare class PostgresTypeProvider {
|
|
|
2681
2473
|
* It's used by {@link RepositoryDescriptor#paginate} method.
|
|
2682
2474
|
*/
|
|
2683
2475
|
readonly page: <T extends TObject>(resource: T, options?: TObjectOptions) => TPage<T>;
|
|
2476
|
+
readonly many: <T extends TObject, Config extends TableConfig>(table: PgTableWithColumnsAndSchema<Config, T>, foreignKey: keyof T["properties"]) => TOptionalAdd<PgAttr<PgAttr<TArray<T>, PgMany>, PgDefault>>;
|
|
2477
|
+
readonly one: <T extends TObject, Config extends TableConfig>(table: PgTableWithColumnsAndSchema<Config, T>, foreignKey: keyof T["properties"]) => PgAttr<PgAttr<TOptionalAdd<T>, PgOne>, PgDefault>;
|
|
2684
2478
|
}
|
|
2685
2479
|
declare const pg: PostgresTypeProvider;
|
|
2686
2480
|
//#endregion
|
|
@@ -2712,8 +2506,8 @@ declare const schema: <TDocument extends TSchema$1>(name: string, document: TDoc
|
|
|
2712
2506
|
* name: "users",
|
|
2713
2507
|
* schema: t.object({
|
|
2714
2508
|
* id: pg.primaryKey(),
|
|
2715
|
-
* name: t.
|
|
2716
|
-
* email: t.
|
|
2509
|
+
* name: t.text(),
|
|
2510
|
+
* email: t.text(),
|
|
2717
2511
|
* }),
|
|
2718
2512
|
* });
|
|
2719
2513
|
*
|
|
@@ -2746,5 +2540,5 @@ declare const schema: <TDocument extends TSchema$1>(name: string, document: TDoc
|
|
|
2746
2540
|
*/
|
|
2747
2541
|
declare const AlephaPostgres: _alepha_core1.Service<_alepha_core1.Module<{}>>;
|
|
2748
2542
|
//#endregion
|
|
2749
|
-
export { $entity, $repository, $sequence, $transaction, AlephaPostgres, DrizzleKitProvider, Entity, EntityDescriptorOptions, FilterOperators, FromSchema, NodePostgresProvider, NodePostgresProviderOptions, OrderBy, OrderByClause, OrderDirection, PG_CREATED_AT, PG_DEFAULT, PG_DELETED_AT, PG_IDENTITY, PG_PRIMARY_KEY, PG_REF, PG_SCHEMA, PG_SERIAL, PG_UPDATED_AT, PG_VERSION, Page, PageQuery, PgDefault, PgEntityNotFoundError, PgIdentityOptions, PgPrimaryKey, PgQuery,
|
|
2543
|
+
export { $entity, $repository, $sequence, $transaction, AlephaPostgres, DrizzleKitProvider, Entity, EntityDescriptorOptions, ExtractManyRelations, FilterOperators, FromSchema, NodePostgresProvider, NodePostgresProviderOptions, OrderBy, OrderByClause, OrderDirection, PG_CREATED_AT, PG_DEFAULT, PG_DELETED_AT, PG_IDENTITY, PG_MANY, PG_ONE, PG_PRIMARY_KEY, PG_REF, PG_SCHEMA, PG_SERIAL, PG_UPDATED_AT, PG_VERSION, Page, PageQuery, PgDefault, PgEntityNotFoundError, PgIdentityOptions, PgMany, PgManyOptions, PgOne, PgPrimaryKey, PgQuery, PgQueryWhere, PgQueryWhereOrSQL, PgQueryWhereWithMany, PgQueryWhereWithManyOrSQL, PgQueryWithMany, PgQueryWithMap, PgQueryWithOne, PgRef, PgRefOptions, PgSymbolKeys, PgSymbols, PgTableConfig, PgTableWithColumnsAndSchema, PostgresProvider, PostgresTypeProvider, RelField, RemoveManyRelations, RepositoryDescriptor, RepositoryDescriptorOptions, RepositoryProvider, SQLLike, SequenceDescriptor, SequenceDescriptorOptions, StatementOptions, TObjectInsert, TObjectUpdate, TPage, TransactionContext, TransactionDescriptorOptions, camelToSnakeCase, drizzle_orm6 as drizzle, insertSchema, legacyIdSchema, mapFieldToColumn, mapStringToColumn, pageQuerySchema, pageSchema, pg, schema, schemaToPgColumns, sql, updateSchema };
|
|
2750
2544
|
//# sourceMappingURL=index.d.ts.map
|