56 lines
1.0 KiB
TypeScript
56 lines
1.0 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 ProviderOptions = {
|
|
name?: string,
|
|
tables: string[],
|
|
}
|
|
|
|
export type TableOptions = {
|
|
name: string
|
|
}
|
|
|
|
export type MongoDBTableOptions = {
|
|
//
|
|
} & TableOptions
|
|
|
|
export type MariaDBTableOptions = {
|
|
//
|
|
} & TableOptions |