Postgres module

generate_schema

procedure · 1 overloadsince 0.27.0Source

Reads the catalog of the migrations' schema database (see schema_databases.jai) on the server config names, building it first when there is none, and returns the text of db/schema.jai; or what went wrong. Runs on a fiber, like every call that talks to the server.

generate_schema :: (
    config: Config,
    migrations_folder: string
) -> (source: string, problem: string)

Reads the catalog of the migrations' schema database (see schema_databases.jai) on the server config names, building it first when there is none, and returns the text of db/schema.jai; or what went wrong. 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.

Returns

source: string
problem: string

See also