sql-ddl-to-json-schema
Version:
Parse and convert SQL DDL statements to a JSON Schema.
44 lines (43 loc) • 1.01 kB
TypeScript
import { TableInterface } from '../../../../typings';
import { Table } from './table';
/**
* Database, which contains array of tables in compact format.
*/
export declare class Database {
/**
* Tables array in compact JSON format.
*/
compactJsonTables: TableInterface[];
/**
* Table models after parsed.
*/
tables: Table[];
/**
* Getter for tables.
*/
getTables(): Table[];
/**
* Setter for tables.
*
* @param tables Table models.
*/
setTables(tables: Table[]): void;
/**
* Get table with given name.
*
* @param name Table name.
*/
getTable(name: string): Table | undefined;
/**
* Pushes a table to database.
*
* @param table Table to be added.
*/
pushTable(table: Table): void;
/**
* Build JSON Schema from compact JSON format.
*
* @param tables Tables array in compact JSON format.
*/
parseCompactJson(tables: TableInterface[]): void;
}