customType() — drizzle-orm Function Reference
Architecture documentation for the customType() function in custom.ts from the drizzle-orm codebase.
Entity Profile
Dependency Diagram
graph TD 39620cad_f66e_875c_a81a_b61f8f2ae0d8["customType()"] e7326635_a1d9_22bf_400e_da3a7dd63899["custom.ts"] 39620cad_f66e_875c_a81a_b61f8f2ae0d8 -->|defined in| e7326635_a1d9_22bf_400e_da3a7dd63899 style 39620cad_f66e_875c_a81a_b61f8f2ae0d8 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
drizzle-orm/src/sqlite-core/columns/custom.ts lines 203–236
export function customType<T extends CustomTypeValues = CustomTypeValues>(
customTypeParams: CustomTypeParams<T>,
): Equal<T['configRequired'], true> extends true ? {
<TConfig extends Record<string, any> & T['config']>(
fieldConfig: TConfig,
): SQLiteCustomColumnBuilder<ConvertCustomConfig<'', T>>;
<TName extends string>(
dbName: TName,
fieldConfig: T['config'],
): SQLiteCustomColumnBuilder<ConvertCustomConfig<TName, T>>;
}
: {
(): SQLiteCustomColumnBuilder<ConvertCustomConfig<'', T>>;
<TConfig extends Record<string, any> & T['config']>(
fieldConfig?: TConfig,
): SQLiteCustomColumnBuilder<ConvertCustomConfig<'', T>>;
<TName extends string>(
dbName: TName,
fieldConfig?: T['config'],
): SQLiteCustomColumnBuilder<ConvertCustomConfig<TName, T>>;
}
{
return <TName extends string>(
a?: TName | T['config'],
b?: T['config'],
): SQLiteCustomColumnBuilder<ConvertCustomConfig<TName, T>> => {
const { name, config } = getColumnNameAndConfig<T['config']>(a, b);
return new SQLiteCustomColumnBuilder(
name as ConvertCustomConfig<TName, T>['name'],
config,
customTypeParams,
);
};
}
Domain
Subdomains
Source
Frequently Asked Questions
What does customType() do?
customType() is a function in the drizzle-orm codebase, defined in drizzle-orm/src/sqlite-core/columns/custom.ts.
Where is customType() defined?
customType() is defined in drizzle-orm/src/sqlite-core/columns/custom.ts at line 203.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free