/** * Default mapping from IR `type.name` strings to Drizzle column builder functions. * * This table is the projection's sole interpreter of Manifest's open * type vocabulary for Drizzle ORM. The projection knows what any given * IR type name means for Drizzle; nothing upstream carries Drizzle knowledge. * * Consumers can override per-property via `typeMappings`. Anything not * in this table and not overridden produces a hard diagnostic — no * fallback, no guessing. That is the contract. * * IMPORTANT: `'number'` is INTENTIONALLY ABSENT from this table. * Manifest's `number` is ambiguous between integers, real numbers, and * money. Silently mapping it to `integer` is exactly the class of silent * bug this project exists to prevent (rounding in financial values). * Authors must pick a precise type: * - `int` / `bigint` for counts and ids * - `float` for measurements where rounding is acceptable * - `money` / `decimal` for currency and other exact-decimal values * Bare `number` produces a hard DRIZZLE_AMBIGUOUS_NUMBER diagnostic * (see the generator). Override via `typeMappings` if you really do * want to attach a specific Drizzle column type to a `number`-typed field. */ /** Dialect controls which Drizzle import set and column types to use. */ export type DrizzleDialect = 'postgresql' | 'mysql' | 'sqlite'; /** * Maps an IR type name to a Drizzle column builder call. * The value is the Drizzle builder method name (e.g. 'varchar', 'integer'). * The generator wraps it with the correct module prefix (pgTable, mysqlTable, sqliteTable). */ export interface DrizzleColumnType { /** Drizzle column builder function name (e.g. 'varchar', 'integer', 'boolean') */ builder: string; /** Whether this type requires a length/precision parameter (e.g. varchar(255), numeric(12,2)) */ hasParams?: boolean; /** Default params when hasParams is true */ defaultParams?: string; } declare const DEFAULT_TYPE_MAPPING: Readonly>; export { DEFAULT_TYPE_MAPPING }; /** * Default precision/scale applied when a property's resolved Drizzle type * is `numeric` and no entry exists in `precision` config. * * `(12, 2)` is the conservative money default: it represents values up to * 9,999,999,999.99 with cent-level scale. */ export declare const DEFAULT_DECIMAL_PRECISION = 12; export declare const DEFAULT_DECIMAL_SCALE = 2; /** * Drizzle builder name used to detect the decimal/numeric family. */ export declare const DRIZZLE_NUMERIC_BUILDER = "numeric"; /** * Resolve a Drizzle column type for an IR `type.name`, given optional per-property * overrides from projection config. Returns `undefined` when the name is * unknown and no override is supplied — the caller MUST emit a diagnostic. */ export declare function resolveDrizzleColumnType(irTypeName: string, overrides: Readonly> | undefined, propertyName: string): DrizzleColumnType | undefined; /** * Return true iff the resolved Drizzle column type is the numeric/decimal family. * Used by the generator to decide whether to apply default precision/scale. */ export declare function isNumericType(colType: DrizzleColumnType): boolean; /** * Resolve the Drizzle schema module import name based on dialect. * e.g. 'pgTable' for postgresql, 'mysqlTable' for mysql, 'sqliteTable' for sqlite. */ export declare function tableFunctionForDialect(dialect: DrizzleDialect): string; /** * Resolve the Drizzle schema module import path based on dialect. */ export declare function importPathForDialect(dialect: DrizzleDialect): string; //# sourceMappingURL=type-mapping.d.ts.map