32 lines
654 B
TypeScript
32 lines
654 B
TypeScript
interface SystemDef {
|
|
storage: StorageDef;
|
|
}
|
|
interface StorageDef {
|
|
tables: TableDef[];
|
|
relations: ManyToManyDef[];
|
|
}
|
|
interface TableDef {
|
|
name: string;
|
|
columns: ColumnDef[];
|
|
relations: BelongsToDef[];
|
|
}
|
|
interface ColumnDef {
|
|
name: string;
|
|
type: "blob" | "boolean" | "date" | "dateTIME" | "number" | "string";
|
|
nullable: boolean;
|
|
unique?: boolean;
|
|
autoIncrement?: boolean;
|
|
default?: string;
|
|
}
|
|
interface BelongsToDef {
|
|
type: 'belongs-to';
|
|
table: string;
|
|
}
|
|
interface ManyToManyDef {
|
|
left: string;
|
|
relation: 'many-to-many';
|
|
right: string;
|
|
columns?: ColumnDef[];
|
|
}
|
|
export { SystemDef };
|