/** * Single-source type mapping between PostgreSQL, PostGraphile GraphQL, and FieldType. * * This is the canonical mapping table. All other mappers and tests derive from it: * - `mapPgTypeToFieldType` in export-utils.ts * - `mapGraphQLTypeToFieldType` in graphql-naming.ts * - `pgUdtToGraphQLType` / `pgUdtToGraphQLKind` in cross-flow-parity test * - parity table in dynamic-fields test * * When a new type needs to be supported, add it here and all consumers update automatically. */ import { FieldType } from './export-utils'; export interface TypeMapEntry { /** PostgreSQL udt_name values from information_schema (e.g. ['int4', 'int2']) */ pgUdtNames: string[]; /** PostGraphile v5 GraphQL type name (e.g. 'Int', 'BigInt', 'Datetime') */ gqlTypeName: string; /** FieldType used by csv-to-pg Parser (e.g. 'int', 'timestamptz') */ fieldType: FieldType; /** GraphQL kind that PostGraphile reports via introspection */ gqlKind: 'SCALAR' | 'OBJECT' | 'ENUM'; /** Whether this is a PostgreSQL array type (e.g. _uuid, _text, _jsonb) */ isArray?: boolean; } /** * Canonical PG → GraphQL → FieldType mapping table. * Aligned with PostGraphile v5's PgCodecsPlugin type assignments: * - int2, int4 → Int * - int8 (bigint) → BigInt * - numeric → BigFloat * - float4, float8 → Float * - interval → Interval (OBJECT kind, not SCALAR) * - timestamptz, timestamp → Datetime */ export declare const PG_TYPE_MAP: TypeMapEntry[]; /** * Look up a TypeMapEntry by PostgreSQL udt_name. * Returns undefined for unknown types (callers should fall back to 'text'). */ export declare const lookupByPgUdt: (udtName: string) => TypeMapEntry | undefined; /** * Look up a TypeMapEntry by GraphQL type name. * Returns undefined for unknown types (callers should fall back to 'text'). */ export declare const lookupByGqlType: (gqlTypeName: string) => TypeMapEntry | undefined;