Setup development database enviroments with a easy to use database container management tool.
- MySQL:
mysql
- PostgreSQL:
postgres
- MongoDB:
mongo
- Microsoft SQLServer:
mssql
- Redis:
redis
- Docker:
docker
- Podman:
podman
- Python 3.10.x >=
- Docker
- yacli (auto downloaded by the
install.py
script)
How to download and install:
$ git clone https://github.com/Raisess/dbc
$ cd dbc
$ ./install.py
$ dbc help
Create a new container and download a new database image if don't have one.
$ dbc create `database-type` `container-name`
- NOTE: You can use environment variables to set things like password, check how here.
Enter into the container using a client software, e.g.: psql
.
$ dbc connect `database-type` `container-name`
- NOTE: You don't need to specify the environment variables to connect using the
connect
command.
Enter into the container using bash
.
$ dbc enter `container-name`
Delete the container and the volume, but keeps the database image.
$ dbc destroy `container-name`
By default dbc
will use docker
, to use another container set the CONTAINER
environment variable.
E.g.:
$ CONTAINER=podman dbc enter `container-name`
CONTAINER: Specifies the container manager will want to use.
- Default:
docker
DB_NAME: The database name.
- Default:
mydatabase
DB_PORT: The physical port to access the database trough the container.
- Default:
1234
- NOTE: Inside the container, the databases will always use they default port, like:
5432
forpostgres
.
DB_USER: The username to access the database.
- Default:
root
DB_PASS: The database password.
- Default:
mysecretpassword