Postgres module

diff_schema

procedure · 1 overloadsince 0.27.0Source

Reads the catalog of the migrations' schema database (see schema_databases.jai), compares it with the structs in schema_file, and returns the proposed SQL; or what went wrong. An empty sql means nothing differs. Runs on a fiber, like every call that talks to the server.

diff_schema :: (
    config: Config,
    migrations_folder: string,
    schema_file: string
) -> (Migration_Proposal, problem: string)

Reads the catalog of the migrations' schema database (see schema_databases.jai), compares it with the structs in schema_file, and returns the proposed SQL; or what went wrong. An empty sql means nothing differs. Runs on a fiber, like every call that talks to the server.

Parameters

config: Config
the server to build the migrations' schema database on.
migrations_folder: string
the folder of migration .sql files.
schema_file: string
the path of db/schema.jai.

Returns

problem: string

See also