SQL code review

Get review comments on SQL changes in your GitHub pull requests.

Single Origin reviews the SQL in your pull requests and leaves inline comments on the lines that need a change. It looks for the same kinds of waste it finds in your query history, such as filters that can't prune, costly joins or full-history rebuilds, and catches them before they merge.

How it works

flowchart LR
  A[Pull request push] --> B[Workflow sends changed files]
  B --> C[Single Origin reviews each file]
  C --> D[Inline comments returned]
  D --> E[Comments posted on the PR]
  1. A workflow in your GitHub repository runs when a pull request opens or gets a new push.
  2. It sends the changed files to Single Origin: each file's diff and its full content after the change.
  3. Single Origin reviews each file and returns inline comments, each tied to a file and a line range.
  4. The workflow posts the comments on the pull request.

A review can cover the whole pull request against its base branch, or only the files changed in the latest push.

When someone replies to a Single Origin comment, Single Origin can answer in the same thread, using the file's diff and the conversation so far.

Which files get comments

Single Origin comments only where it found something. A file gets no comment when:

  • it has no SQL, or the change doesn't touch SQL;
  • the SQL was reviewed and no issue was found;
  • one of your review rules excludes it;
  • it is outside the paths your workspace reviews (when a path filter is set).

Steer the review with rules

Review rules are short instructions that apply to every review in your workspace. Use them to stop a class of suggestion, skip a statement type, or skip a schema. For example:

  • "Do not recommend adding cluster keys to tables under 1M rows."
  • "If the SQL only references tables in the sandbox schema, return findings: [] with skipReason "sandbox excluded"."

To add or change your workspace's rules, contact [email protected].

See past reviews

In the web app, a job's Measured changes section links each change to the pull request Single Origin reviewed that most likely shipped it. See Jobs.

Set it up

Code review is set up per repository. Contact [email protected] to turn it on for your repositories.

Related


Did this page help you?