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

63 lines
1.1 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 MongoDBClientOptions = {
//
}
export type MariaDBClientOptions = {
//
}
export type ProviderOptions = {
tables: string[],
}
export type TableOptions = {
name: string
}
export type MongoDBTableOptions = {
//
} & TableOptions
export type MariaDBTableOptions = {
//
} & TableOptions