mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-22 14:36:01 +00:00
pk, fk analyse, show in structure tab
This commit is contained in:
58
types/dbinfo.d.ts
vendored
58
types/dbinfo.d.ts
vendored
@@ -1,24 +1,50 @@
|
||||
export interface NamedObjectInfo {
|
||||
pureName: string;
|
||||
schemaName: string;
|
||||
pureName: string;
|
||||
schemaName: string;
|
||||
}
|
||||
|
||||
export interface ColumnReference {
|
||||
columnName: string;
|
||||
refColumnName?: string;
|
||||
}
|
||||
|
||||
export interface ConstraintInfo {
|
||||
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 {
|
||||
columnName: string;
|
||||
notNull: boolean;
|
||||
autoIncrement: boolean;
|
||||
dataType: string;
|
||||
precision: number;
|
||||
scale: number;
|
||||
length: number;
|
||||
computedExpression: string;
|
||||
isPersisted: boolean;
|
||||
isSparse: boolean;
|
||||
defaultValue: string;
|
||||
defaultConstraint: string;
|
||||
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 {
|
||||
columns: ColumnInfo[];
|
||||
columns: ColumnInfo[];
|
||||
primaryKey?: PrimaryKeyInfo;
|
||||
foreignKeys: ForeignKeyInfo[];
|
||||
}
|
||||
export interface DatabaseInfo {
|
||||
tables: TableInfo[];
|
||||
tables: TableInfo[];
|
||||
}
|
||||
|
||||
35
types/engines.d.ts
vendored
35
types/engines.d.ts
vendored
@@ -1,16 +1,25 @@
|
||||
import { QueryResult } from "./query";
|
||||
export interface EngineDriver {
|
||||
connect({ server, port, user, password }: {
|
||||
server: any;
|
||||
port: any;
|
||||
user: any;
|
||||
password: any;
|
||||
}): any;
|
||||
query(pool: any, sql: string): Promise<QueryResult>;
|
||||
getVersion(pool: any): Promise<string>;
|
||||
listDatabases(pool: any): Promise<{
|
||||
name: string;
|
||||
}[]>;
|
||||
analyseFull(pool: any): Promise<void>;
|
||||
analyseIncremental(pool: any): Promise<void>;
|
||||
connect({
|
||||
server,
|
||||
port,
|
||||
user,
|
||||
password
|
||||
}: {
|
||||
server: any;
|
||||
port: any;
|
||||
user: any;
|
||||
password: any;
|
||||
}): any;
|
||||
query(pool: any, sql: string): Promise<QueryResult>;
|
||||
getVersion(pool: any): Promise<string>;
|
||||
listDatabases(
|
||||
pool: any
|
||||
): Promise<
|
||||
{
|
||||
name: string;
|
||||
}[]
|
||||
>;
|
||||
analyseFull(pool: any): Promise<void>;
|
||||
analyseIncremental(pool: any): Promise<void>;
|
||||
}
|
||||
|
||||
9
types/index.d.ts
vendored
9
types/index.d.ts
vendored
@@ -1,11 +1,10 @@
|
||||
/// <reference types="node" />
|
||||
import { ChildProcess } from "child_process";
|
||||
import { DatabaseInfo } from "./dbinfo";
|
||||
export interface OpenedDatabaseConnection {
|
||||
conid: string;
|
||||
database: string;
|
||||
structure: DatabaseInfo;
|
||||
subprocess: ChildProcess;
|
||||
conid: string;
|
||||
database: string;
|
||||
structure: DatabaseInfo;
|
||||
subprocess: ChildProcess;
|
||||
}
|
||||
export * from "./engines";
|
||||
export * from "./dbinfo";
|
||||
|
||||
Reference in New Issue
Block a user