diff --git a/examples/bun-postgres/src/db/query_sql.ts b/examples/bun-postgres/src/db/query_sql.ts index fc99497..87e1dce 100644 --- a/examples/bun-postgres/src/db/query_sql.ts +++ b/examples/bun-postgres/src/db/query_sql.ts @@ -20,6 +20,9 @@ export async function getAuthor(sql: Sql, args: GetAuthorArgs): Promise factory.createPropertyAccessExpression( factory.createIdentifier("args"), - factory.createIdentifier(argName(i, param.column)) + factory.createIdentifier( + argName(i, param.column) + ) ) ), false @@ -520,7 +526,7 @@ export function oneDecl( factory.createIdentifier("values") ), undefined, - undefined, + undefined ) ) ), @@ -550,12 +556,31 @@ export function oneDecl( ), factory.createVariableStatement( undefined, - factory.createVariableDeclarationList([ - factory.createVariableDeclaration("row", undefined, undefined, factory.createElementAccessExpression( - factory.createIdentifier("rows"), - factory.createNumericLiteral("0") - )), - ], NodeFlags.Const) + factory.createVariableDeclarationList( + [ + factory.createVariableDeclaration( + "row", + undefined, + undefined, + factory.createElementAccessExpression( + factory.createIdentifier("rows"), + factory.createNumericLiteral("0") + ) + ), + ], + NodeFlags.Const + ) + ), + factory.createIfStatement( + factory.createPrefixUnaryExpression( + SyntaxKind.ExclamationToken, + factory.createIdentifier("row") + ), + factory.createBlock( + [factory.createReturnStatement(factory.createNull())], + true + ), + undefined ), factory.createReturnStatement( factory.createObjectLiteralExpression(