Updated pixel/link endpoints. Added name to rawQuery.

This commit is contained in:
Mike Cao 2025-09-30 16:11:21 -07:00
parent b9fbbc6453
commit 8a977b0164
18 changed files with 913 additions and 810 deletions

View file

@ -206,9 +206,10 @@ async function pagedRawQuery(
async function rawQuery<T = unknown>(
query: string,
params: Record<string, unknown> = {},
name?: string,
): Promise<T> {
if (process.env.LOG_QUERY) {
log({ query, params });
log({ query, params, name });
}
await connect();

View file

@ -164,10 +164,11 @@ function parseFilters(filters: Record<string, any>, options?: QueryOptions) {
};
}
async function rawQuery(sql: string, data: object): Promise<any> {
async function rawQuery(sql: string, data: Record<string, any>, name?: string): Promise<any> {
if (process.env.LOG_QUERY) {
log('QUERY:\n', sql);
log('PARAMETERS:\n', data);
log('NAME:\n', name);
}
const params = [];
const schema = getSchema();