import { FieldType } from './export-utils'; /** * Get the GraphQL query field name for a given Postgres table name. * Mirrors the PostGraphile InflektPlugin's allRowsConnection inflector: * toCamelCase(distinctPluralize(singularizeLast(toPascalCase(pgTableName)))) */ export declare const getGraphQLQueryName: (pgTableName: string) => string; /** * Convert a row of GraphQL camelCase keys back to Postgres snake_case keys. * This is needed because the csv-to-pg Parser expects snake_case column names. * Only transforms top-level keys — nested objects (e.g. JSONB values) are left intact. */ export declare const graphqlRowToPostgresRow: (row: Record) => Record; export { intervalToPostgres } from './interval-utils'; /** * Convert an array of Postgres field names (with optional type hints) to a GraphQL fields fragment. * Handles composite types like 'interval' by expanding them into subfield selections. * e.g. [['id', 'uuid'], ['sessions_default_expiration', 'interval']] -> * 'id\nsessionsDefaultExpiration { seconds minutes hours days months years }' */ export declare const buildFieldsFragment: (pgFieldNames: string[], fieldTypes?: Record) => string; /** * Represents the unwrapped type info from a GraphQL introspection field. * PostGraphile wraps types in NON_NULL and LIST layers via nested `ofType`. */ export interface GraphQLTypeInfo { /** The leaf/nullable type name (e.g. "UUID", "String", "Interval") */ typeName: string; /** The leaf type kind (e.g. "SCALAR", "OBJECT", "ENUM") */ kind: string; /** Whether the outermost wrapper is NON_NULL */ nonNull: boolean; /** Whether the type is a list */ list: boolean; } /** * Unwrap a GraphQL introspection type reference into its leaf type name and list status. * PostGraphile wraps types like: { kind: NON_NULL, name: null, ofType: { kind: LIST, name: null, ofType: { kind: SCALAR, name: "UUID" } } } * This function recursively unwraps ofType layers, detecting LIST wrappers via the `kind` field. */ export declare const unwrapGraphQLType: (typeRef: { name: string | null; kind?: string; ofType?: any; } | null, parentKind?: string) => GraphQLTypeInfo; /** * Map GraphQL scalar/type names to FieldType values. * Delegates to the canonical PG_TYPE_MAP in type-map.ts. */ export declare const mapGraphQLTypeToFieldType: (gqlTypeName: string, isList?: boolean) => FieldType; /** * Derive the GraphQL type name (PascalCase singular) from a PostgreSQL table name. * Mirrors PostGraphile's InflektPlugin type inflector: * singularizeLast(toPascalCase(pgTableName)) * e.g. "user_auth_module" → "UserAuthModule" */ export declare const getGraphQLTypeName: (pgTableName: string) => string;