/** * @license * Copyright 2026 Steven Roussey * SPDX-License-Identifier: Apache-2.0 */ import type { JsonSchema } from "@workglow/util/schema"; /** Options for {@link mapPostgresType}. */ export interface PostgresTypeMapOptions { /** * Resolve the non-null variant of a (possibly `anyOf`-nullable) schema. * Supplied by the storage class so the JSON-Schema → SQL mapping reuses the * same null-stripping logic as the rest of the backend. */ readonly getNonNullType: (typeDef: JsonSchema) => JsonSchema; /** * Optional hook for the pgvector extension: given the resolved non-null * type of a `string` column, return a `vector(N)` column type, or undefined * to fall through to the normal string handling. Backends without pgvector * (e.g. Supabase via PostgREST) omit this. */ readonly vectorTypeFor?: (actualType: Exclude) => string | undefined; } /** * Map a JSON Schema property to a PostgreSQL column type. Shared by every * Postgres-shaped backend so the type mapping (string formats, integer range * selection, NUMERIC precision, native array support, JSONB fallbacks) lives * in one place. The only backend-specific behavior — pgvector columns — is * injected via {@link PostgresTypeMapOptions.vectorTypeFor}. */ export declare function mapPostgresType(typeDef: JsonSchema, options: PostgresTypeMapOptions): string; //# sourceMappingURL=mapPostgresType.d.ts.map