Skip to content

Commit

Permalink
Merge pull request #288 from mergestat/add-early-exit-constraints
Browse files Browse the repository at this point in the history
fix: add constraints for `github_repo_prs` table
  • Loading branch information
patrickdevivo authored Apr 23, 2022
2 parents e54da56 + e88c189 commit 8737396
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions extensions/internal/github/repo_prs.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,15 @@ var prCols = []vtab.Column{
{Name: "changed_files", Type: "INT"},
{Name: "closed", Type: "BOOLEAN"},
{Name: "closed_at", Type: "DATETIME"},
{Name: "comment_count", Type: "INT", OrderBy: vtab.ASC | vtab.DESC},
{Name: "comment_count", Type: "INT", OrderBy: vtab.ASC | vtab.DESC, Filters: []*vtab.ColumnFilter{
{Op: sqlite.INDEX_CONSTRAINT_GT}, {Op: sqlite.INDEX_CONSTRAINT_GE},
{Op: sqlite.INDEX_CONSTRAINT_LT}, {Op: sqlite.INDEX_CONSTRAINT_LE},
}},
{Name: "commit_count", Type: "INT"},
{Name: "created_at", Type: "DATETIME", OrderBy: vtab.ASC | vtab.DESC},
{Name: "created_at", Type: "DATETIME", OrderBy: vtab.ASC | vtab.DESC, Filters: []*vtab.ColumnFilter{
{Op: sqlite.INDEX_CONSTRAINT_GT}, {Op: sqlite.INDEX_CONSTRAINT_GE},
{Op: sqlite.INDEX_CONSTRAINT_LT}, {Op: sqlite.INDEX_CONSTRAINT_LE},
}},
{Name: "created_via_email", Type: "BOOLEAN"},
{Name: "database_id", Type: "INT"},
{Name: "deletions", Type: "INT"},
Expand All @@ -342,7 +348,10 @@ var prCols = []vtab.Column{
{Name: "review_decision", Type: "TEXT"},
{Name: "state", Type: "TEXT"},
{Name: "title", Type: "TEXT"},
{Name: "updated_at", Type: "DATETIME", OrderBy: vtab.ASC | vtab.DESC},
{Name: "updated_at", Type: "DATETIME", OrderBy: vtab.ASC | vtab.DESC, Filters: []*vtab.ColumnFilter{
{Op: sqlite.INDEX_CONSTRAINT_GT}, {Op: sqlite.INDEX_CONSTRAINT_GE},
{Op: sqlite.INDEX_CONSTRAINT_LT}, {Op: sqlite.INDEX_CONSTRAINT_LE},
}},
{Name: "url", Type: "TEXT"},
}

Expand Down

0 comments on commit 8737396

Please sign in to comment.