@shadow-dev/orm
Version:
Lightweight dynamic MySQL ORM designed for ShadowCore and modular apps.
16 lines (15 loc) • 580 B
TypeScript
import { Model } from "./Model";
export declare class Repository<T extends object> {
readonly model: Model<T>;
constructor(model: Model<T>);
create(data: T): Promise<T>;
find(where?: Partial<T>): Promise<T[]>;
findOne(where: Partial<T>): Promise<T | null>;
update(where: Partial<T>, data: Partial<T>): Promise<T | null>;
delete(where: Partial<T>): Promise<void>;
count(where?: Partial<T>): Promise<number>;
exists(where: Partial<T>): Promise<boolean>;
private normalizeValue;
private buildWhereClause;
private getPrimaryKeyField;
}