This monorepo contains a core library providing a simple PostgreSQL client for querying and logical replication streaming, along with a command-line interface (CLI) library for command-line invocation of this client.
Prepare the monorepo:
npm install
Build all packages:
npm run build
To test locally, follow these steps:
# Start the PostgreSQL Docker container:
docker compose up db -d
# Export required env overrides for local testing:
export PG_HOST=localhost
export NODE_TLS_REJECT_UNAUTHORIZED=0
# Run the tests:
npm run test
To test entirely within docker, follow these steps:
# Build the docker images (always required after dependency changes to re-install node_modules on the containers):
docker compose build
# Run the tests:
npm run docker:test
To add a feature(s), follow these steps:
- Make code changes.
- Run the following command for each feature:
# Add a changeset, specifying changelog desciptions, version bumps, etc as prompted.
npm run changeset:add
- Once you have added all changes and are nearly ready to publish, you should bump the version(s) and check-in the code. The version bumps will be determined by changesets from all of the applied changesets:
# Bump the versions:
npm run changeset:version
# Check-in the code:
git commit -a
To publish, we use changesets again:
# Publish using changesets:
npm run publish
Note that this triggers a prepublish step of building and local testing, so you'll need to ensure the db docker container is running and you environment is ready for testing - see above.