import { SQLiteViewBase } from "../view-base.cjs";
import { SQLiteEffectPreparedQuery, SQLiteEffectSession } from "./session.cjs";
import { entityKind } from "../../entity.cjs";
import { SQL, SQLWrapper } from "../../sql/sql.cjs";
import { Subquery } from "../../subquery.cjs";
import { Assume, DrizzleTypeError } from "../../utils.cjs";
import { RunnableQuery } from "../../runnable-query.cjs";
import { SQLiteTable } from "../table.cjs";
import { PreparedQueryConfig } from "../session.cjs";
import { SQLiteUpdateBase, SQLiteUpdateBuilder, SQLiteUpdateHKTBase } from "../query-builders/update.cjs";
import { QueryEffectHKTBase, QueryEffectKind } from "../../effect-core/query-effect.cjs";

//#region src/sqlite-core/effect/update.d.ts
interface SQLiteEffectUpdateHKT<TEffectHKT extends QueryEffectHKTBase = QueryEffectHKTBase> extends SQLiteUpdateHKTBase {
  _type: SQLiteEffectUpdateBase<Assume<this['table'], SQLiteTable>, this['runResult'], Assume<this['from'], SQLiteTable | Subquery | SQLiteViewBase | SQL | undefined>, this['returning'], this['dynamic'], this['excludedMethods'], TEffectHKT>;
}
type AnySQLiteEffectUpdate = SQLiteEffectUpdateBase<any, any, any, any, any, any, any>;
type SQLiteEffectUpdate<TTable extends SQLiteTable = SQLiteTable, TRunResult = any, TFrom extends SQLiteTable | Subquery | SQLiteViewBase | SQL | undefined = undefined, TReturning extends Record<string, unknown> | undefined = Record<string, unknown> | undefined, TEffectHKT extends QueryEffectHKTBase = QueryEffectHKTBase> = SQLiteEffectUpdateBase<TTable, TRunResult, TFrom, TReturning, true, never, TEffectHKT>;
type SQLiteEffectUpdateBuilder<TTable extends SQLiteTable, TRunResult, TEffectHKT extends QueryEffectHKTBase = QueryEffectHKTBase> = SQLiteUpdateBuilder<TTable, TRunResult, SQLiteEffectUpdateHKT<TEffectHKT>>;
type SQLiteEffectUpdateExecute<T extends AnySQLiteEffectUpdate> = T['_']['returning'] extends undefined ? T['_']['runResult'] : T['_']['returning'][];
type SQLiteEffectUpdatePrepare<T extends AnySQLiteEffectUpdate, TEffectHKT extends QueryEffectHKTBase = QueryEffectHKTBase> = SQLiteEffectPreparedQuery<PreparedQueryConfig & {
  run: T['_']['runResult'];
  all: T['_']['returning'] extends undefined ? DrizzleTypeError<'.all() cannot be used without .returning()'> : T['_']['returning'][];
  get: T['_']['returning'] extends undefined ? DrizzleTypeError<'.get() cannot be used without .returning()'> : T['_']['returning'];
  values: T['_']['returning'] extends undefined ? DrizzleTypeError<'.values() cannot be used without .returning()'> : any[][];
  execute: SQLiteEffectUpdateExecute<T>;
}, TEffectHKT>;
interface SQLiteEffectUpdateBase<TTable extends SQLiteTable = SQLiteTable, TRunResult = unknown, TFrom extends SQLiteTable | Subquery | SQLiteViewBase | SQL | undefined = undefined, TReturning = undefined, TDynamic extends boolean = false, TExcludedMethods extends string = never, TEffectHKT extends QueryEffectHKTBase = QueryEffectHKTBase> extends QueryEffectKind<TEffectHKT, TReturning extends undefined ? TRunResult : TReturning[]> {}
declare class SQLiteEffectUpdateBase<TTable extends SQLiteTable = SQLiteTable, TRunResult = unknown, TFrom extends SQLiteTable | Subquery | SQLiteViewBase | SQL | undefined = undefined, TReturning = undefined, TDynamic extends boolean = false, TExcludedMethods extends string = never, TEffectHKT extends QueryEffectHKTBase = QueryEffectHKTBase> extends SQLiteUpdateBase<SQLiteEffectUpdateHKT<TEffectHKT>, TTable, TRunResult, TFrom, TReturning, TDynamic, TExcludedMethods> implements RunnableQuery<TReturning extends undefined ? TRunResult : TReturning[], 'sqlite'>, SQLWrapper {
  static readonly [entityKind]: string;
  protected session: SQLiteEffectSession<TRunResult, TEffectHKT, any>;
  prepare(): SQLiteEffectUpdatePrepare<this, TEffectHKT>;
  run: ReturnType<this['prepare']>['run'];
  all: ReturnType<this['prepare']>['all'];
  get: ReturnType<this['prepare']>['get'];
  values: ReturnType<this['prepare']>['values'];
  execute: ReturnType<this['prepare']>['execute'];
}
//#endregion
export { AnySQLiteEffectUpdate, SQLiteEffectUpdate, SQLiteEffectUpdateBase, SQLiteEffectUpdateBuilder, SQLiteEffectUpdateExecute, SQLiteEffectUpdateHKT, SQLiteEffectUpdatePrepare };
//# sourceMappingURL=update.d.cts.map