-
Notifications
You must be signed in to change notification settings - Fork 4
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
Minor clarifications #29
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -125,12 +125,12 @@ Every clause method returns a new immutable `q` query object. | |||||
- `q.from(tablename | subquery, alias)` | ||||||
- `q.join(tablename | subquery, [alias], on_expression)` | ||||||
- `q.leftJoin(tablename | subquery, [alias], on_expression)` | ||||||
- `q.where(expression, [comparator, [value]])` | ||||||
- `q.orWhere(expression, [comparator, [value]])` | ||||||
- `q.where(expression, [[comparator], value])` | ||||||
- `q.orWhere(expression, [[comparator], value])` | ||||||
- `q.whereLike(expression, value)` | ||||||
- `q.orWhereLike(expression, value)` | ||||||
- `q.having(expression, [comparator, [value]])` | ||||||
- `q.orHaving(expression, [comparator, [value]])` | ||||||
- `q.having(expression, [[comparator], value])` | ||||||
- `q.orHaving(expression, [[comparator], value])` | ||||||
- `q.groupBy(expression1, expression2, etc)` | ||||||
- `q.orderBy(expression1, expression2, etc)` | ||||||
- `q.limit(offset)` | ||||||
|
@@ -139,7 +139,7 @@ Every clause method returns a new immutable `q` query object. | |||||
|
||||||
`expression` strings are inserted without being parameterized, but you can also pass in [tagged template strings](#tagged-template-strings) to do anything special. | ||||||
|
||||||
All `value`s are automatically parameterized. If a `value` is `NULL` it will be automatically compared with `IS`, and if it's an array it will be automatically compared with `IN()`: | ||||||
If a `value` is `NULL` it will be automatically compared with `IS`, and if it's an array it will be automatically compared with `IN()`. Otherwise, it will be compared with `=`. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is more what I meant
Suggested change
|
||||||
|
||||||
```js | ||||||
const whereInResult = q.select('fancy') | ||||||
|
@@ -156,7 +156,7 @@ whereInResult.sql // => whereInQuery | |||||
whereInResult.values // => [ [ 'fancy', 'boring' ] ] | ||||||
``` | ||||||
|
||||||
Put another way, calling `q.select('column1, column2')` is just as acceptable as calling `q.select('column1', 'column2')` and you should use whichever you prefer. | ||||||
All `value`s are automatically parameterized. Put another way, calling `q.select('column1, column2')` is just as acceptable as calling `q.select('column1', 'column2')` and you should use whichever you prefer. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "parameterized" isn't terribly clear but I meant to be talking about the arguments I called |
||||||
|
||||||
#### Clause order | ||||||
|
||||||
|
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.
oh yeah that is what I meant...