dbgate/types/dbinfo.d.ts

52 lines
1.1 KiB
TypeScript
Raw Normal View History

export interface NamedObjectInfo {
2020-02-02 15:43:41 +00:00
pureName: string;
schemaName: string;
}
2020-02-02 15:43:41 +00:00
export interface ColumnReference {
columnName: string;
refColumnName?: string;
}
2020-02-02 16:27:33 +00:00
export interface ConstraintInfo extends NamedObjectInfo {
2020-02-02 15:43:41 +00:00
constraintName: string;
constraintType: string;
}
export interface ColumnsConstraintInfo extends ConstraintInfo {
columns: ConstraintInfo[];
}
export interface PrimaryKeyInfo extends ColumnsConstraintInfo {}
export interface ForeignKeyInfo extends ColumnsConstraintInfo {
refSchemaName: string;
refTableName: string;
updateAction: string;
deleteAction: string;
}
export interface ColumnInfo {
2020-02-02 15:43:41 +00:00
columnName: string;
notNull: boolean;
autoIncrement: boolean;
dataType: string;
precision: number;
scale: number;
length: number;
computedExpression: string;
isPersisted: boolean;
isSparse: boolean;
defaultValue: string;
defaultConstraint: string;
}
export interface TableInfo extends NamedObjectInfo {
2020-02-02 15:43:41 +00:00
columns: ColumnInfo[];
primaryKey?: PrimaryKeyInfo;
foreignKeys: ForeignKeyInfo[];
2020-02-02 16:27:33 +00:00
dependencies?: ForeignKeyInfo[];
}
export interface DatabaseInfo {
2020-02-02 15:43:41 +00:00
tables: TableInfo[];
}