mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-06 02:42:37 +01:00
wip: cache
This commit is contained in:
parent
cae6fcc72a
commit
2e473576cf
42
src/util/util/Cache.ts
Normal file
42
src/util/util/Cache.ts
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
import { DataSource, QueryRunner } from "typeorm";
|
||||||
|
import { QueryResultCache } from "typeorm/cache/QueryResultCache";
|
||||||
|
import { QueryResultCacheOptions } from "typeorm/cache/QueryResultCacheOptions";
|
||||||
|
|
||||||
|
export class CustomQueryResultCache implements QueryResultCache {
|
||||||
|
constructor(private dataSource: DataSource) {}
|
||||||
|
connect(): Promise<void> {
|
||||||
|
throw new Error("Method not implemented.");
|
||||||
|
}
|
||||||
|
disconnect(): Promise<void> {
|
||||||
|
throw new Error("Method not implemented.");
|
||||||
|
}
|
||||||
|
synchronize(queryRunner?: QueryRunner | undefined): Promise<void> {
|
||||||
|
throw new Error("Method not implemented.");
|
||||||
|
}
|
||||||
|
getFromCache(
|
||||||
|
options: QueryResultCacheOptions,
|
||||||
|
queryRunner?: QueryRunner | undefined,
|
||||||
|
): Promise<QueryResultCacheOptions | undefined> {
|
||||||
|
throw new Error("Method not implemented.");
|
||||||
|
}
|
||||||
|
storeInCache(
|
||||||
|
options: QueryResultCacheOptions,
|
||||||
|
savedCache: QueryResultCacheOptions | undefined,
|
||||||
|
queryRunner?: QueryRunner | undefined,
|
||||||
|
): Promise<void> {
|
||||||
|
throw new Error("Method not implemented.");
|
||||||
|
}
|
||||||
|
isExpired(savedCache: QueryResultCacheOptions): boolean {
|
||||||
|
throw new Error("Method not implemented.");
|
||||||
|
}
|
||||||
|
clear(queryRunner?: QueryRunner | undefined): Promise<void> {
|
||||||
|
throw new Error("Method not implemented.");
|
||||||
|
}
|
||||||
|
remove(
|
||||||
|
identifiers: string[],
|
||||||
|
queryRunner?: QueryRunner | undefined,
|
||||||
|
): Promise<void> {
|
||||||
|
throw new Error("Method not implemented.");
|
||||||
|
}
|
||||||
|
}
|
@ -63,7 +63,6 @@ const DataSourceOptions = new DataSource({
|
|||||||
supportBigNumbers: true,
|
supportBigNumbers: true,
|
||||||
name: "default",
|
name: "default",
|
||||||
migrations: [path.join(__dirname, "..", "migration", DatabaseType, "*.js")],
|
migrations: [path.join(__dirname, "..", "migration", DatabaseType, "*.js")],
|
||||||
cache: true,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Gets the existing database connection
|
// Gets the existing database connection
|
||||||
|
Loading…
Reference in New Issue
Block a user