UNPKG

sedk-postgres

Version:

Simple SQL builder and validator

24 lines (23 loc) 648 B
import { Column } from './Column'; import { Schema } from './Schema'; import { Table } from './Table'; type SchemasObj = { [schemaName: string]: Schema; }; type DatabaseObj<S extends SchemasObj> = { version?: number; schemas: S; }; export declare class Database<S extends SchemasObj = SchemasObj> { private readonly data; private readonly mSchemas; private readonly schemaArray; constructor(data: DatabaseObj<S>); get schemas(): S; /** Alias to get schemas() */ get s(): S; isSchemaExist(schema: Schema): boolean; hasTable(table: Table): boolean; hasColumn(column: Column): boolean; } export {};