import { PgColumn, PgTable } from '../abstractions'; import { ContentEntityModel } from '../content-entity-model'; export declare function buildFullTableName(tableName: string, schema?: string): string; /** * Builds a DROP TABLE IF EXISTS statement. * @param table */ export declare function buildDropTableIfExists(table: PgTable): string; /** * Builds a CREATE TABLE statement. * @param table - PgTable instance to build the CREATE TABLE statement for. */ export declare function buildCreateTable(table: PgTable): string; /** * Builds a GRANT statement for INSERTs and UPDATEs. * @param table - PgTable instance to build the GRANT statement for. */ export declare function buildInsertUpdateGrants(table: PgTable): string; /** * Builds a GRANT statement for SELECTs and DELETEs. * @param table - PgTable instance to build the GRANT statement for. */ export declare function buildSelectDeleteGrants(table: PgTable): string; /** * Builds additional statements relevant for table creation * that should be executed after CRATE TABLE e.g. adding indexes or comments. * @param table - PgTable instance to build extra statements for. */ export declare function buildAdditionalTableStatements(table: PgTable): string[]; /** * Formats an SQL string using pg-formatter. * @param sql - Input SQL string. */ export declare function formatSql(sql: string): string; /** * Generates a migration for graphile-migrate. * @param statements - Array of SQL statements. * @param outPath - Path where the dump is created. */ export declare function generateMigration(statements: string[], outPath: string): Promise; /** * Combines `nameParts` into a single snake case string. * @param nameParts - Name parts to combine. */ export declare function buildName(...nameParts: string[]): string; export declare function renameDbItem(item: PgTable | PgColumn, newName: string, displayName?: string): void; export interface NameOverride { [name: string]: [string, string?]; } export declare function applyNameOverrides(model: ContentEntityModel, overrides: NameOverride): void; export declare function isReservedPgWord(s: string): boolean;