# Class SQLiteColumnBuilder<T, TRuntimeConfig, TTypeConfig, TExtraConfig>`Abstract`

#### Type Parameters

- T extends ColumnBuilderBaseConfig<ColumnDataType, string> = ColumnBuilderBaseConfig<ColumnDataType, string>
- TRuntimeConfig extends object = object
- TTypeConfig extends object = object
- TExtraConfig extends ColumnBuilderExtraConfig = object

#### Hierarchy (View Summary)

- ColumnBuilder<
  T,
  TRuntimeConfig,
  TTypeConfig & { dialect: "sqlite" },
  TExtraConfig,
  >
  - SQLiteColumnBuilder
    - SQLiteBigIntBuilder
    - SQLiteBlobJsonBuilder
    - SQLiteBlobBufferBuilder
    - SQLiteCustomColumnBuilder
    - SQLiteBaseIntegerBuilder
    - SQLiteNumericBuilder
    - SQLiteNumericNumberBuilder
    - SQLiteNumericBigIntBuilder
    - SQLiteRealBuilder
    - SQLiteTextBuilder
    - SQLiteTextJsonBuilder

#### Implements

- SQLiteColumnBuilderBase<T, TTypeConfig>

- 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/common.d.ts:24

##### Index

### Constructors

constructor

### Properties

_
$default
$onUpdate
config
[entityKind]

### Methods

$defaultFn
$onUpdateFn
$type
default
generatedAlwaysAs
notNull
primaryKey
references
unique

## Constructors

### constructor

- new SQLiteColumnBuilder<
  T extends
  ColumnBuilderBaseConfig<ColumnDataType, string> = ColumnBuilderBaseConfig<
  ColumnDataType,
  string,
  >,
  TRuntimeConfig extends object = object,
  TTypeConfig extends object = object,
  TExtraConfig extends ColumnBuilderExtraConfig = object,
  >(
  name: T["name"],
  dataType: T["dataType"],
  columnType: T["columnType"],
  ): SQLiteColumnBuilder<T, TRuntimeConfig, TTypeConfig, TExtraConfig>

  #### Type Parameters

  - T extends ColumnBuilderBaseConfig<ColumnDataType, string> = ColumnBuilderBaseConfig<ColumnDataType, string>
  - TRuntimeConfig extends object = object
  - TTypeConfig extends object = object
  - TExtraConfig extends ColumnBuilderExtraConfig = object

  #### Parameters

  - name: T["name"]
  - dataType: T["dataType"]
  - columnType: T["columnType"]

  #### Returns SQLiteColumnBuilder<T, TRuntimeConfig, TTypeConfig, TExtraConfig>

  Inherited from ColumnBuilder<T, TRuntimeConfig, TTypeConfig & { dialect: 'sqlite'; }, TExtraConfig>.constructor

  - 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/column-builder.d.ts:160

## Properties

### _

_: {
[K in string | number | symbol]: (
{
brand: "ColumnBuilder";
columnType: T["columnType"];
data: T["data"];
dataType: T["dataType"];
driverParam: T["driverParam"];
enumValues: T["enumValues"];
generated: T extends { generated: G }
? G extends undefined ? unknown : G
: unknown;
hasDefault: T extends { hasDefault: U } ? U : boolean;
identity: T extends { identity: U } ? U : unknown;
name: T["name"];
notNull: T extends { notNull: U } ? U : boolean;
} & TTypeConfig & { dialect: "sqlite" }
)[K]
}

Implementation of SQLiteColumnBuilderBase._

Inherited from ColumnBuilder._

- 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/column-builder.d.ts:158

### $default

$default: (
fn: () => | SQL<unknown>
| (
{
[K in string
| number
| symbol]: (
{
brand: "ColumnBuilder";
columnType: T["columnType"];
data: T["data"];
dataType: T["dataType"];
driverParam: T["driverParam"];
enumValues: T["enumValues"];
generated: T extends { generated: G }
? G extends undefined ? unknown : G
: unknown;
hasDefault: T extends { hasDefault: U } ? U : boolean;
identity: T extends { identity: U } ? U : unknown;
name: T["name"];
notNull: T extends { notNull: U } ? U : boolean;
} & TTypeConfig & { dialect: "sqlite" }
)[K]
} extends { $type: U }
? U
: {
[K in string | number | symbol]: (
{
brand: "ColumnBuilder";
columnType: T["columnType"];
data: T["data"];
dataType: T["dataType"];
driverParam: T["driverParam"];
enumValues: T["enumValues"];
generated: T extends { generated: ... }
? (...) extends (...) ? (...) : (...)
: unknown;
hasDefault: T extends { hasDefault: ... } ? U : boolean;
identity: T extends { identity: ... } ? U : unknown;
name: T["name"];
notNull: T extends { notNull: ... } ? U : boolean;
} & TTypeConfig & { dialect: "sqlite" }
)[K]
}["data"]
),
) => HasRuntimeDefault<
HasDefault<
SQLiteColumnBuilder<T, TRuntimeConfig, TTypeConfig, TExtraConfig>,
>,
>

Alias for $defaultFn.

Inherited from ColumnBuilder.$default

- 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/column-builder.d.ts:201

### $onUpdate

$onUpdate: (
fn: () => | SQL<unknown>
| (
{
[K in string
| number
| symbol]: (
{
brand: "ColumnBuilder";
columnType: T["columnType"];
data: T["data"];
dataType: T["dataType"];
driverParam: T["driverParam"];
enumValues: T["enumValues"];
generated: T extends { generated: G }
? G extends undefined ? unknown : G
: unknown;
hasDefault: T extends { hasDefault: U } ? U : boolean;
identity: T extends { identity: U } ? U : unknown;
name: T["name"];
notNull: T extends { notNull: U } ? U : boolean;
} & TTypeConfig & { dialect: "sqlite" }
)[K]
} extends { $type: U }
? U
: {
[K in string | number | symbol]: (
{
brand: "ColumnBuilder";
columnType: T["columnType"];
data: T["data"];
dataType: T["dataType"];
driverParam: T["driverParam"];
enumValues: T["enumValues"];
generated: T extends { generated: ... }
? (...) extends (...) ? (...) : (...)
: unknown;
hasDefault: T extends { hasDefault: ... } ? U : boolean;
identity: T extends { identity: ... } ? U : unknown;
name: T["name"];
notNull: T extends { notNull: ... } ? U : boolean;
} & TTypeConfig & { dialect: "sqlite" }
)[K]
}["data"]
),
) => HasDefault<
SQLiteColumnBuilder<T, TRuntimeConfig, TTypeConfig, TExtraConfig>,
>

Alias for $onUpdateFn.

Inherited from ColumnBuilder.$onUpdate

- 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/column-builder.d.ts:217

### `Protected` config

config: ColumnBuilderRuntimeConfig<T["data"], TRuntimeConfig>

Inherited from ColumnBuilder.config

- 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/column-builder.d.ts:159

### `Static` `Readonly`[entityKind]

"[entityKind]": string

Overrides ColumnBuilder.[entityKind]

- 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/common.d.ts:27

## Methods

### $defaultFn

- $defaultFn(
  fn: () => | SQL<unknown>
  | (
  {
  [K in string
  | number
  | symbol]: (
  {
  brand: "ColumnBuilder";
  columnType: T["columnType"];
  data: T["data"];
  dataType: T["dataType"];
  driverParam: T["driverParam"];
  enumValues: T["enumValues"];
  generated: T extends { generated: G }
  ? G extends undefined ? unknown : G
  : unknown;
  hasDefault: T extends { hasDefault: U } ? U : boolean;
  identity: T extends { identity: U } ? U : unknown;
  name: T["name"];
  notNull: T extends { notNull: U } ? U : boolean;
  } & TTypeConfig & { dialect: "sqlite" }
  )[K]
  } extends { $type: U }
  ? U
  : {
  [K in string | number | symbol]: (
  {
  brand: "ColumnBuilder";
  columnType: T["columnType"];
  data: T["data"];
  dataType: T["dataType"];
  driverParam: T["driverParam"];
  enumValues: T["enumValues"];
  generated: T extends { generated: G }
  ? G extends undefined ? unknown : G
  : unknown;
  hasDefault: T extends { hasDefault: U } ? U : boolean;
  identity: T extends { identity: U } ? U : unknown;
  name: T["name"];
  notNull: T extends { notNull: U } ? U : boolean;
  } & TTypeConfig & { dialect: "sqlite" }
  )[K]
  }["data"]
  ),
  ): HasRuntimeDefault<
  HasDefault<
  SQLiteColumnBuilder<T, TRuntimeConfig, TTypeConfig, TExtraConfig>,
  >,
  >

  Adds a dynamic default value to the column. The function will be called when the row is inserted, and the returned value will be used as the column value.

  Note: This value does not affect the `drizzle-kit` behavior, it is only used at runtime in `drizzle-orm`.

  #### Parameters

  - fn: () => | SQL<unknown>
    | (
    {
    [K in string
    | number
    | symbol]: (
    {
    brand: "ColumnBuilder";
    columnType: T["columnType"];
    data: T["data"];
    dataType: T["dataType"];
    driverParam: T["driverParam"];
    enumValues: T["enumValues"];
    generated: T extends { generated: G }
    ? G extends undefined ? unknown : G
    : unknown;
    hasDefault: T extends { hasDefault: U } ? U : boolean;
    identity: T extends { identity: U } ? U : unknown;
    name: T["name"];
    notNull: T extends { notNull: U } ? U : boolean;
    } & TTypeConfig & { dialect: "sqlite" }
    )[K]
    } extends { $type: U }
    ? U
    : {
    [K in string | number | symbol]: (
    {
    brand: "ColumnBuilder";
    columnType: T["columnType"];
    data: T["data"];
    dataType: T["dataType"];
    driverParam: T["driverParam"];
    enumValues: T["enumValues"];
    generated: T extends { generated: G }
    ? G extends undefined ? unknown : G
    : unknown;
    hasDefault: T extends { hasDefault: U } ? U : boolean;
    identity: T extends { identity: U } ? U : unknown;
    name: T["name"];
    notNull: T extends { notNull: U } ? U : boolean;
    } & TTypeConfig & { dialect: "sqlite" }
    )[K]
    }["data"]
    )

  #### Returns HasRuntimeDefault<
  HasDefault<
  SQLiteColumnBuilder<T, TRuntimeConfig, TTypeConfig, TExtraConfig>,
  >,
  >

  Inherited from ColumnBuilder.$defaultFn

  - 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/column-builder.d.ts:195

### $onUpdateFn

- $onUpdateFn(
  fn: () => | SQL<unknown>
  | (
  {
  [K in string
  | number
  | symbol]: (
  {
  brand: "ColumnBuilder";
  columnType: T["columnType"];
  data: T["data"];
  dataType: T["dataType"];
  driverParam: T["driverParam"];
  enumValues: T["enumValues"];
  generated: T extends { generated: G }
  ? G extends undefined ? unknown : G
  : unknown;
  hasDefault: T extends { hasDefault: U } ? U : boolean;
  identity: T extends { identity: U } ? U : unknown;
  name: T["name"];
  notNull: T extends { notNull: U } ? U : boolean;
  } & TTypeConfig & { dialect: "sqlite" }
  )[K]
  } extends { $type: U }
  ? U
  : {
  [K in string | number | symbol]: (
  {
  brand: "ColumnBuilder";
  columnType: T["columnType"];
  data: T["data"];
  dataType: T["dataType"];
  driverParam: T["driverParam"];
  enumValues: T["enumValues"];
  generated: T extends { generated: G }
  ? G extends undefined ? unknown : G
  : unknown;
  hasDefault: T extends { hasDefault: U } ? U : boolean;
  identity: T extends { identity: U } ? U : unknown;
  name: T["name"];
  notNull: T extends { notNull: U } ? U : boolean;
  } & TTypeConfig & { dialect: "sqlite" }
  )[K]
  }["data"]
  ),
  ): HasDefault<
  SQLiteColumnBuilder<T, TRuntimeConfig, TTypeConfig, TExtraConfig>,
  >

  Adds a dynamic update value to the column. The function will be called when the row is updated, and the returned value will be used as the column value if none is provided. If no `default` (or `$defaultFn`) value is provided, the function will be called when the row is inserted as well, and the returned value will be used as the column value.

  Note: This value does not affect the `drizzle-kit` behavior, it is only used at runtime in `drizzle-orm`.

  #### Parameters

  - fn: () => | SQL<unknown>
    | (
    {
    [K in string
    | number
    | symbol]: (
    {
    brand: "ColumnBuilder";
    columnType: T["columnType"];
    data: T["data"];
    dataType: T["dataType"];
    driverParam: T["driverParam"];
    enumValues: T["enumValues"];
    generated: T extends { generated: G }
    ? G extends undefined ? unknown : G
    : unknown;
    hasDefault: T extends { hasDefault: U } ? U : boolean;
    identity: T extends { identity: U } ? U : unknown;
    name: T["name"];
    notNull: T extends { notNull: U } ? U : boolean;
    } & TTypeConfig & { dialect: "sqlite" }
    )[K]
    } extends { $type: U }
    ? U
    : {
    [K in string | number | symbol]: (
    {
    brand: "ColumnBuilder";
    columnType: T["columnType"];
    data: T["data"];
    dataType: T["dataType"];
    driverParam: T["driverParam"];
    enumValues: T["enumValues"];
    generated: T extends { generated: G }
    ? G extends undefined ? unknown : G
    : unknown;
    hasDefault: T extends { hasDefault: U } ? U : boolean;
    identity: T extends { identity: U } ? U : unknown;
    name: T["name"];
    notNull: T extends { notNull: U } ? U : boolean;
    } & TTypeConfig & { dialect: "sqlite" }
    )[K]
    }["data"]
    )

  #### Returns HasDefault<SQLiteColumnBuilder<T, TRuntimeConfig, TTypeConfig, TExtraConfig>>

  Inherited from ColumnBuilder.$onUpdateFn

  - 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/column-builder.d.ts:211

### $type

- $type<TType>(): $Type<
  SQLiteColumnBuilder<T, TRuntimeConfig, TTypeConfig, TExtraConfig>,
  TType,
  >

  Changes the data type of the column. Commonly used with `json` columns. Also, useful for branded types.

  #### Type Parameters

  - TType

  #### Returns $Type<SQLiteColumnBuilder<T, TRuntimeConfig, TTypeConfig, TExtraConfig>, TType>

  #### Example

      const users = pgTable('users', {
      	id: integer('id').$type<UserId>().primaryKey(),
      	details: json('details').$type<UserDetails>().notNull(),
      });

  Inherited from ColumnBuilder.$type

  - 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/column-builder.d.ts:172

### default

- default(
  value:
  | SQL<unknown>
  | (
  {
  [K in string
  | number
  | symbol]: (
  {
  brand: "ColumnBuilder";
  columnType: T["columnType"];
  data: T["data"];
  dataType: T["dataType"];
  driverParam: T["driverParam"];
  enumValues: T["enumValues"];
  generated: T extends { generated: G }
  ? G extends undefined ? unknown : G
  : unknown;
  hasDefault: T extends { hasDefault: U } ? U : boolean;
  identity: T extends { identity: U } ? U : unknown;
  name: T["name"];
  notNull: T extends { notNull: U } ? U : boolean;
  } & TTypeConfig & { dialect: "sqlite" }
  )[K]
  } extends { $type: U }
  ? U
  : {
  [K in string | number | symbol]: (
  {
  brand: "ColumnBuilder";
  columnType: T["columnType"];
  data: T["data"];
  dataType: T["dataType"];
  driverParam: T["driverParam"];
  enumValues: T["enumValues"];
  generated: T extends { generated: G }
  ? G extends undefined ? unknown : G
  : unknown;
  hasDefault: T extends { hasDefault: U } ? U : boolean;
  identity: T extends { identity: U } ? U : unknown;
  name: T["name"];
  notNull: T extends { notNull: U } ? U : boolean;
  } & TTypeConfig & { dialect: "sqlite" }
  )[K]
  }["data"]
  ),
  ): HasDefault<
  SQLiteColumnBuilder<T, TRuntimeConfig, TTypeConfig, TExtraConfig>,
  >

  Adds a `default <value>` clause to the column definition.

  Affects the `insert` model of the table - columns with `default` are optional on insert.

  If you need to set a dynamic default value, use $defaultFn instead.

  #### Parameters

  - value:
    | SQL<unknown>
    | (
    {
    [K in string
    | number
    | symbol]: (
    {
    brand: "ColumnBuilder";
    columnType: T["columnType"];
    data: T["data"];
    dataType: T["dataType"];
    driverParam: T["driverParam"];
    enumValues: T["enumValues"];
    generated: T extends { generated: G }
    ? G extends undefined ? unknown : G
    : unknown;
    hasDefault: T extends { hasDefault: U } ? U : boolean;
    identity: T extends { identity: U } ? U : unknown;
    name: T["name"];
    notNull: T extends { notNull: U } ? U : boolean;
    } & TTypeConfig & { dialect: "sqlite" }
    )[K]
    } extends { $type: U }
    ? U
    : {
    [K in string | number | symbol]: (
    {
    brand: "ColumnBuilder";
    columnType: T["columnType"];
    data: T["data"];
    dataType: T["dataType"];
    driverParam: T["driverParam"];
    enumValues: T["enumValues"];
    generated: T extends { generated: G }
    ? G extends undefined ? unknown : G
    : unknown;
    hasDefault: T extends { hasDefault: U } ? U : boolean;
    identity: T extends { identity: U } ? U : unknown;
    name: T["name"];
    notNull: T extends { notNull: U } ? U : boolean;
    } & TTypeConfig & { dialect: "sqlite" }
    )[K]
    }["data"]
    )

  #### Returns HasDefault<SQLiteColumnBuilder<T, TRuntimeConfig, TTypeConfig, TExtraConfig>>

  Inherited from ColumnBuilder.default

  - 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/column-builder.d.ts:186

### generatedAlwaysAs

- generatedAlwaysAs(
  as: SQL<unknown> | T["data"] | (() => SQL),
  config?: SQLiteGeneratedColumnConfig,
  ): HasGenerated<
  SQLiteColumnBuilder<T, TRuntimeConfig, TTypeConfig, TExtraConfig>,
  { type: "always" },
  >

  #### Parameters

  - as: SQL<unknown> | T["data"] | (() => SQL)
  - `Optional` config: SQLiteGeneratedColumnConfig

  #### Returns HasGenerated<
  SQLiteColumnBuilder<T, TRuntimeConfig, TTypeConfig, TExtraConfig>,
  { type: "always" },
  >

  Overrides ColumnBuilder.generatedAlwaysAs

  - 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/common.d.ts:31

### notNull

- notNull(): NotNull<
  SQLiteColumnBuilder<T, TRuntimeConfig, TTypeConfig, TExtraConfig>,
  >

  Adds a `not null` clause to the column definition.

  Affects the `select` model of the table - columns without `not null` will be nullable on select.

  #### Returns NotNull<SQLiteColumnBuilder<T, TRuntimeConfig, TTypeConfig, TExtraConfig>>

  Inherited from ColumnBuilder.notNull

  - 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/column-builder.d.ts:178

### primaryKey

- primaryKey(): TExtraConfig["primaryKeyHasDefault"] extends true
  ? IsPrimaryKey<
  HasDefault<
  NotNull<
  SQLiteColumnBuilder<T, TRuntimeConfig, TTypeConfig, TExtraConfig>,
  >,
  >,
  >
  : IsPrimaryKey<
  NotNull<
  SQLiteColumnBuilder<T, TRuntimeConfig, TTypeConfig, TExtraConfig>,
  >,
  >

  Adds a `primary key` clause to the column definition. This implicitly makes the column `not null`.

  In SQLite, `integer primary key` implicitly makes the column auto-incrementing.

  #### Returns TExtraConfig["primaryKeyHasDefault"] extends true
  ? IsPrimaryKey<
  HasDefault<
  NotNull<
  SQLiteColumnBuilder<T, TRuntimeConfig, TTypeConfig, TExtraConfig>,
  >,
  >,
  >
  : IsPrimaryKey<
  NotNull<
  SQLiteColumnBuilder<T, TRuntimeConfig, TTypeConfig, TExtraConfig>,
  >,
  >

  Inherited from ColumnBuilder.primaryKey

  - 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/column-builder.d.ts:225

### references

- references(
  ref: () => SQLiteColumn,
  actions?: { onDelete?: UpdateDeleteAction; onUpdate?: UpdateDeleteAction },
  ): this

  #### Parameters

  - ref: () => SQLiteColumn
  - `Optional` actions: { onDelete?: UpdateDeleteAction; onUpdate?: UpdateDeleteAction }

  #### Returns this

  - 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/common.d.ts:29

### unique

- unique(name?: string): this

  #### Parameters

  - `Optional` name: string

  #### Returns this

  - 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/common.d.ts:30