Skip to main content
When no prebuilt connector matches the pipeline, use PawSQL OpenAPI to submit SQL, poll for the analysis result, and apply the quality gate in the runner. This is the recommended pattern for Jenkins, GitHub Actions, GitLab CI, and other pipeline engines. See API reference for the full endpoint definitions.

Goal

Submit changed SQL from any CI/CD runner, wait for PawSQL analysis, and convert the result into a build decision.

Prerequisites

Use PawSQL OpenAPI with a configured workspace, review policy, and identity, referring to the API reference for endpoint definitions.

Pipeline pattern

1

Detect SQL changes

Compute the changed SQL files from the version-control diff, ignoring removed files.
2

Submit the review

Call the OpenAPI to create a review job for the workspace and policy, attaching the SQL and optional context.
3

Wait for the result

Poll the job until it reaches a terminal state, respecting the configured timeout.
4

Read the decision

Retrieve the gate decision, finding counts, and report link.
5

Apply the gate

Map the decision to a build result using the status mapping in SQL Quality Gates and Feedback.
6

Handle failure

Apply the configured failure policy on timeout, authentication error, or service unavailability.

Example script

Practical guidance

  • Send database dialect and a version identifier with each review.
  • Attach the DDL required by the review policy when the workspace cannot provide it.
  • Select only new and modified SQL files, not the whole repository.
  • Use a per-run identity with the least privilege required.
  • Keep the PawSQL token out of logs and exported environment.
  • Make the timeout and failure policy explicit in the pipeline.
  • Store the report link and job ID in the build artifacts for traceability.

Expected Result

The runner produces a build decision based on the PawSQL gate result and stores the report link and job ID.

Verification

Confirm the pipeline applies the correct status mapping and failure policy on timeout, authentication error, or service unavailability.

Next step

To turn the review evidence into pass, warning, or block decisions, see SQL Quality Gates and Feedback.