Skip to content
Oxford Harrison edited this page Nov 9, 2024 · 20 revisions

The Linked QL CLI is a beautiful little utility that comes with your Linked QL installation. It gives you a seamless command-line interface over some of Linked QL's most powerful features: Automatic Schema Savepoints and Rollbacks and Diff-Based Migrations!

The command name is linkedql abd its assiciated commands are:

Command Description
linkedql commit Interactively commit local chnages to your database.
linkedql rollback Interactively roll back latest changes on your database.
linkedql rollforward Interactively roll forward from latest rollback.
linkedql restore Alias of linkedql rollback and linkedql rollforward.
linkedql refresh Refresh local schema file to reflect active database structure.
linkedql generate Generate arbitrary schemas into local schema file.
linkedql savepoints Display a table of latest savepoints across databases.
linkedql dump-histories Dump savepoints to a histories file.
linkedql clear-histories Permanently erase savepoint histories.
linkedql replicate Replicate schema histories in a second database.

Some commands have been renamed from earlier versions of Linked QL (< 0.2.x):

  • linkedql migrate -> linkedql commit
  • linkedql state -> linkedql savepoints

Flags have changed significantly. You're are encouraged to migrate to Linked QL 0.2.

Usage

The linkedql command operates at the scope of your Linked QL installation, and so, for non-global installation of Linked QL, you'll need the npx prefix to run. E.g.

npx linkedql commit

If you have chosen a different location for your "database" directory (where you have your schema.json and driver.js files defined) other than the default ./database location, you can use the --dir flag along with each command to point Linked QL to this location:

npx linkedql commit --dir="./src/database-stuff"

(Relative paths will resolve against your current working directory (CWD).)

To turn off prompts and get Linked QL to take a predefined sensible-default action, use the flag --yes:

npx linkedql commit --yes
Clone this wiki locally