galactic-bot/@types/Storage.d.ts

56 lines
1.0 KiB
TypeScript
Raw Normal View History

2023-12-05 16:47:54 +01:00
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 = {
2023-12-05 19:31:53 +01:00
name?: string,
2023-12-05 16:47:54 +01:00
tables: string[],
}
export type TableOptions = {
name: string
}
export type MongoDBTableOptions = {
//
} & TableOptions
export type MariaDBTableOptions = {
//
} & TableOptions