-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add With Clause #1599
add With Clause #1599
Conversation
}).select('*').from('withClause'), { | ||
mssql: 'with [withClause] as (select [foo] from [users]) select * from [withClause]', | ||
sqlite3: 'with "withClause" as (select "foo" from "users") select * from "withClause"', | ||
postgres: 'with "withClause" as (select "foo" from "users") select * from "withClause"', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it intentional that many of the tests doesn't have oracle / oracledb result checks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in oracle the with clause is used in a select subquery.
this could be used in insert but could not find a way to use it with knex (raw or not...)
Looks good. I added couple of small comments. Also would be good to add at least one integration test for this. |
Add arguments check to with() and modify some tests
* master: add With Clause (#1599)
* master: release 0.12.0 Remove docs, in favor of https://github.com/knex/documentation (#1666) Revert to generic pool (#1665) Fix #1619 Fix use of const in test suite for node 0.12 Moving bin/cli outside of src to allow install from master Deprecate Knex.Promise Simplifying internal client structure add With Clause (#1599) Simplify transaction classes Simplify formatter use Deprecate VERSION, update changelog Fix PG string escaping behavior (#1661)
fix #716
add a with function(alias, callback|raw)
output:
with "with_alias" as (select * from "books" where "author" = 'Test') select * from "with_alias"