UNPKG

@clickup/pg-microsharding

Version:
40 lines 1.44 kB
export interface TableInfo { /** Raw schema name (unquoted). */ schema: string; /** Raw table name (unquoted). */ name: string; /** Raw owner name (unquoted). */ owner: string; /** Whether this is a base table for a partitioned table. Such tables have no * data and must not be mentioned in publications. */ isPartitioned: boolean; /** Existing index that can be used on the subscriber end to identify the rows * for received updates and deletes. */ identity: { /** Index name. */ indexName: string; /** Whether the index is a replica identity. */ isReplIdent: boolean; /** Whether the index is a primary key. */ isPrimaryKey: boolean; /** Index definition. */ def: string; } | null; } /** * Returns all tables in a given schema on fromDsn. * * For logical subscription purposes, we only need the `tables` that may * potentially contain data (e.g. regular tables, or partitions). But we also * return the base tables for partitioned tables in `partitionedTables`, since * we validate the primary key coverage in `validatePrimaryKeysFromDump()` for sanity * checking purposes. */ export declare function getTablesInSchema({ fromDsn, schema, }: { fromDsn: string; schema: string; }): Promise<{ tables: TableInfo[]; partitionedTables: TableInfo[]; }>; //# sourceMappingURL=getTablesInSchema.d.ts.map