# Interface CustomTypeParams<T>

interface CustomTypeParams<T extends CustomTypeValues> {
dataType: (
config:
| T["config"]
| (Equal<T["configRequired"], true> extends true ? never : undefined),
) => string;
fromDriver?: (value: T["driverData"]) => T["data"];
toDriver?: (value: T["data"]) => SQL<unknown> | T["driverData"];
}

#### Type Parameters

- T extends CustomTypeValues

- Defined in node_modules/.pnpm/drizzle-orm@0.44.6_@cloudflare+workers-types@4.20251014.0_@opentelemetry+api@1.9.0_@typ_31a6f5ca8f102af87864dd251ed08d88/node_modules/drizzle-orm/sqlite-core/columns/custom.d.ts:91

##### Index

### Properties

dataType
fromDriver?
toDriver?

## Properties

### dataType

dataType: (
config:
| T["config"]
| (Equal<T["configRequired"], true> extends true ? never : undefined),
) => string

Database data type string representation, that is used for migrations

#### Example

    `jsonb`, `text`

If database data type needs additional params you can use them from `config` param

#### Example

    `varchar(256)`, `numeric(2,3)`

To make `config` be of specific type please use config generic in CustomTypeValues

#### Example

Usage example

      dataType() {
        return 'boolean';
      },

Or

      dataType(config) {
    	   return typeof config.length !== 'undefined' ? `varchar(${config.length})` : `varchar`;
    	 }

- Defined in node_modules/.pnpm/drizzle-orm@0.44.6_@cloudflare+workers-types@4.20251014.0_@opentelemetry+api@1.9.0_@typ_31a6f5ca8f102af87864dd251ed08d88/node_modules/drizzle-orm/sqlite-core/columns/custom.d.ts:121

### `Optional` fromDriver

fromDriver?: (value: T["driverData"]) => T["data"]

Optional mapping function, that is responsible for data mapping from database to JS/TS code

#### Example

For example, when using timestamp we need to map string Date representation to JS Date

    fromDriver(value: string): Date {
    	return new Date(value);
    },

- Defined in node_modules/.pnpm/drizzle-orm@0.44.6_@cloudflare+workers-types@4.20251014.0_@opentelemetry+api@1.9.0_@typ_31a6f5ca8f102af87864dd251ed08d88/node_modules/drizzle-orm/sqlite-core/columns/custom.d.ts:143

### `Optional` toDriver

toDriver?: (value: T["data"]) => SQL<unknown> | T["driverData"]

Optional mapping function, between user input and driver

#### Example

For example, when using jsonb we need to map JS/TS object to string before writing to database

    toDriver(value: TData): string {
    	 return JSON.stringify(value);
    }

- Defined in node_modules/.pnpm/drizzle-orm@0.44.6_@cloudflare+workers-types@4.20251014.0_@opentelemetry+api@1.9.0_@typ_31a6f5ca8f102af87864dd251ed08d88/node_modules/drizzle-orm/sqlite-core/columns/custom.d.ts:132