/** * Type definitions for CRUD methods with full type safety. * * All methods return RunnableEffect (Effect with .runPromise convenience) * instead of the legacy Promise>. */ import type { DuplicateKeyError, ForeignKeyError, NotFoundError, OperationError, ValidationError } from "../errors/crud-errors.js"; import type { CreateInput, CreateManyOptions, CreateManyResult, DeleteManyResult, MinimalEntity, UpdateManyResult, UpdateWithOperators, UpsertInput, UpsertManyResult, UpsertResult } from "../types/crud-types.js"; import type { RunnableEffect } from "./database-effect.js"; export interface CrudMethods { readonly create: (input: CreateInput) => RunnableEffect; readonly createMany: (inputs: ReadonlyArray>, options?: CreateManyOptions) => RunnableEffect, ValidationError | DuplicateKeyError | ForeignKeyError>; readonly update: (id: string, updates: UpdateWithOperators) => RunnableEffect; readonly updateMany: (predicate: (entity: T) => boolean, updates: UpdateWithOperators) => RunnableEffect, ValidationError | ForeignKeyError>; readonly delete: (id: string, options?: { readonly soft?: boolean; }) => RunnableEffect; readonly deleteMany: (predicate: (entity: T) => boolean, options?: { readonly soft?: boolean; readonly limit?: number; }) => RunnableEffect, OperationError | ForeignKeyError>; readonly upsert: (input: UpsertInput) => RunnableEffect, ValidationError | ForeignKeyError>; readonly upsertMany: (inputs: ReadonlyArray>) => RunnableEffect, ValidationError | ForeignKeyError>; } //# sourceMappingURL=crud-factory.d.ts.map