sql-ddl-to-json-schema
Version:
Parse and convert SQL DDL statements to a JSON Schema.
45 lines (44 loc) • 1.32 kB
TypeScript
import { O_COLUMN_DEFINITION, ColumnOptionsInterface } from '../../../../typings';
import { ColumnOptionsModelInterface } from './typings';
/**
* Options of a table column.
*/
export declare class ColumnOptions implements ColumnOptionsModelInterface {
unsigned?: boolean;
zerofill?: boolean;
charset?: string;
collation?: string;
nullable?: boolean;
default?: string | number | boolean;
autoincrement?: boolean;
unique?: boolean;
primary?: boolean;
comment?: string;
invisibleWithSystemVersioning?: boolean;
invisibleWithoutSystemVersioning?: boolean;
invisible?: boolean;
format?: string;
storage?: string;
onUpdate?: string;
/**
* Creates column options instance from an array of definitions.
*
* @param json JSON format parsed from SQL.
*/
static fromArray(json: O_COLUMN_DEFINITION[]): ColumnOptions;
/**
* JSON casting of this object calls this method.
*/
toJSON(): ColumnOptionsInterface;
/**
* Merge this option instance with another one.
* Common properties of this instance are overwritten.
*
* @param options JSON format parsed from SQL.
*/
mergeWith(options: ColumnOptions): void;
/**
* Create a deep clone of this model.
*/
clone(): ColumnOptions;
}