# Class ViewBuilder<TName>

#### Type Parameters

- TName extends string = string

#### Hierarchy (View Summary)

- ViewBuilderCore<{ name: TName }>
  - ViewBuilder

- 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/view.d.ts:28

##### Index

### Constructors

constructor

### Properties

_
config
name
[entityKind]

### Methods

as

## Constructors

### constructor

- new ViewBuilder<TName extends string = string>(name: TName): ViewBuilder<TName>

  #### Type Parameters

  - TName extends string = string

  #### Parameters

  - name: TName

  #### Returns ViewBuilder<TName>

  Inherited from ViewBuilderCore.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/sqlite-core/view.d.ts:25

## Properties

### `Readonly`_

_: { columns: unknown; name: TName }

Inherited from ViewBuilderCore._

- 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/view.d.ts:21

### `Protected` config

config: ViewBuilderConfig

Inherited from ViewBuilderCore.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/sqlite-core/view.d.ts:26

### `Protected` name

name: TName

Inherited from ViewBuilderCore.name

- 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/view.d.ts:19

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

"[entityKind]": string

Overrides ViewBuilderCore.[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/view.d.ts:31

## Methods

### as

- as<TSelection extends ColumnsSelection>(
  qb:
  | TypedQueryBuilder<TSelection, unknown, unknown>
  | ((qb: QueryBuilder) => TypedQueryBuilder<TSelection>),
  ): SQLiteViewWithSelection<
  TName,
  false,
  {
  [K in string
  | number
  | symbol]: (
  IsAny<TSelection> extends true
  ? any
  : {
  [Key in string | number | symbol]: TSelection[Key] extends Column<
  ColumnBaseConfig<ColumnDataType, string>,
  object,
  object,
  >
  ? SQLiteColumn<
  {
  baseColumn: any[any]["_"] extends { baseBuilder: U }
  ? Column<
  {
  baseColumn: ...;
  columnType: ...;
  data: ...;
  dataType: ...;
  driverParam: ...;
  enumValues: ...;
  generated: ...;
  hasDefault: ...;
  hasRuntimeDefault: ...;
  identity: ...;
  isAutoincrement: ...;
  isPrimaryKey: ...;
  name: ...;
  notNull: ...;
  tableName: ...;
  },
  {},
  { [K in (...)]: (...) },
  >
  : never;
  columnType: any[any]["_"]["columnType"];
  data: any[any]["_"] extends { $type: U } ? U : (...)[(...)]["data"];
  dataType: any[any]["_"]["dataType"];
  driverParam: any[any]["_"]["driverParam"];
  enumValues: any[any]["_"]["enumValues"];
  generated: any[any]["_"] extends { generated: G }
  ? unknown extends G
  ? undefined
  : (...) extends (...) ? (...) : (...)
  : undefined;
  hasDefault: any[any]["_"] extends { hasDefault: true }
  ? true
  : false;
  hasRuntimeDefault: any[any]["_"] extends { hasRuntimeDefault: true }
  ? true
  : false;
  identity: any[any]["_"] extends { identity: "always" }
  ? "always"
  : (...)[(...)] extends { identity: ... } ? "byDefault" : undefined;
  isAutoincrement: any[any]["_"] extends { isAutoincrement: true }
  ? true
  : false;
  isPrimaryKey: any[any]["_"] extends { isPrimaryKey: true }
  ? true
  : false;
  name: any[any]["_"]["name"];
  notNull: any[any]["_"] extends { notNull: true } ? true : false;
  tableName: TName;
  },
  {},
  {},
  >
  : TSelection[Key] extends Table<
  TableConfig<Column<any, object, object>>,
  >
  ? {
  [K in string | number | symbol]: (
  IsAny<(...)> extends true ? any : { [Key in (...)]: (...) }
  )[K]
  }
  : TSelection[Key] extends SQL<unknown>
  | Aliased<unknown>
  ? any[any]
  : TSelection[Key] extends ColumnsSelection
  ? {
  [Key in (...)
  | (...)
  | (...)]: (...) extends (...) ? (...) : (...)
  }
  : never
  }
  )[K]
  },
  >

  #### Type Parameters

  - TSelection extends ColumnsSelection

  #### Parameters

  - qb:
    | TypedQueryBuilder<TSelection, unknown, unknown>
    | ((qb: QueryBuilder) => TypedQueryBuilder<TSelection>)

  #### Returns SQLiteViewWithSelection<
  TName,
  false,
  {
  [K in string
  | number
  | symbol]: (
  IsAny<TSelection> extends true
  ? any
  : {
  [Key in string | number | symbol]: TSelection[Key] extends Column<
  ColumnBaseConfig<ColumnDataType, string>,
  object,
  object,
  >
  ? SQLiteColumn<
  {
  baseColumn: any[any]["_"] extends { baseBuilder: U }
  ? Column<
  {
  baseColumn: ...;
  columnType: ...;
  data: ...;
  dataType: ...;
  driverParam: ...;
  enumValues: ...;
  generated: ...;
  hasDefault: ...;
  hasRuntimeDefault: ...;
  identity: ...;
  isAutoincrement: ...;
  isPrimaryKey: ...;
  name: ...;
  notNull: ...;
  tableName: ...;
  },
  {},
  { [K in (...)]: (...) },
  >
  : never;
  columnType: any[any]["_"]["columnType"];
  data: any[any]["_"] extends { $type: U } ? U : (...)[(...)]["data"];
  dataType: any[any]["_"]["dataType"];
  driverParam: any[any]["_"]["driverParam"];
  enumValues: any[any]["_"]["enumValues"];
  generated: any[any]["_"] extends { generated: G }
  ? unknown extends G
  ? undefined
  : (...) extends (...) ? (...) : (...)
  : undefined;
  hasDefault: any[any]["_"] extends { hasDefault: true }
  ? true
  : false;
  hasRuntimeDefault: any[any]["_"] extends { hasRuntimeDefault: true }
  ? true
  : false;
  identity: any[any]["_"] extends { identity: "always" }
  ? "always"
  : (...)[(...)] extends { identity: ... } ? "byDefault" : undefined;
  isAutoincrement: any[any]["_"] extends { isAutoincrement: true }
  ? true
  : false;
  isPrimaryKey: any[any]["_"] extends { isPrimaryKey: true }
  ? true
  : false;
  name: any[any]["_"]["name"];
  notNull: any[any]["_"] extends { notNull: true } ? true : false;
  tableName: TName;
  },
  {},
  {},
  >
  : TSelection[Key] extends Table<
  TableConfig<Column<any, object, object>>,
  >
  ? {
  [K in string | number | symbol]: (
  IsAny<(...)> extends true ? any : { [Key in (...)]: (...) }
  )[K]
  }
  : TSelection[Key] extends SQL<unknown>
  | Aliased<unknown>
  ? any[any]
  : TSelection[Key] extends ColumnsSelection
  ? {
  [Key in (...)
  | (...)
  | (...)]: (...) extends (...) ? (...) : (...)
  }
  : never
  }
  )[K]
  },
  >

  - 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/view.d.ts:32