import type { ColumnConfig, ForeignKeyConfig, IndexConfig, InferInsert, InferTable } from "../types/index.js"; import type { ConstraintBuilder } from "./indexes.js"; export interface TableConfigImpl { name: TName; schema?: string; columns: TColumns; primaryKeys: string[]; indexes: IndexConfig[]; foreignKeys: ForeignKeyConfig[]; checks: string[]; qualifiedName: string; } export declare function getTableConfig>>(table: Table): TableConfigImpl; export declare function alias, TAlias extends string>(table: TTable, aliasName: TAlias): TTable; export type Table>> = TColumns & { /** Table name reference for type inference */ readonly $name?: TName; /** Infer standard row type */ $inferSelect: InferTable; /** Infer insert row type */ $inferInsert: InferInsert; }; export declare function camelToSnakeCase(str: string): string; type ExtraConfig = { schema?: string; indexes?: IndexConfig[]; checks?: string[]; primaryKeys?: string[]; } | ((cols: TColumns) => ConstraintBuilder[]); /** * Define a table with automatic camelCase → snake_case column mapping (Postgres convention). * * @example * import { pgTable, uuid, varchar } from "@bungres/orm"; * * export const users = pgTable("users", { * id: uuid({ primaryKey: true }), * fullName: varchar({ length: 255 }), // maps to `full_name` automatically * }); */ export declare const pgTable: >>(name: TName, columns: TColumns, extra?: ExtraConfig) => Table; export declare const snakeCase: { pgTable: >>(name: TName, columns: TColumns, extra?: ExtraConfig) => Table; }; export declare const camelCase: { pgTable: >>(name: TName, columns: TColumns, extra?: ExtraConfig) => Table; }; export declare const noCasing: { pgTable: >>(name: TName, columns: TColumns, extra?: ExtraConfig) => Table; }; export {}; //# sourceMappingURL=table.d.ts.map