Home / Type/ CustomTypeValues Type — drizzle-orm Architecture

CustomTypeValues Type — drizzle-orm Architecture

Architecture documentation for the CustomTypeValues type/interface in custom.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  87b5daa7_5c39_7f35_663b_75b86787f9b7["CustomTypeValues"]
  8acf7f1c_a3fb_3dd8_17fe_b6f3f78e2a74["custom.ts"]
  87b5daa7_5c39_7f35_663b_75b86787f9b7 -->|defined in| 8acf7f1c_a3fb_3dd8_17fe_b6f3f78e2a74
  style 87b5daa7_5c39_7f35_663b_75b86787f9b7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-orm/src/singlestore-core/columns/custom.ts lines 93–144

export type CustomTypeValues = {
	/**
	 * Required type for custom column, that will infer proper type model
	 *
	 * Examples:
	 *
	 * If you want your column to be `string` type after selecting/or on inserting - use `data: string`. Like `text`, `varchar`
	 *
	 * If you want your column to be `number` type after selecting/or on inserting - use `data: number`. Like `integer`
	 */
	data: unknown;

	/**
	 * Type helper, that represents what type database driver is accepting for specific database data type
	 */
	driverData?: unknown;

	/**
	 * What config type should be used for {@link CustomTypeParams} `dataType` generation
	 */
	config?: Record<string, any>;

	/**
	 * Whether the config argument should be required or not
	 * @default false
	 */
	configRequired?: boolean;

	/**
	 * If your custom data type should be notNull by default you can use `notNull: true`
	 *
	 * @example
	 * const customSerial = customType<{ data: number, notNull: true, default: true }>({
	 * 	  dataType() {
	 * 	    return 'serial';
	 *    },
	 * });
	 */
	notNull?: boolean;

	/**
	 * If your custom data type has default you can use `default: true`
	 *
	 * @example
	 * const customSerial = customType<{ data: number, notNull: true, default: true }>({
	 * 	  dataType() {
	 * 	    return 'serial';
	 *    },
	 * });
	 */
	default?: boolean;
};

Frequently Asked Questions

What is the CustomTypeValues type?
CustomTypeValues is a type/interface in the drizzle-orm codebase, defined in drizzle-orm/src/singlestore-core/columns/custom.ts.
Where is CustomTypeValues defined?
CustomTypeValues is defined in drizzle-orm/src/singlestore-core/columns/custom.ts at line 93.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free