# Class SQLiteDeleteBase<TTable, TResultType, TRunResult, TReturning, TDynamic, TExcludedMethods>

#### Type Parameters

- TTable extends SQLiteTable
- TResultType extends "sync" | "async"
- TRunResult
- TReturning extends Record<string, unknown> | undefined = undefined
- TDynamic extends boolean = false
- TExcludedMethods extends string = never

#### Hierarchy

- QueryPromise<TReturning extends undefined ? TRunResult : TReturning[]>
- RunnableQuery<
  TReturning extends undefined ? TRunResult : TReturning[],
  "sqlite",
  >
- SQLWrapper
  - SQLiteDeleteBase

#### Implements

- RunnableQuery<
  TReturning extends undefined ? TRunResult : TReturning[],
  "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/delete.d.ts:36
- 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/delete.d.ts:48

##### Index

### Constructors

constructor

### Properties

_
[toStringTag]
all
get
run
values
[entityKind]

### Methods

$dynamic
catch
execute
finally
getSQL
limit
orderBy
prepare
returning
shouldOmitSQLParens?
then
toSQL
where

## Constructors

### constructor

- new SQLiteDeleteBase<
  TTable extends SQLiteTable<TableConfig>,
  TResultType extends "sync" | "async",
  TRunResult,
  TReturning extends Record<string, unknown> | undefined = undefined,
  TDynamic extends boolean = false,
  TExcludedMethods extends string = never,
  >(
  table: TTable,
  session: SQLiteSession<any, any, any, any>,
  dialect: SQLiteDialect,
  withList?: Subquery<string, Record<string, unknown>>[],
  ): SQLiteDeleteBase<
  TTable,
  TResultType,
  TRunResult,
  TReturning,
  TDynamic,
  TExcludedMethods,
  >

  #### Type Parameters

  - TTable extends SQLiteTable<TableConfig>
  - TResultType extends "sync" | "async"
  - TRunResult
  - TReturning extends Record<string, unknown> | undefined = undefined
  - TDynamic extends boolean = false
  - TExcludedMethods extends string = never

  #### Parameters

  - table: TTable
  - session: SQLiteSession<any, any, any, any>
  - dialect: SQLiteDialect
  - `Optional` withList: Subquery<string, Record<string, unknown>>[]

  #### Returns SQLiteDeleteBase<
  TTable,
  TResultType,
  TRunResult,
  TReturning,
  TDynamic,
  TExcludedMethods,
  >

  Inherited from QueryPromise<TReturning extends undefined ? TRunResult : TReturning[]>.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/delete.d.ts:53

## Properties

### `Readonly`_

_: {
dialect: "sqlite";
dynamic: TDynamic;
excludedMethods: TExcludedMethods;
result: TReturning extends undefined ? TRunResult : TReturning[];
resultType: TResultType;
returning: TReturning;
runResult: TRunResult;
table: TTable;
}

Overrides RunnableQuery._

- 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/delete.d.ts:37

### [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,
TReturning extends undefined
? DrizzleTypeError<".all() cannot be used without .returning()">
: TReturning[],
>

- 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/delete.d.ts:112

### get

get: (
placeholderValues?: Record<string, unknown>,
) => Result<
TResultType,
TReturning extends undefined
? DrizzleTypeError<".get() cannot be used without .returning()">
: TReturning | 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/delete.d.ts:113

### 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/delete.d.ts:111

### values

values: (
placeholderValues?: Record<string, unknown>,
) => Result<
TResultType,
TReturning extends undefined
? DrizzleTypeError<".values() cannot be used without .returning()">
: 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/delete.d.ts:114

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

"[entityKind]": string

- 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/delete.d.ts:52

## Methods

### $dynamic

- $dynamic(): SQLiteDeleteDynamic<
  SQLiteDeleteBase<
  TTable,
  TResultType,
  TRunResult,
  TReturning,
  TDynamic,
  TExcludedMethods,
  >,
  >

  #### Returns SQLiteDeleteDynamic<
  SQLiteDeleteBase<
  TTable,
  TResultType,
  TRunResult,
  TReturning,
  TDynamic,
  TExcludedMethods,
  >,
  >

  - 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/delete.d.ts:116

### catch

- catch<TResult = never>(
  onRejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null,
  ): Promise<
  (TReturning extends undefined ? TRunResult : TReturning[])
  | 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<(TReturning extends undefined ? TRunResult : TReturning[]) | 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(
  placeholderValues?: Record<string, unknown>,
  ): Promise<
  SQLiteDeleteExecute<
  SQLiteDeleteBase<
  TTable,
  TResultType,
  TRunResult,
  TReturning,
  TDynamic,
  TExcludedMethods,
  >,
  >,
  >

  #### Parameters

  - `Optional` placeholderValues: Record<string, unknown>

  #### Returns Promise<
  SQLiteDeleteExecute<
  SQLiteDeleteBase<
  TTable,
  TResultType,
  TRunResult,
  TReturning,
  TDynamic,
  TExcludedMethods,
  >,
  >,
  >

  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/delete.d.ts:115

### finally

- finally(
  onFinally?: (() => void) | null,
  ): Promise<TReturning extends undefined ? TRunResult : TReturning[]>

  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<TReturning extends undefined ? TRunResult : TReturning[]>

  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

### getSQL

- getSQL(): SQL

  #### Returns SQL

  Inherited from SQLWrapper.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/sql/sql.d.ts:50

### limit

- limit(
  limit: number | Placeholder<string, any>,
  ): SQLiteDeleteWithout<
  SQLiteDeleteBase<
  TTable,
  TResultType,
  TRunResult,
  TReturning,
  TDynamic,
  TExcludedMethods,
  >,
  TDynamic,
  "limit",
  >

  #### Parameters

  - limit: number | Placeholder<string, any>

  #### Returns SQLiteDeleteWithout<
  SQLiteDeleteBase<
  TTable,
  TResultType,
  TRunResult,
  TReturning,
  TDynamic,
  TExcludedMethods,
  >,
  TDynamic,
  "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/delete.d.ts:86

### orderBy

- orderBy(
  builder: (
  deleteTable: TTable,
  ) => ValueOrArray<
  | SQL<unknown>
  | Aliased<unknown>
  | SQLiteColumn<ColumnBaseConfig<ColumnDataType, string>, {}, {}>,
  >,
  ): SQLiteDeleteWithout<
  SQLiteDeleteBase<
  TTable,
  TResultType,
  TRunResult,
  TReturning,
  TDynamic,
  TExcludedMethods,
  >,
  TDynamic,
  "orderBy",
  >

  #### Parameters

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

  #### Returns SQLiteDeleteWithout<
  SQLiteDeleteBase<
  TTable,
  TResultType,
  TRunResult,
  TReturning,
  TDynamic,
  TExcludedMethods,
  >,
  TDynamic,
  "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/delete.d.ts:84
- orderBy(
  ...columns: (
  | SQL<unknown>
  | Aliased<unknown>
  | SQLiteColumn<ColumnBaseConfig<ColumnDataType, string>, {}, {}>
  )[],
  ): SQLiteDeleteWithout<
  SQLiteDeleteBase<
  TTable,
  TResultType,
  TRunResult,
  TReturning,
  TDynamic,
  TExcludedMethods,
  >,
  TDynamic,
  "orderBy",
  >

  #### Parameters

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

  #### Returns SQLiteDeleteWithout<
  SQLiteDeleteBase<
  TTable,
  TResultType,
  TRunResult,
  TReturning,
  TDynamic,
  TExcludedMethods,
  >,
  TDynamic,
  "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/delete.d.ts:85

### prepare

- prepare(): SQLiteDeletePrepare<
  SQLiteDeleteBase<
  TTable,
  TResultType,
  TRunResult,
  TReturning,
  TDynamic,
  TExcludedMethods,
  >,
  >

  #### Returns SQLiteDeletePrepare<
  SQLiteDeleteBase<
  TTable,
  TResultType,
  TRunResult,
  TReturning,
  TDynamic,
  TExcludedMethods,
  >,
  >

  - 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/delete.d.ts:110

### returning

- returning(): SQLiteDeleteWithout<
  SQLiteDeleteBase<
  TTable,
  TResultType,
  TRunResult,
  TTable["$inferSelect"],
  TDynamic,
  TExcludedMethods,
  >,
  TDynamic,
  >

  Adds a `returning` clause to the query.

  Calling this method will return the specified fields of the deleted rows. If no fields are specified, all fields will be returned.

  See docs: https://orm.drizzle.team/docs/delete#delete-with-return

  #### Returns SQLiteDeleteWithout<
  SQLiteDeleteBase<
  TTable,
  TResultType,
  TRunResult,
  TTable["$inferSelect"],
  TDynamic,
  TExcludedMethods,
  >,
  TDynamic,
  >

  #### Example

      // Delete all cars with the green color and return all fields
      const deletedCars: Car[] = await db.delete(cars)
        .where(eq(cars.color, 'green'))
        .returning();

      // Delete all cars with the green color and return only their id and brand fields
      const deletedCarsIdsAndBrands: { id: number, brand: string }[] = await db.delete(cars)
        .where(eq(cars.color, 'green'))
        .returning({ id: cars.id, brand: cars.brand });

  - 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/delete.d.ts:107
- returning<TSelectedFields extends SelectedFieldsFlat>(
  fields: TSelectedFields,
  ): SQLiteDeleteWithout<
  SQLiteDeleteBase<
  TTable,
  TResultType,
  TRunResult,
  {
  [K in string
  | number
  | symbol]: {
  [Key in string | number | symbol]: SelectResultField<
  TSelectedFields[Key],
  true,
  >
  }[K]
  },
  TDynamic,
  TExcludedMethods,
  >,
  TDynamic,
  "returning",
  >

  Adds a `returning` clause to the query.

  Calling this method will return the specified fields of the deleted rows. If no fields are specified, all fields will be returned.

  See docs: https://orm.drizzle.team/docs/delete#delete-with-return

  #### Type Parameters

  - TSelectedFields extends SelectedFieldsFlat

  #### Parameters

  - fields: TSelectedFields

  #### Returns SQLiteDeleteWithout<
  SQLiteDeleteBase<
  TTable,
  TResultType,
  TRunResult,
  {
  [K in string
  | number
  | symbol]: {
  [Key in string | number | symbol]: SelectResultField<
  TSelectedFields[Key],
  true,
  >
  }[K]
  },
  TDynamic,
  TExcludedMethods,
  >,
  TDynamic,
  "returning",
  >

  #### Example

      // Delete all cars with the green color and return all fields
      const deletedCars: Car[] = await db.delete(cars)
        .where(eq(cars.color, 'green'))
        .returning();

      // Delete all cars with the green color and return only their id and brand fields
      const deletedCarsIdsAndBrands: { id: number, brand: string }[] = await db.delete(cars)
        .where(eq(cars.color, 'green'))
        .returning({ id: cars.id, brand: cars.brand });

  - 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/delete.d.ts:108

### `Optional` shouldOmitSQLParens

- shouldOmitSQLParens?(): boolean

  #### Returns boolean

  Inherited from SQLWrapper.shouldOmitSQLParens

  - 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/sql/sql.d.ts:51

### then

- then<
  TResult1 = TReturning extends undefined ? TRunResult : TReturning[],
  TResult2 = never,
  >(
  onFulfilled?:
  | (
  (
  value: TReturning extends undefined ? TRunResult : TReturning[],
  ) => 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 = TReturning extends undefined ? TRunResult : TReturning[]
  - TResult2 = never

  #### Parameters

  - `Optional` onFulfilled:
    | (
    (
    value: TReturning extends undefined ? TRunResult : TReturning[],
    ) => 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

  - 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/delete.d.ts:109

### where

- where(
  where: SQL<unknown> | undefined,
  ): SQLiteDeleteWithout<
  SQLiteDeleteBase<
  TTable,
  TResultType,
  TRunResult,
  TReturning,
  TDynamic,
  TExcludedMethods,
  >,
  TDynamic,
  "where",
  >

  Adds a `where` clause to the query.

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

  See docs: https://orm.drizzle.team/docs/delete

  #### Parameters

  - where: SQL<unknown> | undefined

    the `where` clause.

  #### Returns SQLiteDeleteWithout<
  SQLiteDeleteBase<
  TTable,
  TResultType,
  TRunResult,
  TReturning,
  TDynamic,
  TExcludedMethods,
  >,
  TDynamic,
  "where",
  >

  #### Example

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

      // Delete all cars with green color
      db.delete(cars).where(eq(cars.color, 'green'));
      // or
      db.delete(cars).where(sql`${cars.color} = 'green'`)

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

      // Delete all BMW cars with a green color
      db.delete(cars).where(and(eq(cars.color, 'green'), eq(cars.brand, 'BMW')));

      // Delete all cars with the green or blue color
      db.delete(cars).where(or(eq(cars.color, 'green'), eq(cars.color, 'blue')));

  - 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/delete.d.ts:83