Skip to content

Commit

Permalink
Update readme & changelog
Browse files Browse the repository at this point in the history
dxg committed Sep 10, 2013
1 parent bdaefe0 commit 5b9f5d1
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
@@ -10,7 +10,8 @@
- Allow custom join tables (#276)
- Allow async express middleware (#291)
- Allow auto-escaping for custom queries (#304)
- Allow passing timezone in database connection string - mysql only for now (#325, #303)
- Allow passing timezone in database connection string - mysql & postgres only for now (#325, #303)
- Allow ordering by raw sql - .orderRaw() when chaining
- Deprecated `PARAM_MISSMATCH` ErrorCode in favour of correctly spelt `PARAM_MISMATCH` (#315)
- Fix `NaN` handling (#310)
- Fixes stack overflow when saving auto-fetched model with relations (#279)
7 changes: 7 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -400,6 +400,13 @@ It's bad practice to manually escape SQL parameters as it's error prone and expo
The `?` syntax takes care of escaping for you, by safely substituting the question mark in the query with the parameters provided.
You can also chain multiple `where` clauses as needed.

You can also `order` or `orderRaw`:
```js
Person.find({ age: 18 }).order('-name').all( ... );
// see the 'Raw queries' section below for more details
Person.find({ age: 18 }).orderRaw("?? DESC", ['age']).all( ... );
```

You can also chain and just get the count in the end. In this case, offset, limit and order are ignored.

```js

0 comments on commit 5b9f5d1

Please sign in to comment.