From 2e473576cf765f5c5e83888056c889d0da43e7fc Mon Sep 17 00:00:00 2001 From: Samuel <34555296+Flam3rboy@users.noreply.github.com> Date: Fri, 17 Mar 2023 19:47:23 +0100 Subject: wip: cache --- src/util/util/Cache.ts | 42 ++++++++++++++++++++++++++++++++++++++++++ src/util/util/Database.ts | 1 - 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 src/util/util/Cache.ts (limited to 'src') diff --git a/src/util/util/Cache.ts b/src/util/util/Cache.ts new file mode 100644 index 00000000..44839a65 --- /dev/null +++ b/src/util/util/Cache.ts @@ -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 { + throw new Error("Method not implemented."); + } + disconnect(): Promise { + throw new Error("Method not implemented."); + } + synchronize(queryRunner?: QueryRunner | undefined): Promise { + throw new Error("Method not implemented."); + } + getFromCache( + options: QueryResultCacheOptions, + queryRunner?: QueryRunner | undefined, + ): Promise { + throw new Error("Method not implemented."); + } + storeInCache( + options: QueryResultCacheOptions, + savedCache: QueryResultCacheOptions | undefined, + queryRunner?: QueryRunner | undefined, + ): Promise { + throw new Error("Method not implemented."); + } + isExpired(savedCache: QueryResultCacheOptions): boolean { + throw new Error("Method not implemented."); + } + clear(queryRunner?: QueryRunner | undefined): Promise { + throw new Error("Method not implemented."); + } + remove( + identifiers: string[], + queryRunner?: QueryRunner | undefined, + ): Promise { + throw new Error("Method not implemented."); + } +} diff --git a/src/util/util/Database.ts b/src/util/util/Database.ts index e625ea9b..5c5c8b4c 100644 --- a/src/util/util/Database.ts +++ b/src/util/util/Database.ts @@ -63,7 +63,6 @@ const DataSourceOptions = new DataSource({ supportBigNumbers: true, name: "default", migrations: [path.join(__dirname, "..", "migration", DatabaseType, "*.js")], - cache: true, }); // Gets the existing database connection -- cgit 1.4.1