function trackSql
trackSql<T>(
sql: string | string[],
fn: () => Promise<T>,
): Promise<T>

Run an async DB operation, enforcing the N+1 read guard and logging it when footer tracking is active.

Type Parameters

Parameters

sql: string | string[]
fn: () => Promise<T>

Return Type

Promise<T>

Usage

import { trackSql } from "docs/database.ts";