CoolFace
Apppublic

AK-21/Graphite-Industrial-Intelligence

sourceHugging Faceupdated 3mo agoView on Hugging Face
0likes
utils.d.ts56 linesDownload Raw Back to gel-core
1import { SQL } from "../sql/sql.js";2import { Subquery } from "../subquery.js";3import { type Check } from "./checks.js";4import type { AnyGelColumn } from "./columns/index.js";5import { type ForeignKey } from "./foreign-keys.js";6import type { Index } from "./indexes.js";7import { GelPolicy } from "./policies.js";8import { type PrimaryKey } from "./primary-keys.js";9import { GelTable } from "./table.js";10import { type UniqueConstraint } from "./unique-constraint.js";11import type { GelViewBase } from "./view-base.js";12import { type GelMaterializedView, type GelView } from "./view.js";13export declare function getTableConfig<TTable extends GelTable>(table: TTable): {14    columns: import("./index.js").GelColumn<import("../column.js").ColumnBaseConfig<import("../column-builder.js").ColumnDataType, string>, {}, {}>[];15    indexes: Index[];16    foreignKeys: ForeignKey[];17    checks: Check[];18    primaryKeys: PrimaryKey[];19    uniqueConstraints: UniqueConstraint[];20    name: string;21    schema: string | undefined;22    policies: GelPolicy[];23    enableRLS: boolean;24};25export declare function extractUsedTable(table: GelTable | Subquery | GelViewBase | SQL): string[];26export declare function getViewConfig<TName extends string = string, TExisting extends boolean = boolean>(view: GelView<TName, TExisting>): {27    with?: import("./view.js").ViewWithConfig;28    name: TName;29    originalName: TName;30    schema: string | undefined;31    selectedFields: import("../sql/sql.js").ColumnsSelection;32    isExisting: TExisting;33    query: TExisting extends true ? undefined : SQL<unknown>;34    isAlias: boolean;35};36export declare function getMaterializedViewConfig<TName extends string = string, TExisting extends boolean = boolean>(view: GelMaterializedView<TName, TExisting>): {37    with?: import("./view.js").GelMaterializedViewWithConfig;38    using?: string;39    tablespace?: string;40    withNoData?: boolean;41    name: TName;42    originalName: TName;43    schema: string | undefined;44    selectedFields: import("../sql/sql.js").ColumnsSelection;45    isExisting: TExisting;46    query: TExisting extends true ? undefined : SQL<unknown>;47    isAlias: boolean;48};49export type ColumnsWithTable<TTableName extends string, TForeignTableName extends string, TColumns extends AnyGelColumn<{50    tableName: TTableName;51}>[]> = {52    [Key in keyof TColumns]: AnyGelColumn<{53        tableName: TForeignTableName;54    }>;55};56