@spfn/core 0.2.0-beta.26 → 0.2.0-beta.28
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/dist/db/index.d.ts +3 -3
- package/dist/db/index.js +3 -3
- package/dist/db/index.js.map +1 -1
- package/dist/job/index.js +12 -0
- package/dist/job/index.js.map +1 -1
- package/dist/server/index.js +12 -0
- package/dist/server/index.js.map +1 -1
- package/package.json +1 -1
package/dist/db/index.d.ts
CHANGED
|
@@ -483,7 +483,7 @@ declare function timestamps(): {
|
|
|
483
483
|
/**
|
|
484
484
|
* Foreign key reference to another table
|
|
485
485
|
*
|
|
486
|
-
* Creates a
|
|
486
|
+
* Creates a bigint column with cascade delete.
|
|
487
487
|
* Type-safe: ensures the reference points to a valid PostgreSQL column.
|
|
488
488
|
*
|
|
489
489
|
* @param name - Column name (e.g., 'author' creates 'author_id')
|
|
@@ -503,7 +503,7 @@ declare function timestamps(): {
|
|
|
503
503
|
*/
|
|
504
504
|
declare function foreignKey<T extends PgColumn>(name: string, reference: () => T, options?: {
|
|
505
505
|
onDelete?: 'cascade' | 'set null' | 'restrict' | 'no action';
|
|
506
|
-
}): drizzle_orm.NotNull<drizzle_orm_pg_core.
|
|
506
|
+
}): drizzle_orm.NotNull<drizzle_orm_pg_core.PgBigInt53BuilderInitial<`${string}_id`>>;
|
|
507
507
|
/**
|
|
508
508
|
* Optional foreign key reference (nullable)
|
|
509
509
|
*
|
|
@@ -523,7 +523,7 @@ declare function foreignKey<T extends PgColumn>(name: string, reference: () => T
|
|
|
523
523
|
*/
|
|
524
524
|
declare function optionalForeignKey<T extends PgColumn>(name: string, reference: () => T, options?: {
|
|
525
525
|
onDelete?: 'cascade' | 'set null' | 'restrict' | 'no action';
|
|
526
|
-
}): drizzle_orm_pg_core.
|
|
526
|
+
}): drizzle_orm_pg_core.PgBigInt53BuilderInitial<`${string}_id`>;
|
|
527
527
|
/**
|
|
528
528
|
* UUID primary key
|
|
529
529
|
*
|
package/dist/db/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { QueryError, ConnectionError, DeadlockError, TransactionError, Constrain
|
|
|
6
6
|
import { parseNumber, parseBoolean } from '@spfn/core/env';
|
|
7
7
|
import { existsSync, readFileSync, readdirSync, statSync } from 'fs';
|
|
8
8
|
import { join, dirname, basename } from 'path';
|
|
9
|
-
import { bigserial, timestamp, uuid as uuid$1, text, jsonb, pgSchema } from 'drizzle-orm/pg-core';
|
|
9
|
+
import { bigserial, timestamp, bigint, uuid as uuid$1, text, jsonb, pgSchema } from 'drizzle-orm/pg-core';
|
|
10
10
|
import { AsyncLocalStorage } from 'async_hooks';
|
|
11
11
|
import { createMiddleware } from 'hono/factory';
|
|
12
12
|
import { randomUUID } from 'crypto';
|
|
@@ -1125,10 +1125,10 @@ function timestamps() {
|
|
|
1125
1125
|
};
|
|
1126
1126
|
}
|
|
1127
1127
|
function foreignKey(name, reference, options) {
|
|
1128
|
-
return
|
|
1128
|
+
return bigint(`${name}_id`, { mode: "number" }).notNull().references(reference, { onDelete: options?.onDelete ?? "cascade" });
|
|
1129
1129
|
}
|
|
1130
1130
|
function optionalForeignKey(name, reference, options) {
|
|
1131
|
-
return
|
|
1131
|
+
return bigint(`${name}_id`, { mode: "number" }).references(reference, { onDelete: options?.onDelete ?? "set null" });
|
|
1132
1132
|
}
|
|
1133
1133
|
function uuid() {
|
|
1134
1134
|
return uuid$1("id").defaultRandom().primaryKey();
|