LogoLogo
HomeBlogGet a Demo
  • Introduction
  • Install Lunar
  • Learn the basics
  • 📖Docs
    • Key concepts
    • Component JSON
    • Catalog JSON
    • Lunar CLI Reference
  • 📝Configuration
    • lunar-config.yml
      • catalogers
      • catalogers/hooks
      • domains
      • components
      • collectors
      • collectors/hooks
      • policies
    • lunar.yml
  • 🛠️Plugin SDKs
    • Plugins configuration
      • lunar-cataloger.yml
      • lunar-collector.yml
      • lunar-policy.yml
    • Bash SDK
      • Cataloger
      • Collector
    • Python SDK
      • Collector
      • Policy
        • Check
        • Path
        • ComponentData
        • NoDataError
        • Utility Functions
  • ⚙️SQL API
    • Overview
    • Views
      • domains
      • components
      • component_deltas
      • initiatives
      • policies
      • checks
      • prs
      • catalog
Powered by GitBook

©️ Earthly Technologies

On this page
  • Schema
  • Usage example
  1. SQL API
  2. Views

prs

prs

The prs view provides information about component pull requests. The information in this view is largely mirrored from the GitHub API, and is provided for convenience.

Schema

Column
Type
Description

component_id

TEXT

The identifier for the component - e.g. github.com/foo/bar/buz

pr

BIGINT

The pull request number

pr_opened_at

TIMESTAMPTZ

The UTC timestamp when the pull request was opened

pr_status

TEXT

The status of the pull request. Can be one of open, closed, or merged

title

TEXT

The title of the pull request

author_name

TEXT

The name of the author of the pull request

author_email

TEXT

The email of the author of the pull request

latest_git_sha

TEXT

The latest Git commit SHA of the pull request

latest_commit_timestamp

TIMESTAMPTZ

The "committed at" UTC timestamp of the latest commit in the pull request

latest_committer_name

TEXT

The name of the committer of the latest commit in the pull request

latest_committer_email

TEXT

The email of the committer of the latest commit in the pull request

Usage example

Retrieve PR information for all the PRs that have failing checks in a component.

WITH failing_prs AS (
  SELECT DISTINCT pr
  FROM checks_latest
  WHERE component_id = 'github.com/foo/bar/buz'
    AND pr IS NOT NULL
    AND status = 'fail'
)
SELECT *
FROM prs
WHERE component_id = 'github.com/foo/bar/buz'
  AND pr IN (SELECT pr FROM failing_prs);
PreviouschecksNextcatalog

Last updated 2 months ago

⚙️