Skip to content

use query config object for queries #545

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
use query config object for queries
tsnobip authored Oct 19, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 5c516ed62362e56075574c13fcf37b215de74c35
6 changes: 3 additions & 3 deletions packages/runtime/src/tag.ts
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ import { processSQLQueryIR } from './preprocessor-sql.js';
import { processTSQueryAST } from './preprocessor-ts.js';

export interface IDatabaseConnection {
query: (query: string, bindings: any[]) => Promise<{ rows: any[] }>;
query: (config: { text: string, values: any[] }) => Promise<{ rows: any[] }>;
}

/** Check for column modifier suffixes (exclamation and question marks). */
@@ -41,7 +41,7 @@ export class TaggedQuery<TTypePair extends { params: any; result: any }> {
this.query,
params as any,
);
const result = await connection.query(processedQuery, bindings);
const result = await connection.query({ text: processedQuery, values: bindings });
return mapQueryResultRows(result.rows);
};
}
@@ -75,7 +75,7 @@ export class PreparedQuery<TParamType, TResultType> {
this.queryIR,
params as any,
);
const result = await connection.query(processedQuery, bindings);
const result = await connection.query({ text: processedQuery, values: bindings });
return mapQueryResultRows(result.rows);
};
}