pure-orm
Version:
A SQL Toolkit based on pure business objects passed to and from stateful data access objects
28 lines (21 loc) • 510 B
text/typescript
import { IModel, ICollection, IColumns } from '../../../src/index';
export const tableName: string = 'person';
export const columns: IColumns = ['id'];
export class Person implements IModel {
id: number;
constructor(props: any) {
this.id = props.id;
}
}
export class Persons implements ICollection<Person> {
models: Array<Person>;
constructor({ models }: any) {
this.models = models;
}
}
export const personEntity = {
tableName,
columns,
Model: Person,
Collection: Persons
};