import type { Run, RunFeedback, RunQuery, RunTree, TraceStore } from '../types/tracing.js'; import { type PostgresLikeClient } from './client.js'; /** Options for the Postgres trace store. */ export interface PostgresTraceStoreOptions { /** Table name, optionally schema-qualified. Defaults to `nexus_runs`. */ table?: string; } /** The schema, as statements. */ export declare function traceStoreMigration(options?: PostgresTraceStoreOptions): string[]; /** * Traces in Postgres. * * Every filter of a `RunQuery` — tags, metadata paths, and feedback keys included — becomes one SQL * condition, so paging happens in the database and a query means exactly what it means against the * in-memory store. Feedback is appended in one statement, so two evaluators scoring one run at the * same moment both land. */ export declare class PostgresTraceStore implements TraceStore { private readonly client; private readonly options; private readonly table; constructor(client: PostgresLikeClient, options?: PostgresTraceStoreOptions); /** Creates the table and indexes if they do not exist. Never runs implicitly. */ migrate(): Promise; /** Stores a run, replacing an earlier version with the same id. */ save(run: Run): Promise; /** Reads a run. */ get(runId: string): Promise; /** Runs matching a query, filtered and ordered in SQL. */ query(query?: RunQuery): Promise; /** A trace's runs, assembled into a tree. */ tree(traceId: string): Promise; /** Appends feedback to a run in one statement. */ addFeedback(runId: string, feedback: RunFeedback): Promise; /** Deletes runs started before an ISO-8601 time, returning how many went. */ prune(before: string): Promise; }