/** * SQL Expressions * * Type-safe SQL expressions for default values and other uses. * Provides a `t` helper with common expressions. */ /** * Represents a raw SQL expression (not a literal value). */ export declare class SqlExpression { readonly sql: string; constructor(sql: string); toString(): string; /** * Check if a value is a SQL expression. */ static isExpression(value: unknown): value is SqlExpression; } /** * Helper object for common SQL expressions. * Use in migrations: `table.timestamp('createdAt').defaultValue(t.now())` */ export declare const t: { /** * Current timestamp (NOW() or CURRENT_TIMESTAMP depending on dialect). */ now(): SqlExpression; /** * Current date (CURRENT_DATE). */ currentDate(): SqlExpression; /** * Current time (CURRENT_TIME). */ currentTime(): SqlExpression; /** * NULL value. */ null(): SqlExpression; /** * Boolean true. */ true(): SqlExpression; /** * Boolean false. */ false(): SqlExpression; /** * Generate UUID (Postgres: gen_random_uuid(), MySQL: UUID()). */ uuid(): SqlExpression; /** * Auto-generate UUID for MySQL. */ mysqlUuid(): SqlExpression; /** * Raw SQL expression. * Use for custom expressions not covered by helpers. */ raw(sql: string): SqlExpression; /** * String literal with proper escaping. */ literal(value: string): SqlExpression; /** * Numeric literal. */ number(value: number): SqlExpression; /** * Empty JSON object. */ emptyObject(): SqlExpression; /** * Empty JSON array. */ emptyArray(): SqlExpression; /** * MySQL: ON UPDATE CURRENT_TIMESTAMP. */ onUpdateNow(): SqlExpression; }; /** * Format a default value for SQL. * Handles SqlExpression vs literal values. */ export declare function formatDefaultValue(value: unknown): string; //# sourceMappingURL=expressions.d.ts.map