22 lines
1.0 KiB
TypeScript
22 lines
1.0 KiB
TypeScript
import { MysqlStore, PostgreSQLStore } from "oak-db";
|
|
import { DbConfiguration } from "oak-db/src/types/configuration";
|
|
import { EntityDict, StorageSchema } from 'oak-domain/lib/types';
|
|
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/base-app-domain';
|
|
import { BackendRuntimeContext } from 'oak-frontend-base/lib/context/BackendRuntimeContext';
|
|
import { CascadeStore } from "oak-domain/lib/store/CascadeStore";
|
|
import { DbStore } from "oak-db/lib/types/dbStore";
|
|
/**
|
|
* 数据库优先级列表,按顺序尝试获取配置文件
|
|
*/
|
|
export declare const dbList: {
|
|
mysql: typeof MysqlStore;
|
|
postgres: typeof PostgreSQLStore;
|
|
};
|
|
export declare const DbTypeSymbol: unique symbol;
|
|
export declare const getDbConfig: (path: string) => DbConfiguration & {
|
|
[DbTypeSymbol]: string;
|
|
};
|
|
export declare const getDbStoreClass: <ED extends EntityDict & BaseEntityDict, Cxt extends BackendRuntimeContext<ED>>(config: {
|
|
[DbTypeSymbol]?: string;
|
|
}) => new (schema: StorageSchema<ED>, config: DbConfiguration) => DbStore<ED, Cxt> & CascadeStore<ED>;
|