8000 Add lateral join methods · Issue #3732 · knex/knex · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Add lateral join methods #3732
Open
Open
@danielrearden

Description

@danielrearden

I've been monkey-patching knex to include some lateral join methods but it'd be nice if the library actually supported them. Adding some kind of extra parameter to the existing join methods would be a potentially breaking change, not to mention the existing method signatures aren't all compatible (lateral joins have to use a subquery). So I propose adding 8 additional methods:

  • innerJoinLateral
  • leftJoinLateral
  • leftOuterJoinLateral
  • rightJoinLateral
  • rightOuterJoinLateral
  • outerJoinLateral
  • fullOuterJoinLateral
  • crossJoinLateral

Signatures would look something like:

(raw: Raw): QueryBuilder;
(subquery: QueryCallback, on: JoinCallback): QueryBuilder;
(subquery: QueryCallback, on: Raw): QueryBuilder;
(subquery: QueryCallback, columns: { [key: string]: string | number | boolean | Raw }): QueryBuilder;
(subquery: QueryCallback, column1: string, column2: string): QueryBuilder;
(subquery: QueryCallback, column1: string, column2: Raw): QueryBuilder;
(subquery: QueryCallback, column1: string, operator: string, column2: string): QueryBuilder;

I can try to put together a PR, but I wanted to confirm this sort of change would be acceptable first.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0