import type { Accountability, Query, SchemaOverview } from '@db-studio/types'; import type { Knex } from 'knex'; import type { Item, PrimaryKey } from './items.js'; export type AbstractServiceOptions = { knex?: Knex; accountability?: Accountability | null | undefined; schema: SchemaOverview; }; export interface AbstractService { knex: Knex; accountability: Accountability | null | undefined; createOne(data: Partial): Promise; createMany(data: Partial[]): Promise; readOne(key: PrimaryKey, query?: Query): Promise; readMany(keys: PrimaryKey[], query?: Query): Promise; readByQuery(query: Query): Promise; updateOne(key: PrimaryKey, data: Partial): Promise; updateMany(keys: PrimaryKey[], data: Partial): Promise; deleteOne(key: PrimaryKey): Promise; deleteMany(keys: PrimaryKey[]): Promise; }