https://github.com/nrjdalal/pglaunch
Quickly launch a PostgreSQL database for testing or development purposes.
https://github.com/nrjdalal/pglaunch
database pg pgcli pglaunch pgsql postgres postgresql psql
Last synced: 6 months ago
JSON representation
Quickly launch a PostgreSQL database for testing or development purposes.
- Host: GitHub
- URL: https://github.com/nrjdalal/pglaunch
- Owner: nrjdalal
- Created: 2023-10-31T22:46:55.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-11T12:39:33.000Z (7 months ago)
- Last Synced: 2025-03-28T22:12:34.483Z (7 months ago)
- Topics: database, pg, pgcli, pglaunch, pgsql, postgres, postgresql, psql
- Language: Shell
- Homepage: https://www.npmjs.com/package/pglaunch
- Size: 26.4 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# [pglaunch - PostgreSQL/Redis Database Launcher](https://www.npmjs.com/package/pglaunch)
pglaunch is a simple script to launch a PostgreSQL or Redis docker container. It can be used to quickly launch a database for testing or development purposes.
> Options are available to keep the container running after the script exits and to specify the name and port of the container.
```
pglaunch [options]Options:
-h, --help show this help message
-v, --version show version number
-k, --keep keep container after restart or exit
-n, --name name for docker container
(default: current directory name)
-p, --port port for service container
(default: 5555 for postgres, 6379 for redis)
-s, --service service to launch (default: postgres, options: postgres, redis)
```Star this project on [GitHub](https://github.com/nrjdalal/pglaunch#readme) if you find it useful.
## Installation
```
npx pglaunch
```Other package managers are also supported.
Current implemented for bash/zsh shell.
## Examples
1. Launch a PostgreSQL container with the default name and port:
```
pglaunch
```> POSTGRES_URL=postgresql://postgres:895UhteoUadR@localhost:5555/postgres
2. Launch a PostgreSQL container with a custom name and port:
```
pglaunch -n awesome-project -p 5432 && docker ps --format "table {{.Names}}"
```> POSTGRES_URL=postgresql://postgres:895UhteoUadR@localhost:5432/postgres
NAMES
awesome-project-y6zT3. Launch a PostgreSQL container and keep it running after the script exits:
```
pglaunch -k
```> POSTGRES_URL=postgresql://postgres:895UhteoUadR@localhost:5555/postgres
4. Launch a PostgreSQL container with a custom name and port and keep it running after the script exits:
```
pglaunch -n awesome-project -p 5432 -k && docker ps --format "table {{.Names}}"
```> POSTGRES_URL=postgresql://postgres:895UhteoUadR@localhost:5432/postgres
NAMES
awesome-project-y6zT> Similar examples can be used for Redis. Just add the `-s redis` option.
## License
MIT