Skip to content

Commit a3b3031

Browse files
authored
Update README.md (Transactions added missing returning *) (#662)
Check issue: #649 This is a minor modification but debugging this has taken a couple of hours for me as I am slightly new to SQL syntax and to postgreSQL in general. I was trying to use the empty return from sql.begin but it turned out that the callback in sql.begin was the one returning the empty array even though the insert was successful.
1 parent 26c368e commit a3b3031

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,7 @@ const [user, account] = await sql.begin(async sql => {
580580
) values (
581581
'Murray'
582582
)
583+
returning *
583584
`
584585

585586
const [account] = await sql`
@@ -588,6 +589,7 @@ const [user, account] = await sql.begin(async sql => {
588589
) values (
589590
${ user.user_id }
590591
)
592+
returning *
591593
`
592594

593595
return [user, account]

0 commit comments

Comments
 (0)