-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Andre Azzolini
authored
May 10, 2018
1 parent
748a25a
commit c5753ac
Showing
1 changed file
with
2 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|