-
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?
Conversation
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is more what I meant
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 `=`. | |
All `value`s will be automatically escaped. 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 `=`. |
@@ -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 comment
The 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 value
in the functions above, not the expression
arguments I talked about in this paragraph for something like select
.
- `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])` |
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...
A few parts in the README looked incorrect/improvable.