- SQL Review with Bytebase GUI
- SQL Review with CI (integrated with Database GitOps workflow):
- SQL Review with Bytebase API (this one)
- Codify SQL Review Policies with Bytebase API
Prerequisites
Make sure you have completed the previous tutorial SQL Review with Bytebase GUI. If you want to test the SQL Review API locally, you may need to configure ngrok. ngrok is a reverse proxy tunnel that provides a public network address to access Bytebase. We use ngrok here for demonstration purposes.
-
Run Bytebase in Docker with the following command:
-
Once Bytebase is running in Docker, you can access it at
localhost:8080
. -
Log in to the ngrok Dashboard and complete the Getting Started steps to install and configure ngrok. To use a consistent domain, navigate to Universal Gateway > Endpoints to find your assigned domain:
<<YOURS>>.ngrok-free.app
. -
Start ngrok with your domain by running:
You should see output similar to this:
-
You can now access Bytebase at
https://<<YOURS>>.ngrok-free.app
. -
(Optional) To configure SSO (Entra/SCIM), log in to Bytebase, click Settings > General in the left sidebar. Scroll to the Network section, set
https://<<YOURS>>.ngrok-free.app
as the External URL and click Confirm and update.
API Examples
You may call Bytebase API in your internal portal or GitHub Actions to trigger SQL Review. Check out https://github.com/bytebase/example-api/tree/main/issue-creation