SQL Review API

The SQL Review API provides SQL checks based on your schema review policy.

Before you start, you should configure the SQL Review Policy.

EndpointPOST /v1/projects/-/releases:check
Requesthttps://api.bytebase.com/#model/checkreleaserequest
Responsehttps://api.bytebase.com/#model/checkreleaseresponse
Examplehttps://github.com/bytebase/api-example/tree/main/sql-review#batch-api-recommended

Batch API allows you to validate multiple statements across multiple databases in a single API call.

You should use batch API for the GitOps workflow. Because a single PR or MR may contain multiple dependent migration files (e.g., 1_create_t1_table.sql, 2_create_t1_index.sql). By retaining the context from earlier files, the Batch API ensures each subsequent file is validated accurately.

Simple API

EndpointPOST /v1/sql/check
Requesthttps://api.bytebase.com/#model/checkrequest
Responsehttps://api.bytebase.com/#model/checkresponse
Examplehttps://github.com/bytebase/api-example/tree/main/sql-review#simple-api

Simple API allows you to validate a single statement against a single database.

Edit this page on GitHub

Subscribe to Newsletter

By subscribing, you agree with Bytebase's Terms of Service and Privacy Policy.