# Class SQLiteSelectBase<TTableName, TResultType, TRunResult, TSelection, TSelectMode, TNullabilityMap, TDynamic, TExcludedMethods, TResult, TSelectedFields>

#### Type Parameters

- TTableName extends string | undefined
- TResultType extends "sync" | "async"
- TRunResult
- TSelection extends ColumnsSelection
- TSelectMode extends SelectMode = "single"
- TNullabilityMap extends Record<string, JoinNullability> = TTableName extends string ? Record<TTableName, "not-null"> : {}
- TDynamic extends boolean = false
- TExcludedMethods extends string = never
- TResult extends any[] = SelectResult<TSelection, TSelectMode, TNullabilityMap>[]
- TSelectedFields extends ColumnsSelection = BuildSubquerySelection<TSelection, TNullabilityMap>

#### Hierarchy (View Summary)

- SQLiteSelectQueryBuilderBase<
  SQLiteSelectHKT,
  TTableName,
  TResultType,
  TRunResult,
  TSelection,
  TSelectMode,
  TNullabilityMap,
  TDynamic,
  TExcludedMethods,
  TResult,
  TSelectedFields,
  >
- QueryPromise<TResult>
  - SQLiteSelectBase

#### Implements

- RunnableQuery<TResult, "sqlite">
- SQLWrapper

- 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/query-builders/select.d.ts:450
- 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/query-builders/select.d.ts:452

##### Index

### Constructors

constructor

### Properties

_
[toStringTag]
all
cacheConfig?
crossJoin
dialect
except
fullJoin
get
innerJoin
intersect
joinsNotNullableMap
leftJoin
rightJoin
run
session
union
unionAll
usedTables
values
[entityKind]

### Methods

$dynamic
$withCache
as
catch
execute
finally
getSQL
groupBy
having
limit
offset
orderBy
prepare
then
toSQL
where

## Constructors

### constructor

- new SQLiteSelectBase<
  TTableName extends string
  | undefined,
  TResultType extends "sync" | "async",
  TRunResult,
  TSelection extends ColumnsSelection,
  TSelectMode extends SelectMode = "single",
  TNullabilityMap extends
  Record<string, JoinNullability> = TTableName extends string
  ? Record<TTableName<TTableName>, "not-null">
  : {},
  TDynamic extends boolean = false,
  TExcludedMethods extends string = never,
  TResult extends
  any[] = SelectResult<TSelection, TSelectMode, TNullabilityMap>[],
  TSelectedFields extends
  ColumnsSelection = BuildSubquerySelection<TSelection, TNullabilityMap>,
  >(
  __namedParameters: {
  dialect: SQLiteDialect;
  distinct: boolean | undefined;
  fields: Record<string, unknown>;
  isPartialSelect: boolean;
  session: SQLiteSession<any, any, any, any> | undefined;
  table:
  | SQLiteTable<TableConfig>
  | SQLiteViewBase<string, boolean, ColumnsSelection>
  | SQL<unknown>
  | Subquery<string, Record<string, unknown>>;
  withList: Subquery<string, Record<string, unknown>>[] | undefined;
  },
  ): SQLiteSelectBase<
  TTableName,
  TResultType,
  TRunResult,
  TSelection,
  TSelectMode,
  TNullabilityMap,
  TDynamic,
  TExcludedMethods,
  TResult,
  TSelectedFields,
  >

  #### Type Parameters

  - TTableName extends string | undefined
  - TResultType extends "sync" | "async"
  - TRunResult
  - TSelection extends ColumnsSelection
  - TSelectMode extends SelectMode = "single"
  - TNullabilityMap extends Record<string, JoinNullability> = TTableName extends string ? Record<TTableName<TTableName>, "not-null"> : {}
  - TDynamic extends boolean = false
  - TExcludedMethods extends string = never
  - TResult extends any[] = SelectResult<TSelection, TSelectMode, TNullabilityMap>[]
  - TSelectedFields extends ColumnsSelection = BuildSubquerySelection<TSelection, TNullabilityMap>

  #### Parameters

  - __namedParameters: {
    dialect: SQLiteDialect;
    distinct: boolean | undefined;
    fields: Record<string, unknown>;
    isPartialSelect: boolean;
    session: SQLiteSession<any, any, any, any> | undefined;
    table:
    | SQLiteTable<TableConfig>
    | SQLiteViewBase<string, boolean, ColumnsSelection>
    | SQL<unknown>
    | Subquery<string, Record<string, unknown>>;
    withList: Subquery<string, Record<string, unknown>>[] | undefined;
    }

  #### Returns SQLiteSelectBase<
  TTableName,
  TResultType,
  TRunResult,
  TSelection,
  TSelectMode,
  TNullabilityMap,
  TDynamic,
  TExcludedMethods,
  TResult,
  TSelectedFields,
  >

  Inherited from SQLiteSelectQueryBuilderBase.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/query-builders/select.d.ts:58

## Properties

### `Readonly`_

_: {
config: SQLiteSelectConfig;
dialect: "sqlite";
dynamic: TDynamic;
excludedMethods: TExcludedMethods;
hkt: SQLiteSelectHKT;
nullabilityMap: TNullabilityMap;
result: TResult;
resultType: TResultType;
runResult: TRunResult;
selectedFields: TSelectedFields;
selection: TSelection;
selectMode: TSelectMode;
tableName: TTableName;
}

Inherited from SQLiteSelectQueryBuilderBase._

- 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/query-builders/select.d.ts:36

### [toStringTag]

"[toStringTag]": string

Inherited from QueryPromise.[toStringTag]

- 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/query-promise.d.ts:4

### all

all: (
placeholderValues?: Record<string, unknown>,
) => Result<TResultType, TResult>

- 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/query-builders/select.d.ts:461

### `Protected` `Optional` cacheConfig

cacheConfig?: WithCacheConfig

Inherited from SQLiteSelectQueryBuilderBase.cacheConfig

- 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/query-builders/select.d.ts:56

### crossJoin

crossJoin: SQLiteSelectCrossJoinFn<
SQLiteSelectBase<
TTableName,
TResultType,
TRunResult,
TSelection,
TSelectMode,
TNullabilityMap,
TDynamic,
TExcludedMethods,
TResult,
TSelectedFields,
>,
TDynamic,
>

Executes a `cross join` operation by combining rows from two tables into a new table.

Calling this method retrieves all rows from both main and joined tables, merging all rows from each table.

See docs: https://orm.drizzle.team/docs/joins#cross-join

#### Param: table

the table to join.

#### Example

    // Select all users, each user with every pet
    const usersWithPets: { user: User; pets: Pet; }[] = await db.select()
      .from(users)
      .crossJoin(pets)

    // Select userId and petId
    const usersIdsAndPetIds: { userId: number; petId: number; }[] = await db.select({
      userId: users.id,
      petId: pets.id,
    })
      .from(users)
      .crossJoin(pets)

Inherited from SQLiteSelectQueryBuilderBase.crossJoin

- 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/query-builders/select.d.ts:206

### `Protected` dialect

dialect: SQLiteDialect

Inherited from SQLiteSelectQueryBuilderBase.dialect

- 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/query-builders/select.d.ts:55

### except

except: <TValue extends SQLiteSetOperatorWithResult<TResult>>(
rightSelection:
| (
(
setOperators: GetSQLiteSetOperators,
) => SetOperatorRightSelect<TValue, TResult>
)
| SetOperatorRightSelect<TValue, TResult>,
) => SQLiteSelectWithout<
SQLiteSelectBase<
TTableName,
TResultType,
TRunResult,
TSelection,
TSelectMode,
TNullabilityMap,
TDynamic,
TExcludedMethods,
TResult,
TSelectedFields,
>,
TDynamic,
SQLiteSetOperatorExcludedMethods,
true,
>

Adds `except` set operator to the query.

Calling this method will retrieve all unique rows from the left query, except for the rows that are present in the result set of the right query.

See docs: https://orm.drizzle.team/docs/set-operations#except

#### Example

    // Select all courses offered in department A but not in department B
    await db.select({ courseName: depA.courseName })
      .from(depA)
      .except(
        db.select({ courseName: depB.courseName }).from(depB)
      );
    // or
    import { except } from 'drizzle-orm/sqlite-core'

    await except(
      db.select({ courseName: depA.courseName }).from(depA),
      db.select({ courseName: depB.courseName }).from(depB)
    );

Inherited from SQLiteSelectQueryBuilderBase.except

- 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/query-builders/select.d.ts:311

### fullJoin

fullJoin: SQLiteSelectJoinFn<
SQLiteSelectBase<
TTableName,
TResultType,
TRunResult,
TSelection,
TSelectMode,
TNullabilityMap,
TDynamic,
TExcludedMethods,
TResult,
TSelectedFields,
>,
TDynamic,
"full",
>

Executes a `full join` operation by combining rows from two tables into a new table.

Calling this method retrieves all rows from both main and joined tables, merging rows with matching values and filling in `null` for non-matching columns.

See docs: https://orm.drizzle.team/docs/joins#full-join

#### Param: table

the table to join.

#### Param: on

the `on` clause.

#### Example

    // Select all users and their pets
    const usersWithPets: { user: User | null; pets: Pet | null; }[] = await db.select()
      .from(users)
      .fullJoin(pets, eq(users.id, pets.ownerId))

    // Select userId and petId
    const usersIdsAndPetIds: { userId: number | null; petId: number | null; }[] = await db.select({
      userId: users.id,
      petId: pets.id,
    })
      .from(users)
      .fullJoin(pets, eq(users.id, pets.ownerId))

Inherited from SQLiteSelectQueryBuilderBase.fullJoin

- 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/query-builders/select.d.ts:179

### get

get: (
placeholderValues?: Record<string, unknown>,
) => Result<TResultType, TResult[number] | undefined>

- 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/query-builders/select.d.ts:462

### innerJoin

innerJoin: SQLiteSelectJoinFn<
SQLiteSelectBase<
TTableName,
TResultType,
TRunResult,
TSelection,
TSelectMode,
TNullabilityMap,
TDynamic,
TExcludedMethods,
TResult,
TSelectedFields,
>,
TDynamic,
"inner",
>

Executes an `inner join` operation, creating a new table by combining rows from two tables that have matching values.

Calling this method retrieves rows that have corresponding entries in both joined tables. Rows without matching entries in either table are excluded, resulting in a table that includes only matching pairs.

See docs: https://orm.drizzle.team/docs/joins#inner-join

#### Param: table

the table to join.

#### Param: on

the `on` clause.

#### Example

    // Select all users and their pets
    const usersWithPets: { user: User; pets: Pet; }[] = await db.select()
      .from(users)
      .innerJoin(pets, eq(users.id, pets.ownerId))

    // Select userId and petId
    const usersIdsAndPetIds: { userId: number; petId: number; }[] = await db.select({
      userId: users.id,
      petId: pets.id,
    })
      .from(users)
      .innerJoin(pets, eq(users.id, pets.ownerId))

Inherited from SQLiteSelectQueryBuilderBase.innerJoin

- 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/query-builders/select.d.ts:151

### intersect

intersect: <TValue extends SQLiteSetOperatorWithResult<TResult>>(
rightSelection:
| (
(
setOperators: GetSQLiteSetOperators,
) => SetOperatorRightSelect<TValue, TResult>
)
| SetOperatorRightSelect<TValue, TResult>,
) => SQLiteSelectWithout<
SQLiteSelectBase<
TTableName,
TResultType,
TRunResult,
TSelection,
TSelectMode,
TNullabilityMap,
TDynamic,
TExcludedMethods,
TResult,
TSelectedFields,
>,
TDynamic,
SQLiteSetOperatorExcludedMethods,
true,
>

Adds `intersect` set operator to the query.

Calling this method will retain only the rows that are present in both result sets and eliminate duplicates.

See docs: https://orm.drizzle.team/docs/set-operations#intersect

#### Example

    // Select course names that are offered in both departments A and B
    await db.select({ courseName: depA.courseName })
      .from(depA)
      .intersect(
        db.select({ courseName: depB.courseName }).from(depB)
      );
    // or
    import { intersect } from 'drizzle-orm/sqlite-core'

    await intersect(
      db.select({ courseName: depA.courseName }).from(depA),
      db.select({ courseName: depB.courseName }).from(depB)
    );

Inherited from SQLiteSelectQueryBuilderBase.intersect

- 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/query-builders/select.d.ts:285

### `Protected` joinsNotNullableMap

joinsNotNullableMap: Record<string, boolean>

Inherited from SQLiteSelectQueryBuilderBase.joinsNotNullableMap

- 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/query-builders/select.d.ts:51

### leftJoin

leftJoin: SQLiteSelectJoinFn<
SQLiteSelectBase<
TTableName,
TResultType,
TRunResult,
TSelection,
TSelectMode,
TNullabilityMap,
TDynamic,
TExcludedMethods,
TResult,
TSelectedFields,
>,
TDynamic,
"left",
>

Executes a `left join` operation by adding another table to the current query.

Calling this method associates each row of the table with the corresponding row from the joined table, if a match is found. If no matching row exists, it sets all columns of the joined table to null.

See docs: https://orm.drizzle.team/docs/joins#left-join

#### Param: table

the table to join.

#### Param: on

the `on` clause.

#### Example

    // Select all users and their pets
    const usersWithPets: { user: User; pets: Pet | null; }[] = await db.select()
      .from(users)
      .leftJoin(pets, eq(users.id, pets.ownerId))

    // Select userId and petId
    const usersIdsAndPetIds: { userId: number; petId: number | null; }[] = await db.select({
      userId: users.id,
      petId: pets.id,
    })
      .from(users)
      .leftJoin(pets, eq(users.id, pets.ownerId))

Inherited from SQLiteSelectQueryBuilderBase.leftJoin

- 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/query-builders/select.d.ts:95

### rightJoin

rightJoin: SQLiteSelectJoinFn<
SQLiteSelectBase<
TTableName,
TResultType,
TRunResult,
TSelection,
TSelectMode,
TNullabilityMap,
TDynamic,
TExcludedMethods,
TResult,
TSelectedFields,
>,
TDynamic,
"right",
>

Executes a `right join` operation by adding another table to the current query.

Calling this method associates each row of the joined table with the corresponding row from the main table, if a match is found. If no matching row exists, it sets all columns of the main table to null.

See docs: https://orm.drizzle.team/docs/joins#right-join

#### Param: table

the table to join.

#### Param: on

the `on` clause.

#### Example

    // Select all users and their pets
    const usersWithPets: { user: User | null; pets: Pet; }[] = await db.select()
      .from(users)
      .rightJoin(pets, eq(users.id, pets.ownerId))

    // Select userId and petId
    const usersIdsAndPetIds: { userId: number | null; petId: number; }[] = await db.select({
      userId: users.id,
      petId: pets.id,
    })
      .from(users)
      .rightJoin(pets, eq(users.id, pets.ownerId))

Inherited from SQLiteSelectQueryBuilderBase.rightJoin

- 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/query-builders/select.d.ts:123

### run

run: (
placeholderValues?: Record<string, unknown>,
) => Result<TResultType, TRunResult>

- 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/query-builders/select.d.ts:460

### `Protected` session

session: SQLiteSession<any, any, any, any> | undefined

Inherited from SQLiteSelectQueryBuilderBase.session

- 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/query-builders/select.d.ts:54

### union

union: <TValue extends SQLiteSetOperatorWithResult<TResult>>(
rightSelection:
| (
(
setOperators: GetSQLiteSetOperators,
) => SetOperatorRightSelect<TValue, TResult>
)
| SetOperatorRightSelect<TValue, TResult>,
) => SQLiteSelectWithout<
SQLiteSelectBase<
TTableName,
TResultType,
TRunResult,
TSelection,
TSelectMode,
TNullabilityMap,
TDynamic,
TExcludedMethods,
TResult,
TSelectedFields,
>,
TDynamic,
SQLiteSetOperatorExcludedMethods,
true,
>

Adds `union` set operator to the query.

Calling this method will combine the result sets of the `select` statements and remove any duplicate rows that appear across them.

See docs: https://orm.drizzle.team/docs/set-operations#union

#### Example

    // Select all unique names from customers and users tables
    await db.select({ name: users.name })
      .from(users)
      .union(
        db.select({ name: customers.name }).from(customers)
      );
    // or
    import { union } from 'drizzle-orm/sqlite-core'

    await union(
      db.select({ name: users.name }).from(users),
      db.select({ name: customers.name }).from(customers)
    );

Inherited from SQLiteSelectQueryBuilderBase.union

- 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/query-builders/select.d.ts:233

### unionAll

unionAll: <TValue extends SQLiteSetOperatorWithResult<TResult>>(
rightSelection:
| (
(
setOperators: GetSQLiteSetOperators,
) => SetOperatorRightSelect<TValue, TResult>
)
| SetOperatorRightSelect<TValue, TResult>,
) => SQLiteSelectWithout<
SQLiteSelectBase<
TTableName,
TResultType,
TRunResult,
TSelection,
TSelectMode,
TNullabilityMap,
TDynamic,
TExcludedMethods,
TResult,
TSelectedFields,
>,
TDynamic,
SQLiteSetOperatorExcludedMethods,
true,
>

Adds `union all` set operator to the query.

Calling this method will combine the result-set of the `select` statements and keep all duplicate rows that appear across them.

See docs: https://orm.drizzle.team/docs/set-operations#union-all

#### Example

    // Select all transaction ids from both online and in-store sales
    await db.select({ transaction: onlineSales.transactionId })
      .from(onlineSales)
      .unionAll(
        db.select({ transaction: inStoreSales.transactionId }).from(inStoreSales)
      );
    // or
    import { unionAll } from 'drizzle-orm/sqlite-core'

    await unionAll(
      db.select({ transaction: onlineSales.transactionId }).from(onlineSales),
      db.select({ transaction: inStoreSales.transactionId }).from(inStoreSales)
    );

Inherited from SQLiteSelectQueryBuilderBase.unionAll

- 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/query-builders/select.d.ts:259

### `Protected` usedTables

usedTables: Set<string>

Inherited from SQLiteSelectQueryBuilderBase.usedTables

- 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/query-builders/select.d.ts:57

### values

values: (
placeholderValues?: Record<string, unknown>,
) => Result<TResultType, any[][]>

- 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/query-builders/select.d.ts:463

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

"[entityKind]": string

Inherited from SQLiteSelectQueryBuilderBase.[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/query-builders/select.d.ts:453

## Methods

### $dynamic

- $dynamic(): SQLiteSelectDynamic<
  SQLiteSelectBase<
  TTableName,
  TResultType,
  TRunResult,
  TSelection,
  TSelectMode,
  TNullabilityMap,
  TDynamic,
  TExcludedMethods,
  TResult,
  TSelectedFields,
  >,
  >

  #### Returns SQLiteSelectDynamic<
  SQLiteSelectBase<
  TTableName,
  TResultType,
  TRunResult,
  TSelection,
  TSelectMode,
  TNullabilityMap,
  TDynamic,
  TExcludedMethods,
  TResult,
  TSelectedFields,
  >,
  >

  Inherited from SQLiteSelectQueryBuilderBase.$dynamic

  - 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/query-builders/select.d.ts:448

### $withCache

- $withCache(
  config?:
  | false
  | { autoInvalidate?: boolean; config?: CacheConfig; tag?: string },
  ): this

  #### Parameters

  - `Optional` config: false | { autoInvalidate?: boolean; config?: CacheConfig; tag?: 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/query-builders/select.d.ts:454

### as

- as<TAlias extends string>(
  alias: TAlias,
  ): SubqueryWithSelection<TSelectedFields, TAlias>

  #### Type Parameters

  - TAlias extends string

  #### Parameters

  - alias: TAlias

  #### Returns SubqueryWithSelection<TSelectedFields, TAlias>

  Inherited from SQLiteSelectQueryBuilderBase.as

  - 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/query-builders/select.d.ts:447

### catch

- catch<TResult = never>(
  onRejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null,
  ): Promise<TResult | TResult>

  Attaches a callback for only the rejection of the Promise.

  #### Type Parameters

  - TResult = never

  #### Parameters

  - `Optional` onRejected: ((reason: any) => TResult | PromiseLike<TResult>) | null

  #### Returns Promise<TResult | TResult>

  A Promise for the completion of the callback.

  Inherited from QueryPromise.catch

  - 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/query-promise.d.ts:5

### execute

- execute(): Promise<TResult>

  #### Returns Promise<TResult>

  Inherited from QueryPromise.execute

  - 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/query-builders/select.d.ts:464

### finally

- finally(onFinally?: (() => void) | null): Promise<TResult>

  Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The resolved value cannot be modified from the callback.

  #### Parameters

  - `Optional` onFinally: (() => void) | null

  #### Returns Promise<TResult>

  A Promise for the completion of the callback.

  Inherited from QueryPromise.finally

  - 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/query-promise.d.ts:6

### `Abstract` getSQL

- getSQL(): SQL

  #### Returns SQL

  Inherited from SQLiteSelectQueryBuilderBase.getSQL

  - 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/query-builders/query-builder.d.ts:10

### groupBy

- groupBy(
  builder: (
  aliases: TSelection,
  ) => ValueOrArray<
  | SQL<unknown>
  | Aliased<unknown>
  | SQLiteColumn<ColumnBaseConfig<ColumnDataType, string>, {}, {}>,
  >,
  ): SQLiteSelectWithout<
  SQLiteSelectBase<
  TTableName,
  TResultType,
  TRunResult,
  TSelection,
  TSelectMode,
  TNullabilityMap,
  TDynamic,
  TExcludedMethods,
  TResult,
  TSelectedFields,
  >,
  TDynamic,
  "groupBy",
  >

  Adds a `group by` clause to the query.

  Calling this method will group rows that have the same values into summary rows, often used for aggregation purposes.

  See docs: https://orm.drizzle.team/docs/select#aggregations

  #### Parameters

  - builder: (
    aliases: TSelection,
    ) => ValueOrArray<
    | SQL<unknown>
    | Aliased<unknown>
    | SQLiteColumn<ColumnBaseConfig<ColumnDataType, string>, {}, {}>,
    >

  #### Returns SQLiteSelectWithout<
  SQLiteSelectBase<
  TTableName,
  TResultType,
  TRunResult,
  TSelection,
  TSelectMode,
  TNullabilityMap,
  TDynamic,
  TExcludedMethods,
  TResult,
  TSelectedFields,
  >,
  TDynamic,
  "groupBy",
  >

  #### Example

      // Group and count people by their last names
      await db.select({
         lastName: people.lastName,
         count: sql<number>`cast(count(*) as int)`
      })
        .from(people)
        .groupBy(people.lastName);

  Inherited from SQLiteSelectQueryBuilderBase.groupBy

  - 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/query-builders/select.d.ts:384
- groupBy(
  ...columns: (
  | SQL<unknown>
  | SQLiteColumn<ColumnBaseConfig<ColumnDataType, string>, {}, {}>
  )[],
  ): SQLiteSelectWithout<
  SQLiteSelectBase<
  TTableName,
  TResultType,
  TRunResult,
  TSelection,
  TSelectMode,
  TNullabilityMap,
  TDynamic,
  TExcludedMethods,
  TResult,
  TSelectedFields,
  >,
  TDynamic,
  "groupBy",
  >

  Adds a `group by` clause to the query.

  Calling this method will group rows that have the same values into summary rows, often used for aggregation purposes.

  See docs: https://orm.drizzle.team/docs/select#aggregations

  #### Parameters

  - ...columns: (SQL<unknown> | SQLiteColumn<ColumnBaseConfig<ColumnDataType, string>, {}, {}>)[]

  #### Returns SQLiteSelectWithout<
  SQLiteSelectBase<
  TTableName,
  TResultType,
  TRunResult,
  TSelection,
  TSelectMode,
  TNullabilityMap,
  TDynamic,
  TExcludedMethods,
  TResult,
  TSelectedFields,
  >,
  TDynamic,
  "groupBy",
  >

  #### Example

      // Group and count people by their last names
      await db.select({
         lastName: people.lastName,
         count: sql<number>`cast(count(*) as int)`
      })
        .from(people)
        .groupBy(people.lastName);

  Inherited from SQLiteSelectQueryBuilderBase.groupBy

  - 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/query-builders/select.d.ts:385

### having

- having(
  having:
  | SQL<unknown>
  | ((aliases: TSelection) => SQL<unknown> | undefined)
  | undefined,
  ): SQLiteSelectWithout<
  SQLiteSelectBase<
  TTableName,
  TResultType,
  TRunResult,
  TSelection,
  TSelectMode,
  TNullabilityMap,
  TDynamic,
  TExcludedMethods,
  TResult,
  TSelectedFields,
  >,
  TDynamic,
  "having",
  >

  Adds a `having` clause to the query.

  Calling this method will select only those rows that fulfill a specified condition. It is typically used with aggregate functions to filter the aggregated data based on a specified condition.

  See docs: https://orm.drizzle.team/docs/select#aggregations

  #### Parameters

  - having: SQL<unknown> | ((aliases: TSelection) => SQL<unknown> | undefined) | undefined

    the `having` clause.

  #### Returns SQLiteSelectWithout<
  SQLiteSelectBase<
  TTableName,
  TResultType,
  TRunResult,
  TSelection,
  TSelectMode,
  TNullabilityMap,
  TDynamic,
  TExcludedMethods,
  TResult,
  TSelectedFields,
  >,
  TDynamic,
  "having",
  >

  #### Example

      // Select all brands with more than one car
      await db.select({
      	brand: cars.brand,
      	count: sql<number>`cast(count(${cars.id}) as int)`,
      })
        .from(cars)
        .groupBy(cars.brand)
        .having(({ count }) => gt(count, 1));

  Inherited from SQLiteSelectQueryBuilderBase.having

  - 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/query-builders/select.d.ts:364

### limit

- limit(
  limit: number | Placeholder<string, any>,
  ): SQLiteSelectWithout<
  SQLiteSelectBase<
  TTableName,
  TResultType,
  TRunResult,
  TSelection,
  TSelectMode,
  TNullabilityMap,
  TDynamic,
  TExcludedMethods,
  TResult,
  TSelectedFields,
  >,
  TDynamic,
  "limit",
  >

  Adds a `limit` clause to the query.

  Calling this method will set the maximum number of rows that will be returned by this query.

  See docs: https://orm.drizzle.team/docs/select#limit--offset

  #### Parameters

  - limit: number | Placeholder<string, any>

    the `limit` clause.

  #### Returns SQLiteSelectWithout<
  SQLiteSelectBase<
  TTableName,
  TResultType,
  TRunResult,
  TSelection,
  TSelectMode,
  TNullabilityMap,
  TDynamic,
  TExcludedMethods,
  TResult,
  TSelectedFields,
  >,
  TDynamic,
  "limit",
  >

  #### Example

      // Get the first 10 people from this query.
      await db.select().from(people).limit(10);

  Inherited from SQLiteSelectQueryBuilderBase.limit

  - 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/query-builders/select.d.ts:428

### offset

- offset(
  offset: number | Placeholder<string, any>,
  ): SQLiteSelectWithout<
  SQLiteSelectBase<
  TTableName,
  TResultType,
  TRunResult,
  TSelection,
  TSelectMode,
  TNullabilityMap,
  TDynamic,
  TExcludedMethods,
  TResult,
  TSelectedFields,
  >,
  TDynamic,
  "offset",
  >

  Adds an `offset` clause to the query.

  Calling this method will skip a number of rows when returning results from this query.

  See docs: https://orm.drizzle.team/docs/select#limit--offset

  #### Parameters

  - offset: number | Placeholder<string, any>

    the `offset` clause.

  #### Returns SQLiteSelectWithout<
  SQLiteSelectBase<
  TTableName,
  TResultType,
  TRunResult,
  TSelection,
  TSelectMode,
  TNullabilityMap,
  TDynamic,
  TExcludedMethods,
  TResult,
  TSelectedFields,
  >,
  TDynamic,
  "offset",
  >

  #### Example

      // Get the 10th-20th people from this query.
      await db.select().from(people).offset(10).limit(10);

  Inherited from SQLiteSelectQueryBuilderBase.offset

  - 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/query-builders/select.d.ts:445

### orderBy

- orderBy(
  builder: (
  aliases: TSelection,
  ) => ValueOrArray<
  | SQL<unknown>
  | Aliased<unknown>
  | SQLiteColumn<ColumnBaseConfig<ColumnDataType, string>, {}, {}>,
  >,
  ): SQLiteSelectWithout<
  SQLiteSelectBase<
  TTableName,
  TResultType,
  TRunResult,
  TSelection,
  TSelectMode,
  TNullabilityMap,
  TDynamic,
  TExcludedMethods,
  TResult,
  TSelectedFields,
  >,
  TDynamic,
  "orderBy",
  >

  Adds an `order by` clause to the query.

  Calling this method will sort the result-set in ascending or descending order. By default, the sort order is ascending.

  See docs: https://orm.drizzle.team/docs/select#order-by

  #### Parameters

  - builder: (
    aliases: TSelection,
    ) => ValueOrArray<
    | SQL<unknown>
    | Aliased<unknown>
    | SQLiteColumn<ColumnBaseConfig<ColumnDataType, string>, {}, {}>,
    >

  #### Returns SQLiteSelectWithout<
  SQLiteSelectBase<
  TTableName,
  TResultType,
  TRunResult,
  TSelection,
  TSelectMode,
  TNullabilityMap,
  TDynamic,
  TExcludedMethods,
  TResult,
  TSelectedFields,
  >,
  TDynamic,
  "orderBy",
  >

  #### Example

      // Select cars ordered by year
      await db.select().from(cars).orderBy(cars.year);

  You can specify whether results are in ascending or descending order with the `asc()` and `desc()` operators.

      // Select cars ordered by year in descending order
      await db.select().from(cars).orderBy(desc(cars.year));

      // Select cars ordered by year and price
      await db.select().from(cars).orderBy(asc(cars.year), desc(cars.price));

  Inherited from SQLiteSelectQueryBuilderBase.orderBy

  - 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/query-builders/select.d.ts:410
- orderBy(
  ...columns: (
  | SQL<unknown>
  | SQLiteColumn<ColumnBaseConfig<ColumnDataType, string>, {}, {}>
  )[],
  ): SQLiteSelectWithout<
  SQLiteSelectBase<
  TTableName,
  TResultType,
  TRunResult,
  TSelection,
  TSelectMode,
  TNullabilityMap,
  TDynamic,
  TExcludedMethods,
  TResult,
  TSelectedFields,
  >,
  TDynamic,
  "orderBy",
  >

  Adds an `order by` clause to the query.

  Calling this method will sort the result-set in ascending or descending order. By default, the sort order is ascending.

  See docs: https://orm.drizzle.team/docs/select#order-by

  #### Parameters

  - ...columns: (SQL<unknown> | SQLiteColumn<ColumnBaseConfig<ColumnDataType, string>, {}, {}>)[]

  #### Returns SQLiteSelectWithout<
  SQLiteSelectBase<
  TTableName,
  TResultType,
  TRunResult,
  TSelection,
  TSelectMode,
  TNullabilityMap,
  TDynamic,
  TExcludedMethods,
  TResult,
  TSelectedFields,
  >,
  TDynamic,
  "orderBy",
  >

  #### Example

      // Select cars ordered by year
      await db.select().from(cars).orderBy(cars.year);

  You can specify whether results are in ascending or descending order with the `asc()` and `desc()` operators.

      // Select cars ordered by year in descending order
      await db.select().from(cars).orderBy(desc(cars.year));

      // Select cars ordered by year and price
      await db.select().from(cars).orderBy(asc(cars.year), desc(cars.price));

  Inherited from SQLiteSelectQueryBuilderBase.orderBy

  - 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/query-builders/select.d.ts:411

### prepare

- prepare(): SQLiteSelectPrepare<
  SQLiteSelectBase<
  TTableName,
  TResultType,
  TRunResult,
  TSelection,
  TSelectMode,
  TNullabilityMap,
  TDynamic,
  TExcludedMethods,
  TResult,
  TSelectedFields,
  >,
  >

  #### Returns SQLiteSelectPrepare<
  SQLiteSelectBase<
  TTableName,
  TResultType,
  TRunResult,
  TSelection,
  TSelectMode,
  TNullabilityMap,
  TDynamic,
  TExcludedMethods,
  TResult,
  TSelectedFields,
  >,
  >

  - 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/query-builders/select.d.ts:459

### then

- then<TResult1 = TResult, TResult2 = never>(
  onFulfilled?:
  | ((value: TResult) => TResult1 | PromiseLike<TResult1>)
  | null,
  onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null,
  ): Promise<TResult1 | TResult2>

  Attaches callbacks for the resolution and/or rejection of the Promise.

  #### Type Parameters

  - TResult1 = TResult
  - TResult2 = never

  #### Parameters

  - `Optional` onFulfilled: ((value: TResult) => TResult1 | PromiseLike<TResult1>) | null
  - `Optional` onRejected: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null

  #### Returns Promise<TResult1 | TResult2>

  A Promise for the completion of which ever callback is executed.

  Inherited from QueryPromise.then

  - 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/query-promise.d.ts:7

### toSQL

- toSQL(): Query

  #### Returns Query

  Inherited from SQLiteSelectQueryBuilderBase.toSQL

  - 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/query-builders/select.d.ts:446

### where

- where(
  where:
  | SQL<unknown>
  | ((aliases: TSelection) => SQL<unknown> | undefined)
  | undefined,
  ): SQLiteSelectWithout<
  SQLiteSelectBase<
  TTableName,
  TResultType,
  TRunResult,
  TSelection,
  TSelectMode,
  TNullabilityMap,
  TDynamic,
  TExcludedMethods,
  TResult,
  TSelectedFields,
  >,
  TDynamic,
  "where",
  >

  Adds a `where` clause to the query.

  Calling this method will select only those rows that fulfill a specified condition.

  See docs: https://orm.drizzle.team/docs/select#filtering

  #### Parameters

  - where: SQL<unknown> | ((aliases: TSelection) => SQL<unknown> | undefined) | undefined

    the `where` clause.

  #### Returns SQLiteSelectWithout<
  SQLiteSelectBase<
  TTableName,
  TResultType,
  TRunResult,
  TSelection,
  TSelectMode,
  TNullabilityMap,
  TDynamic,
  TExcludedMethods,
  TResult,
  TSelectedFields,
  >,
  TDynamic,
  "where",
  >

  #### Example

  You can use conditional operators and `sql function` to filter the rows to be selected.

      // Select all cars with green color
      await db.select().from(cars).where(eq(cars.color, 'green'));
      // or
      await db.select().from(cars).where(sql`${cars.color} = 'green'`)

  You can logically combine conditional operators with `and()` and `or()` operators:

      // Select all BMW cars with a green color
      await db.select().from(cars).where(and(eq(cars.color, 'green'), eq(cars.brand, 'BMW')));

      // Select all cars with the green or blue color
      await db.select().from(cars).where(or(eq(cars.color, 'green'), eq(cars.color, 'blue')));

  Inherited from SQLiteSelectQueryBuilderBase.where

  - 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/query-builders/select.d.ts:341