UNPKG

@adonisjs/lucid

Version:

SQL ORM built on top of Active Record pattern

37 lines (36 loc) 1.45 kB
import { BaseSchemaState } from '../base_schema_state.js'; import { type PostgreConfig, type QueryClientContract } from '../../../types/database.js'; /** * PostgreSQL schema dumps are delegated to `pg_dump`. */ export declare class PgSchemaState extends BaseSchemaState { #private; constructor(client: QueryClientContract, connectionConfig: PostgreConfig, schemaTableName: string, schemaVersionsTableName: string); /** * Dump the structural schema using `pg_dump`. */ protected dumpSchema(path: string): Promise<void>; /** * Dump Lucid's migration bookkeeping tables with `pg_dump --data-only`. * * PostgreSQL cannot rely on the generic metadata dumper from the base class. * That path appends plain `INSERT` statements, but it does not update the * `serial` sequence backing `adonis_schema.id`. Dumping these tables through * `pg_dump` keeps the restore native to Postgres and preserves the sequence * state needed by future migration inserts. */ protected dumpMigrationMetadata(): Promise<string>; /** * Load the schema dump using `psql`. */ load(path: string): Promise<void>; /** * Remove session-level settings that are not understood by older PostgreSQL * server versions. */ private removeUnsupportedSessionSettings; /** * Normalize the final SQL dump before it is consumed by `psql`. */ private normalizeDump; }