Skip to content

Commit

Permalink
doc: add object arguments in readme (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
fangk authored and coolme200 committed Apr 13, 2018
1 parent ac3d639 commit db3524c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions README.md
Expand Up @@ -278,17 +278,24 @@ function* bar(ctx, data2) {

### Raw Queries

- Query with arguments
- Query without arguments

```js
let rows = yield db.query('SELECT * FROM your_table LIMIT 100');
console.log(rows);
```

- Query with arguments
- Query with array arguments

```js
let rows = yield db.query('SELECT * FROM your_table WHERE id=?', [123]);
let rows = yield db.query('SELECT * FROM your_table WHERE id=?', [ 123 ]);
console.log(rows);
```

- Query with object arguments

```js
let rows = yield db.query('SELECT * FROM your_table WHERE id=:id', { id: 123 });
console.log(rows);
```

Expand Down

0 comments on commit db3524c

Please sign in to comment.