Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre Azzolini authored May 10, 2018
1 parent 748a25a commit c5753ac
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,8 @@ const knownEmails = await query(sql`SELECT email FROM users`, {
Invoked exactly like `query`, except that instead of returning an array of rows, it will return one object. If your query results in no rows, it will return a null. If your query returns more than one row, it will throw an Error. You can also use rowMapper here.
```js
const currentUserEmail = await query(sql`
SELECT email FROM users WHERE id = ${currentUserId}
`, {
rowMapper: row => row.email,
})
console.log(currentUserEmail) // '[email protected]'
const { email } = await query(sql`SELECT email FROM users WHERE id = ${currentUserId}`)
console.log(email) // '[email protected]'
```
### query.transaction
Expand Down

0 comments on commit c5753ac

Please sign in to comment.