rawsql-ts
Version:
High-performance SQL parser and AST analyzer written in TypeScript. Provides fast parsing and advanced transformation capabilities.
16 lines (15 loc) • 784 B
TypeScript
/**
* Converts Postgres serial pseudo-type names into their real storage types so ZTD
* cast expressions never emit non-existent types.
*
* @param typeName Optional type name (possibly qualified) that is trimmed before normalization.
* @returns The normalized type name when a pseudo-type matches, the trimmed input when no match is found, or `undefined` when the argument is `undefined`.
* @example
* normalizeSerialPseudoType('serial') // 'integer'
* normalizeSerialPseudoType('public.BIGSERIAL') // 'public.bigint'
*/
export declare function normalizeSerialPseudoType(typeName?: string): string | undefined;
/**
* Returns true when the provided type name resolves to a known serial pseudo-type.
*/
export declare function isSerialPseudoType(typeName?: string): boolean;