Various utilities for slonik
- @slonik/migrator - A cli migration tool for postgres sql scripts, using slonik.
- @slonik/typegen - A library that uses slonik to generate typescript interfaces based on your sql queries.
- slonik-tools-demo - A demo project which uses @slonik/typegen and @slonik/migrator, intended to show a working example for each package.
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.
On master, and with write permissions to both master and npm (this isn't automated yet):
npx lerna version
npx lerna publish from-package