# Interface WithBuilder

- WithBuilder<TAlias extends string>(
  alias: TAlias,
  ): {
  as: {
  <TSelection extends ColumnsSelection>(
  qb:
  | TypedQueryBuilder<TSelection, unknown, unknown>
  | ((qb: QueryBuilder) => TypedQueryBuilder<TSelection>),
  ): WithSubqueryWithSelection<TSelection, TAlias>;
  (
  qb:
  | TypedQueryBuilder<undefined, unknown, unknown>
  | ((qb: QueryBuilder) => TypedQueryBuilder<undefined>),
  ): WithSubqueryWithoutSelection<TAlias>;
  };
  }

  #### Type Parameters

  - TAlias extends string

  #### Parameters

  - alias: TAlias

  #### Returns {
  as: {
  <TSelection extends ColumnsSelection>(
  qb:
  | TypedQueryBuilder<TSelection, unknown, unknown>
  | ((qb: QueryBuilder) => TypedQueryBuilder<TSelection>),
  ): WithSubqueryWithSelection<TSelection, TAlias>;
  (
  qb:
  | TypedQueryBuilder<undefined, unknown, unknown>
  | ((qb: QueryBuilder) => TypedQueryBuilder<undefined>),
  ): WithSubqueryWithoutSelection<TAlias>;
  };
  }

  - 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/subquery.d.ts:9
- WithBuilder<TAlias extends string, TSelection extends ColumnsSelection>(
  alias: TAlias,
  selection: TSelection,
  ): {
  as: (
  qb: SQL<unknown> | ((qb: QueryBuilder) => SQL),
  ) => WithSubqueryWithSelection<TSelection, TAlias>;
  }

  #### Type Parameters

  - TAlias extends string
  - TSelection extends ColumnsSelection

  #### Parameters

  - alias: TAlias
  - selection: TSelection

  #### Returns {
  as: (
  qb: SQL<unknown> | ((qb: QueryBuilder) => SQL),
  ) => WithSubqueryWithSelection<TSelection, TAlias>;
  }

  - 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/subquery.d.ts:15