From c5753ac3097ead9d410ff30187356427beb6dc67 Mon Sep 17 00:00:00 2001 From: Andre Azzolini Date: Thu, 10 May 2018 11:00:36 -0500 Subject: [PATCH] Update README.md --- README.md | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 544f5c2..9322afc 100644 --- a/README.md +++ b/README.md @@ -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) // 'apazzolini@test.test' +const { email } = await query(sql`SELECT email FROM users WHERE id = ${currentUserId}`) +console.log(email) // 'apazzolini@test.test' ``` ### query.transaction