npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

dockjump

v0.1.2

Published

Docker-based PostgreSQL developer environment with Graphile Migrate

Downloads

293

Readme

Dockjump

Docker-based PostgreSQL developer environment with the extraordinarily thoughtful SQL-powered roll-forward migration tool Graphile Migrate.

While graphile-migrate is opinionated about how to do migrations, it is agnostic about how you run your development databases. Dockjump fills that niche, providing local Docker-based PostgreSQL that just works out of the box. It sets up the necessary root, shadow, and application databases for graphile-migrate to do its thing.

In production, Dockjump is not in the picture: you set DATABASE_URL and run graphile-migrate migrate the usual way.

We've been using similar tooling at Metabolize–Curvewise for a while, with a Postgraphile/CRA project running on MacOS and Linux hosts. Dockjump would work equally well on any Postgres project, including with npx if you're not using Node.

This tooling is new and considered alpha. Developer feedback and contributions welcome!

Installation

npm install --save pg graphile-migrate
npm install --save-dev dockjump pg

How it works

  • dockjump init writes out .gmrc.js.
  • dockjump start starts a Docker container with the necessary databases and initially runs the migrations.
  • dockjump run --start cmd args ensures the Docker container is running and runs the specified process. Without --start it just sets DATABASE_URL (if it's not already set) and runs the command.
  • With the container running, you can use graphile-migrate migrate or graphile-migrate watch and connect to the database from the host machine as usual.
  • Write your migration in dockjump/current.sql.
  • After committing migrations, hooks configured in gmrc invoke dockjump export-schema to export the schema.
  • In CI, run checks to make sure the exported schema is up to date and current.sql is empty-ish.

Features

  • Generates .gmrc.js
  • Provisions a local, application-specific docker container
  • Within the container, provisions root, application, and shadow databases
  • Provides commands convenient for interacting with the container, database, schema, and migrations
  • Provides command for running psql
  • After running migrations, re-exports the schema
  • Verifies the exported schema is up to date (useful for running in CI)
  • Checks that dockjump/current.sql is empty-ish (also useful in CI)
  • Runs from the command line with zero boilerplate
  • Works with Node-based and non-Node-based projects

Related projects

An alternative to this project is Graphile Starter, a batteries-included boilerplate template by the author of graphile-migrate which runs an entire Postgraphile–Next.js application locally or in Docker.

In dockjump, graphile-migrate runs in the host OS, not docker as in docker example.

Acknowledgements

Serious thanks to Benjie and Jem for maintaining the wonderful Graphile suite. And thanks to Jacob Beard who convinced me it was worthwhile to write SQL again.

A few patterns in this tool were gleaned from Graphile Starter.

The name of this package was inspired by mail jumping, a practice which involves docks and the Post….