mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 10:46:00 +00:00
dialect, dumper
This commit is contained in:
5
types/dialect.d.ts
vendored
Normal file
5
types/dialect.d.ts
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
export interface SqlDialect {
|
||||
rangeSelect?: boolean;
|
||||
limitSelect?: boolean;
|
||||
quoteIdentifier(s: string): string;
|
||||
}
|
||||
5
types/dumper.d.ts
vendored
Normal file
5
types/dumper.d.ts
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
export interface SqlDumper {
|
||||
s: string;
|
||||
put(format: string, ...args);
|
||||
putCmd(format: string, ...args);
|
||||
}
|
||||
16
types/engines.d.ts
vendored
16
types/engines.d.ts
vendored
@@ -1,18 +1,24 @@
|
||||
import { QueryResult } from "./query";
|
||||
import { SqlDialect } from "./dialect";
|
||||
import { SqlDumper } from "./dumper";
|
||||
import { DatabaseInfo } from "./dbinfo";
|
||||
|
||||
export interface EngineDriver {
|
||||
connect({
|
||||
server,
|
||||
port,
|
||||
user,
|
||||
password
|
||||
password,
|
||||
database
|
||||
}: {
|
||||
server: any;
|
||||
port: any;
|
||||
user: any;
|
||||
password: any;
|
||||
database: any;
|
||||
}): any;
|
||||
query(pool: any, sql: string): Promise<QueryResult>;
|
||||
getVersion(pool: any): Promise<string>;
|
||||
getVersion(pool: any): Promise<{ version: string }>;
|
||||
listDatabases(
|
||||
pool: any
|
||||
): Promise<
|
||||
@@ -20,6 +26,8 @@ export interface EngineDriver {
|
||||
name: string;
|
||||
}[]
|
||||
>;
|
||||
analyseFull(pool: any): Promise<void>;
|
||||
analyseIncremental(pool: any): Promise<void>;
|
||||
analyseFull(pool: any): Promise<DatabaseInfo>;
|
||||
// analyseIncremental(pool: any): Promise<void>;
|
||||
dialect: SqlDialect;
|
||||
createDumper(): SqlDumper;
|
||||
}
|
||||
|
||||
2
types/index.d.ts
vendored
2
types/index.d.ts
vendored
@@ -9,3 +9,5 @@ export interface OpenedDatabaseConnection {
|
||||
export * from "./engines";
|
||||
export * from "./dbinfo";
|
||||
export * from "./query";
|
||||
export * from "./dialect";
|
||||
export * from "./dumper";
|
||||
|
||||
9
types/query.d.ts
vendored
9
types/query.d.ts
vendored
@@ -1,3 +1,8 @@
|
||||
export interface QueryResult {
|
||||
rows: any[];
|
||||
export interface RangeDefinition {
|
||||
offset: number;
|
||||
limit: number;
|
||||
}
|
||||
|
||||
export interface QueryResult {
|
||||
rows: any[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user