Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

ArtskydJ
Copy link

A few parts in the README looked incorrect/improvable.

@@ -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 `=`.
Copy link
Owner

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

Suggested change
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.
Copy link
Owner

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.

Comment on lines +128 to +133
- `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])`
Copy link
Owner

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...

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.

2 participants