TenantAtlas/apps/platform/.pnpm-store/v10/files/41/338556bd1544782351fe2d460d058390f209a774875b8f51d71cd14a7a29ad87f9bb3a917492bbd4a9b4daf622b8f39800d9405cc7c8771f27bc9b232e2309
Ahmed Darrazi 9f74f7a658
Some checks failed
PR Fast Feedback / fast-feedback (pull_request) Failing after 51s
feat: compress governance operator outcomes
2026-04-19 14:15:11 +02:00

49 lines
1.7 KiB
Plaintext

import { entityKind } from "../entity.cjs";
import type { AnyGelColumn, GelColumn } from "./columns/index.cjs";
import type { GelTable } from "./table.cjs";
export type UpdateDeleteAction = 'cascade' | 'restrict' | 'no action' | 'set null' | 'set default';
export type Reference = () => {
readonly name?: string;
readonly columns: GelColumn[];
readonly foreignTable: GelTable;
readonly foreignColumns: GelColumn[];
};
export declare class ForeignKeyBuilder {
static readonly [entityKind]: string;
constructor(config: () => {
name?: string;
columns: GelColumn[];
foreignColumns: GelColumn[];
}, actions?: {
onUpdate?: UpdateDeleteAction;
onDelete?: UpdateDeleteAction;
} | undefined);
onUpdate(action: UpdateDeleteAction): this;
onDelete(action: UpdateDeleteAction): this;
}
export type AnyForeignKeyBuilder = ForeignKeyBuilder;
export declare class ForeignKey {
readonly table: GelTable;
static readonly [entityKind]: string;
readonly reference: Reference;
readonly onUpdate: UpdateDeleteAction | undefined;
readonly onDelete: UpdateDeleteAction | undefined;
constructor(table: GelTable, builder: ForeignKeyBuilder);
getName(): string;
}
type ColumnsWithTable<TTableName extends string, TColumns extends GelColumn[]> = {
[Key in keyof TColumns]: AnyGelColumn<{
tableName: TTableName;
}>;
};
export declare function foreignKey<TTableName extends string, TForeignTableName extends string, TColumns extends [AnyGelColumn<{
tableName: TTableName;
}>, ...AnyGelColumn<{
tableName: TTableName;
}>[]]>(config: {
name?: string;
columns: TColumns;
foreignColumns: ColumnsWithTable<TForeignTableName, TColumns>;
}): ForeignKeyBuilder;
export {};