Introducing bb - a Bytebase CLI tool to manage database operations
Bytebase is an open source database DevOps tool, it's the GitLab for managing databases throughout the application development lifecycle. It offers a web-based workspace for DBAs and Developers to collaborate and manage the database change safely and efficiently.
We released Bytebase Web UI on July 13, 2021. Ten months later, we are excited to announce the release of Bytebase CLI, named
Developers can execute
bb commands to manage MySQL and PostgreSQL database (change database schema, restore database, etc.) after installing
bb. Most importantly, developers can integrate MySQL and PostgreSQL schema change into the CI/CD workflow by integrating
bb with the CI/CD system, such as GitLab CI, GitHub Actions, and Jenkins.
The following is a list of commands provided by Bytebase CLI
bb that can manage a database. More is coming soon:
- migrate: apply schema migration to the database.
- dump: dump a database schema and data.
- restore: restore a database schema and data from a dump file.
This blog post gives an overview of how to install Bytebase CLI
bb and how to execute
bb commands. For integrating Bytebase CLI
bb into the CI/CD system, see Integrating with GitLab CI.
bb into the folder /usr/local/bin on macOS or Linux by entering the command below:
Enter the following command to verify the installation:
Then you should see help output:
bb commands, we need a database, see Getting Started.
Let's take database schema change as an example.
First of all, enter the following command to display the database schema:
You should see there is a table named "author":
Then, add a column named "phone_no" into the table "author" with the following
Finally, verify database schema with the following