Skip to content

Top-Level SubQuery support#400

Merged
danrzeppa merged 4 commits into
brianc:masterfrom
danrzeppa:dan-toplevelsubquery
Sep 24, 2019
Merged

Top-Level SubQuery support#400
danrzeppa merged 4 commits into
brianc:masterfrom
danrzeppa:dan-toplevelsubquery

Conversation

@danrzeppa
Copy link
Copy Markdown
Collaborator

Adds abilty to create a SubQuery without starting with a table. For example:

var sql=require("sql")
var subQuery = sql.subQuery().select(user.id).from(user)
var query=post.select().where(post.user_id.in(subQuery))

In this example, the subQuery could have been defined as user.subQuery().select(), but there are instances when dynamically generating SQL where you may not have the table at the time you want to create the subquery.

@danrzeppa danrzeppa merged commit 08940f9 into brianc:master Sep 24, 2019
@danrzeppa danrzeppa deleted the dan-toplevelsubquery branch November 14, 2020 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant