import { entityKind } from "../../entity.js"; import { QueryPromise } from "../../query-promise.js"; import type { SingleStoreDialect } from "../dialect.js"; import type { AnySingleStoreQueryResultHKT, PreparedQueryHKTBase, PreparedQueryKind, SingleStorePreparedQueryConfig, SingleStoreQueryResultHKT, SingleStoreQueryResultKind, SingleStoreSession } from "../session.js"; import type { SingleStoreTable } from "../table.js"; import type { Placeholder, Query, SQL, SQLWrapper } from "../../sql/sql.js"; import type { Subquery } from "../../subquery.js"; import type { ValueOrArray } from "../../utils.js"; import type { SingleStoreColumn } from "../columns/common.js"; import type { SelectedFieldsOrdered } from "./select.types.js"; export type SingleStoreDeleteWithout = TDynamic extends true ? T : Omit, T['_']['excludedMethods'] | K>; export type SingleStoreDelete = SingleStoreDeleteBase; export interface SingleStoreDeleteConfig { where?: SQL | undefined; limit?: number | Placeholder; orderBy?: (SingleStoreColumn | SQL | SQL.Aliased)[]; table: SingleStoreTable; returning?: SelectedFieldsOrdered; withList?: Subquery[]; } export type SingleStoreDeletePrepare = PreparedQueryKind; iterator: never; }, true>; type SingleStoreDeleteDynamic = SingleStoreDelete; type AnySingleStoreDeleteBase = SingleStoreDeleteBase; export interface SingleStoreDeleteBase extends QueryPromise> { readonly _: { readonly table: TTable; readonly queryResult: TQueryResult; readonly preparedQueryHKT: TPreparedQueryHKT; readonly dynamic: TDynamic; readonly excludedMethods: TExcludedMethods; }; } export declare class SingleStoreDeleteBase extends QueryPromise> implements SQLWrapper { private table; private session; private dialect; static readonly [entityKind]: string; private config; constructor(table: TTable, session: SingleStoreSession, dialect: SingleStoreDialect, withList?: Subquery[]); /** * Adds a `where` clause to the query. * * Calling this method will delete only those rows that fulfill a specified condition. * * See docs: {@link https://orm.drizzle.team/docs/delete} * * @param where the `where` clause. * * @example * You can use conditional operators and `sql function` to filter the rows to be deleted. * * ```ts * // 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: * * ```ts * // 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'))); * ``` */ where(where: SQL | undefined): SingleStoreDeleteWithout; orderBy(builder: (deleteTable: TTable) => ValueOrArray): SingleStoreDeleteWithout; orderBy(...columns: (SingleStoreColumn | SQL | SQL.Aliased)[]): SingleStoreDeleteWithout; limit(limit: number | Placeholder): SingleStoreDeleteWithout; toSQL(): Query; prepare(): SingleStoreDeletePrepare; execute: ReturnType['execute']; private createIterator; iterator: ReturnType["iterator"]; $dynamic(): SingleStoreDeleteDynamic; } export {};