From e71bbc4fd796c3e6de1eb5991740ff649d1a992f Mon Sep 17 00:00:00 2001 From: Igal Klebanov Date: Fri, 21 Jun 2024 19:01:49 +0300 Subject: [PATCH] fix mssql createPerson example. (#1048) --- site/docs/getting-started/Querying.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/site/docs/getting-started/Querying.tsx b/site/docs/getting-started/Querying.tsx index af890ebcc..ac0b655c8 100644 --- a/site/docs/getting-started/Querying.tsx +++ b/site/docs/getting-started/Querying.tsx @@ -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>(compiledQuery) + } = await db.executeQuery>({ + ...compiledQuery, + sql: \`\${compiledQuery.sql}; select scope_identity() as id\` + }) return await findPersonById(id) }