Skip to content
Oxford Harrison edited this page Nov 19, 2024 · 6 revisions

DOCSCLI


Command: linkedql commit

Interactively commit your local file changes to your DB.

What it does: looks through your local schema file and diffs against your active database structure to see what changed, and commits said changes; works interactively by default and lets you preview each query to be run.

See related ➞ linkedql rollback, linkedql rollforward

Usage

npx linkedql commit

Use the --desc flag to provide a commit description:

npx linkedql commit --desc="Initial DB creation"

Note

The --desc flag will be required if the Linked DB's config.require_commit_descs is active.

If you ommit the --desc flag in this instance, you are prompted for a commit description on a db-by-db basis. This can be useful, depending!

Use the --cascade-rule flag to drop objects with a CASCADE or RESTRICT clause (PostgreSQL):

npx linkedql commit --desc="Initial DB creation" --cascade-rule=CASCADE

Use the --select flag to explicitly list local schemas to commit:

npx linkedql commit --select=database_1,database_3 --desc="Initial DB creations"

Note

In this case, any changes ommitted by the selection are discarded!

Use the --quiet flag to turn off SQL previews:

npx linkedql commit --quiet
Clone this wiki locally