silently() function
Run fn with SQL logging suppressed.
Signature:
export declare function silently<T>(fn: () => Promise<T>): Promise<T>;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
fn |
() => Promise<T> |
Work to run while logging is suppressed. |
Returns:
Promise<T>
Whatever fn resolves to.
Remarks
The previous state is restored in a finally, so nesting works and a throw still un-suppresses. What it does NOT do is scope the suppression to fn's own queries — the flag is module-wide, so anything else querying concurrently is silenced for as long as fn runs.
Example
await silently(() => client.$executeRawUnsafe(startupDdl));
Read this page as plain markdown — no HTML, no navigation. For pasting into an LLM, or for an agent to fetch.