Tutorial: SQL Review with Bytebase 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
Examplehttps://github.com/bytebase/example-api/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
Examplehttps://github.com/bytebase/example-api/tree/main/sql-review#simple-api
Simple API allows you to validate a single statement against a single database.