import { type SQL, type AnyColumn } from "drizzle-orm"; /** * TiDB / MySQL cast expressions for Drizzle `sql` fragments. * @see https://docs.pingcap.com/tidb/stable/cast-functions-and-operators * * `asType` / `type` / `charset` fragments are embedded with `sql.raw()` and must be trusted * (build them with `castTarget*` helpers or fixed literals — never concatenate user input). */ export type CastSqlInput = SQL | AnyColumn | string | number | boolean; /** `CAST(expr AS type)` — `asType` is a full MySQL cast target, e.g. `castTargetChar(10)`. */ export declare function sqlCast(expr: CastSqlInput, asType: string): SQL; /** * `CONVERT(expr, type)` — same cast targets as `CAST(... AS type)`. * Prefer `sqlCast` unless you need `CONVERT` syntax. */ export declare function sqlConvert(expr: CastSqlInput, type: string): SQL; /** `CONVERT(expr USING charset)` — character set conversion (e.g. `utf8mb4`). */ export declare function sqlConvertUsing(expr: CastSqlInput, charset: string): SQL; /** * `BINARY expr` (deprecated since MySQL 8.0.27; prefer `sqlCast(expr, castTargetBinary())`). */ export declare function sqlBinary(expr: CastSqlInput): SQL; /** `BINARY` or `BINARY(n)` */ export declare function castTargetBinary(length?: number): string; /** `CHAR` or `CHAR(n)` */ export declare function castTargetChar(length?: number): string; /** `DATE` */ export declare function castTargetDate(): string; /** `DATETIME` or `DATETIME(fsp)` */ export declare function castTargetDateTime(fsp?: number): string; /** `DECIMAL`, `DECIMAL(n)`, or `DECIMAL(n, m)` */ export declare function castTargetDecimal(precision?: number, scale?: number): string; /** `DOUBLE` */ export declare function castTargetDouble(): string; /** `FLOAT` or `FLOAT(n)` */ export declare function castTargetFloat(bits?: number): string; /** `JSON` */ export declare function castTargetJson(): string; /** `REAL` */ export declare function castTargetReal(): string; /** `SIGNED` */ export declare function castTargetSigned(): string; /** `SIGNED INTEGER` */ export declare function castTargetSignedInteger(): string; /** `UNSIGNED` */ export declare function castTargetUnsigned(): string; /** `UNSIGNED INTEGER` */ export declare function castTargetUnsignedInteger(): string; /** `TIME` or `TIME(fsp)` */ export declare function castTargetTime(fsp?: number): string; /** `VECTOR` (TiDB) */ export declare function castTargetVector(): string; /** `YEAR` */ export declare function castTargetYear(): string; /** * Multi-valued index form: `UNSIGNED ARRAY`, `CHAR(10) ARRAY`, etc. * @param elementTarget — e.g. `castTargetUnsigned()` or `castTargetChar(64)` */ export declare function castTargetArray(elementTarget: string): string; //# sourceMappingURL=CastTiDB.d.ts.map