/** * Cross-dialect SQL type-classification predicates. * * Single source of truth for "is this SQL type name a string / boolean / date * / etc." across the MJ stack. Built by unioning each registered SQLDialect's * type-name getters (see `SQLDialect.BooleanTypeNames`, `StringTypeNames`, * etc.), so adding a new dialect requires zero changes here — just register * its dialect class with the same getters and the predicates pick it up. * * Usage: * ```typescript * import { IsBooleanSQLType, IsStringSQLType } from '@memberjunction/sql-dialect'; * * if (IsStringSQLType(field.Type)) { * // safe to LOWER() and string-compare * } * ``` * * Why this exists: prior call sites hand-coded long switch/case lists of SQL * type names in 5+ files (graphql_server_codegen.ts, MJCore util.ts, * MetadataSync sync-engine.ts, PushService.ts, …). Each list was subtly * different — some included `bpchar`, some forgot `character varying`, some * had `citext` only after a PG bug — and adding a new column type required * grepping every list. Now there is one place per category, owned by the * dialect that defines the type. */ /** True if `typeName` is a boolean type in any registered dialect (`bit`, `boolean`, `bool`). */ export declare function IsBooleanSQLType(typeName: string | null | undefined): boolean; /** True if `typeName` is a variable / fixed-length character / text type. Excludes `uuid`. */ export declare function IsStringSQLType(typeName: string | null | undefined): boolean; /** * True if `typeName` is a **fixed-width** / space-padded character type * (SQL Server `char`/`nchar`, PostgreSQL `char`/`character`/`bpchar`). * * Use to decide whether to rtrim values returned by the DB: fixed-width * types right-pad with spaces up to the declared length and return that * padding in result sets, which causes spurious dirty-flagging if the * application-side value is the logical (un-padded) form. */ export declare function IsFixedWidthStringSQLType(typeName: string | null | undefined): boolean; /** True if `typeName` is a date / time / timestamp type. */ export declare function IsDateSQLType(typeName: string | null | undefined): boolean; /** True if `typeName` is an integer type (any width, including auto-increment / rowversion). */ export declare function IsIntegerSQLType(typeName: string | null | undefined): boolean; /** True if `typeName` is a floating-point or fixed-precision decimal type. */ export declare function IsFloatSQLType(typeName: string | null | undefined): boolean; /** True if `typeName` is a UUID type (`uniqueidentifier`, `uuid`). */ export declare function IsUuidSQLType(typeName: string | null | undefined): boolean; /** True if `typeName` is a binary blob type (`varbinary`, `image`, `bytea`). */ export declare function IsBinarySQLType(typeName: string | null | undefined): boolean; /** True if `typeName` is a JSON / XML structured-document type. */ export declare function IsJsonSQLType(typeName: string | null | undefined): boolean; /** True if `typeName` is a fixed-precision currency type (`money`, `smallmoney`). */ export declare function IsCurrencySQLType(typeName: string | null | undefined): boolean; /** True if `typeName` is an interval / duration type (`interval` — PG only currently). */ export declare function IsIntervalSQLType(typeName: string | null | undefined): boolean; /** True if `typeName` is a network address type (`inet`, `cidr`, …). */ export declare function IsNetworkSQLType(typeName: string | null | undefined): boolean; /** * Convenience aggregate: any "numeric" type — integer, float, or currency. * Use when the call site doesn't care about the precision/scale distinction. */ export declare function IsNumericSQLType(typeName: string | null | undefined): boolean; //# sourceMappingURL=typeClassification.d.ts.map