63 lines
1.1 KiB
TypeScript
63 lines
1.1 KiB
TypeScript
|
import { MongoClientOptions } from 'mongodb';
|
||
|
import { PoolClusterConfig, PoolConfig } from 'mysql';
|
||
|
|
||
|
export type MariaError = {
|
||
|
code: string,
|
||
|
errno: number,
|
||
|
fatal: boolean,
|
||
|
sql: string,
|
||
|
sqlState: string,
|
||
|
sqlMessage:string
|
||
|
} & Error
|
||
|
|
||
|
export type Credentials = {
|
||
|
user: string,
|
||
|
password: string,
|
||
|
host: string,
|
||
|
port: number,
|
||
|
database: string
|
||
|
}
|
||
|
|
||
|
type DBOptions = {
|
||
|
load?: boolean,
|
||
|
tables: string[]
|
||
|
}
|
||
|
|
||
|
export type MongoDBOptions = {
|
||
|
client?: MongoClientOptions,
|
||
|
} & DBOptions
|
||
|
|
||
|
export type MariaDBOptions = {
|
||
|
cluster?: PoolClusterConfig,
|
||
|
client?: PoolConfig,
|
||
|
} & DBOptions
|
||
|
|
||
|
export type StorageManagerOptions = {
|
||
|
[key: string]: MariaDBOptions | MongoDBOptions
|
||
|
mongodb: MongoDBOptions,
|
||
|
mariadb: MariaDBOptions
|
||
|
}
|
||
|
|
||
|
export type MongoDBClientOptions = {
|
||
|
//
|
||
|
}
|
||
|
|
||
|
export type MariaDBClientOptions = {
|
||
|
//
|
||
|
}
|
||
|
|
||
|
export type ProviderOptions = {
|
||
|
tables: string[],
|
||
|
}
|
||
|
|
||
|
export type TableOptions = {
|
||
|
name: string
|
||
|
}
|
||
|
|
||
|
export type MongoDBTableOptions = {
|
||
|
//
|
||
|
} & TableOptions
|
||
|
|
||
|
export type MariaDBTableOptions = {
|
||
|
//
|
||
|
} & TableOptions
|