import type pg from "pg-promise/typescript/pg-subset"; import type { SQLHandler } from "prostgles-types"; import type { DB, Prostgles } from "../Prostgles"; import type { Join } from "../ProstglesTypes"; import { PubSubManager } from "../PubSubManager/PubSubManager"; import type { PublishParser } from "../PublishParser/PublishParser"; import type { Graph } from "../shortestPath"; import type { DBHandlerServer, DbTxTableHandlers, SQLHandlerServer, TableSchema, TxCB } from "./DboBuilderTypes"; import { QueryStreamer } from "./QueryStreamer"; import { TableHandler } from "./TableHandler/TableHandler"; import type { JoinPaths } from "./ViewHandler/ViewHandler"; import type { PGConstraint } from "./dboBuilderUtils"; import { type getDbTypes } from "./runSql/runSqlUtils"; export * from "./DboBuilderTypes"; export * from "./dboBuilderUtils"; export declare class DboBuilder { tablesOrViews?: TableSchema[]; /** * Used in obtaining column names for error messages */ constraints?: PGConstraint[]; db: DB; /** * @deprecated * Use dboMap instead. Will be removed in future versions. */ dbo: DBHandlerServer; dboMap: Map; /** * Undefined if cannot create table triggers */ private _pubSubManager?; /** * Used for db.sql field type details */ dbTypesCache?: Awaited>; DATA_TYPES_DBKEY: string; queryStreamer: QueryStreamer; get tables(): TableSchema[]; getDetailedFieldInfo: (fields: pg.IColumn[]) => Promise<{ tsDataType: "string" | "number" | "boolean" | "number[]" | "boolean[]" | "string[]" | "any[]" | "any"; dataType: import("prostgles-types").PG_COLUMN_UDT_DATA_TYPE; udt_name: import("prostgles-types").PG_COLUMN_UDT_DATA_TYPE; tableName: string | undefined; tableSchema: string | undefined; columnName: string | undefined; name: string; oid: number; dataTypeID: number; tableID: number; columnID: number; dataTypeSize: number; dataTypeModifier: number; format: string; }[]>; getPubSubManagerPromise?: Promise; getPubSubManager: () => Promise; tableTsDefinitions?: string; functionTsDefinitions?: string; joinGraph?: Graph; private shortestJoinPaths; prostgles: Prostgles; publishParser?: PublishParser; onSchemaChange?: (event: { command: string; query: string; }) => void; private constructor(); private init; static create: (prostgles: Prostgles) => Promise; destroy(): Promise | undefined; _joins?: Join[]; get joins(): Join[]; set joins(j: Join[]); getAllJoinPaths(): JoinPaths; prepareShortestJoinPaths: () => Promise; sql: SQLHandler; runSQL: SQLHandlerServer; canSubscribe: boolean; checkingCanSubscribe: boolean; build(): Promise; getSchema: () => TableSchema[]; getTsDefinitions: ({ excludeFunctions, extraTables, ddlWithRollback, }?: { excludeFunctions?: boolean; extraTables?: TableSchema[]; /** * Optionally provide a TRUSTED DDL statement obtain an updated schema after applying the DDL. * It is crucial that the statement is trusted and does not container commits. * This is useful for generating an updated TypeScript schema after running a migration SQL file, for example. * Note that this will be run within a transaction that is rolled back, so it SHOULD not affect the actual database schema. */ ddlWithRollback?: DDL; }) => DDL extends string ? Promise<{ tsSchema: string; tablesOrViews: TableSchema[]; }> : { tsSchema: string; tablesOrViews: TableSchema[]; }; getShortestJoinPath: (viewHandler: TableHandler, target: string) => JoinPaths[number] | undefined; getTX: (cb: TxCB | R, TH>) => Promise; cacheDBTypes: (force?: boolean | undefined) => Promise<{ dataTypesMap: Map; userTablesMap: Map; userTableColumnsMap: Map; }>; } //# sourceMappingURL=DboBuilder.d.ts.map