Skip to content

Commit

Permalink
fix mssql createPerson example. (#1048)
Browse files Browse the repository at this point in the history
  • Loading branch information
igalklebanov committed Jun 21, 2024
1 parent 6dd7ce2 commit e71bbc4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions site/docs/getting-started/Querying.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 44,12 @@ export async function deletePerson(id: number) {
export async function createPerson(person: NewPerson) {
const compiledQuery = db.insertInto('person').values(person).compile()
compiledQuery.sql = '; select scope_identity() as id'
const {
rows: [{ id }],
} = await db.executeQuery<Pick<Person, 'id'>>(compiledQuery)
} = await db.executeQuery<Pick<Person, 'id'>>({
...compiledQuery,
sql: \`\${compiledQuery.sql}; select scope_identity() as id\`
})
return await findPersonById(id)
}
Expand Down

0 comments on commit e71bbc4

Please sign in to comment.