/** * SQL queries for exporter enrichment (Postgres provider). * These queries support the exporter's input enrichment and direct query features. */ /** * Fetch job record by key. */ export declare const GET_JOB_BY_KEY = "\n SELECT id, key, status, created_at, updated_at, expired_at, is_live\n FROM {schema}.jobs\n WHERE key = $1\n LIMIT 1\n"; /** * Fetch just the lineage columns for a job — a single indexed lookup on `key`. * Backs the exporter's opt-in `include_lineage` pointer. */ export declare const GET_JOB_LINEAGE = "\n SELECT parent_id, origin_id\n FROM {schema}.jobs\n WHERE key = $1\n LIMIT 1\n"; /** * Fetch all attributes for a job. */ export declare const GET_JOB_ATTRIBUTES = "\n SELECT symbol || dimension AS field, value\n FROM {schema}.jobs_attributes\n WHERE job_id = $1\n ORDER BY symbol, dimension\n"; /** * Fetch activity inputs for a workflow. * Matches all activity jobs for the given workflow and extracts their input arguments. */ export declare const GET_ACTIVITY_INPUTS = "\n SELECT j.key, ja.value\n FROM {schema}.jobs j\n JOIN {schema}.jobs_attributes ja ON ja.job_id = j.id\n WHERE j.key LIKE $1\n AND ja.symbol = $2 AND ja.dimension = $3\n"; /** * Fetch activity inputs from worker_streams for direct worker proxyer activities. */ export declare const GET_PROXYER_STREAM_INPUTS = "\n SELECT message\n FROM {schema}.worker_streams\n WHERE jid = $1\n AND aid IN ('proxyer', 'collator_proxyer', 'signaler_proxyer')\n ORDER BY created_at, id\n"; /** * Fetch all worker stream messages for a job AND its child activities. * Child activity jobs use the pattern: -{parentJobId}-$activityName-N * Uses the partial index on (jid, created_at) WHERE jid != '' for efficiency. * Includes both active and expired messages for full execution history. */ export declare const GET_STREAM_HISTORY_BY_JID = "\n SELECT\n id, jid, aid, dad, msg_type, topic, workflow_name,\n message, created_at, reserved_at, expired_at\n FROM {schema}.worker_streams\n WHERE jid = $1 OR jid LIKE '-' || $1 || '-%'\n ORDER BY created_at, id\n"; /** * Fetch worker stream messages for a job filtered by message type. * Includes child activity messages. */ export declare const GET_STREAM_HISTORY_BY_JID_AND_TYPE = "\n SELECT\n id, jid, aid, dad, msg_type, topic, workflow_name,\n message, created_at, reserved_at, expired_at\n FROM {schema}.worker_streams\n WHERE (jid = $1 OR jid LIKE '-' || $1 || '-%')\n AND msg_type = ANY($2::text[])\n ORDER BY created_at, id\n"; /** * Fetch worker stream messages for a job filtered by activity ID. * Includes child activity messages. */ export declare const GET_STREAM_HISTORY_BY_JID_AND_AID = "\n SELECT\n id, jid, aid, dad, msg_type, topic, workflow_name,\n message, created_at, reserved_at, expired_at\n FROM {schema}.worker_streams\n WHERE (jid = $1 OR jid LIKE '-' || $1 || '-%')\n AND aid = $2\n ORDER BY created_at, id\n"; /** * Fetch child workflow inputs in batch. * Uses parameterized IN clause for exact-match efficiency. * Note: This query template must be built dynamically with the correct number of placeholders. */ export declare function buildChildWorkflowInputsQuery(childCount: number, schema: string): string;