mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-29 13:23:58 +00:00
typings refactor - no compilation, renamed package
This commit is contained in:
24
types/dbinfo.d.ts
vendored
Normal file
24
types/dbinfo.d.ts
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
export interface NamedObjectInfo {
|
||||
pureName: string;
|
||||
schemaName: 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;
|
||||
}
|
||||
export interface TableInfo extends NamedObjectInfo {
|
||||
columns: ColumnInfo[];
|
||||
}
|
||||
export interface DatabaseInfo {
|
||||
tables: TableInfo[];
|
||||
}
|
||||
16
types/engines.d.ts
vendored
Normal file
16
types/engines.d.ts
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
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>;
|
||||
}
|
||||
12
types/index.d.ts
vendored
Normal file
12
types/index.d.ts
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
/// <reference types="node" />
|
||||
import { ChildProcess } from "child_process";
|
||||
import { DatabaseInfo } from "./dbinfo";
|
||||
export interface OpenedDatabaseConnection {
|
||||
conid: string;
|
||||
database: string;
|
||||
structure: DatabaseInfo;
|
||||
subprocess: ChildProcess;
|
||||
}
|
||||
export * from "./engines";
|
||||
export * from "./dbinfo";
|
||||
export * from "./query";
|
||||
7
types/package.json
Normal file
7
types/package.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": "0.1.0",
|
||||
"name": "@types/dbgate",
|
||||
"types": "index.d.ts",
|
||||
"main": "",
|
||||
"typeScriptVersion": "2.8"
|
||||
}
|
||||
3
types/query.d.ts
vendored
Normal file
3
types/query.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export interface QueryResult {
|
||||
rows: any[];
|
||||
}
|
||||
Reference in New Issue
Block a user