A tiny script to manage ephemeral Postgres databases.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE
Makefile
README.md
pglite

README.md

A tiny (~250 line) shell script that manages ephemeral Postgres databases.

# Creates a database in ./var if it does not exist and immediately connects.
./pglite
# Upon closing the SQL console, shuts down the database.

# Creates a database in ./var if it does not exist.
./pglite setup

# Opens a SQL console, ensuring the database is started (see `start` below).
./pglite connect
# Upon closing the SQL console, shuts down the database.

# The start/stop/status family of commands are passed directly to pg_ctl.
./pglite start|stop|status

# To remove your database and its configuration.
./pglite rm

# To display your current database connection string.
./pglite url

# Example of connecting with `psql`:
psql "$(./pglite url)"