/slonik-tools

Various utilities for slonik

Primary LanguageTypeScriptMIT LicenseMIT

This is a temporary fork of @slonik/migrator.

  • This is a patch that works for now until @slonik/migrator is compatible with slonik v33.
  • Focuses only on migration by .sql files.

slonik-tools

Node CI codecov

Various utilities for slonik

Packages

Development

Requirements:

  • node + yarn
  • docker + docker-compose

lerna is used to manage the packages.

To get started:

yarn
yarn dependencies

This starts a local postgres database that the tests will connect to (depends on docker-compose). After running that in its own window:

yarn ci

will build, migrate and test all packages.

While developing, it can be useful to run yarn build -w to compile continuously in the background and yarn test to just run tests. The tests use jest, so all the usual jest features can be used. For example, yarn test packages/migrator will run the tests only for the migrator package. yarn test $(npx lerna changed --parseable) runs tests for all changed packages.

Publishing

Run this workflow. To make sure the correct packages are actually published, it requires a hash of the publish command's dry-run output. You can get this by running the workflow with no parameters, and copying the expected value from the failure logs, or run yarn changes:hash locally.