sql-ddl-to-json-schema
Version:
Parse and convert SQL DDL statements to a JSON Schema.
25 lines (24 loc) • 690 B
TypeScript
import { JSONSchema7 } from 'json-schema';
import { ColumnInterface as CompactFormatColumnInterface } from '../../../../typings';
import { Datatype } from './datatype';
/**
* Table column.
*/
export declare class Column {
name: string;
datatype: Datatype;
isNullable?: boolean;
isPrimaryKey?: boolean;
comment?: string;
default?: boolean | string | number | null;
/**
* Create Column instance from compact JSON format.
*
* @param json Column in compact JSON format.
*/
static fromCompactJson(json: CompactFormatColumnInterface): Column;
/**
* JSON casting of this object calls this method.
*/
toJSON(): JSONSchema7;
}