feat: 支持postgresql

This commit is contained in:
xiaojunnuo
2024-07-17 01:30:00 +08:00
parent a917a7bca6
commit 3b19bfb429
23 changed files with 203 additions and 321 deletions
+3 -4
View File
@@ -1,4 +1,5 @@
import { IStorage, MemoryStorage } from "./storage.js";
const CONTEXT_VERSION_KEY = "contextVersion";
export interface IContext {
getInt(key: string): Promise<number>;
@@ -20,13 +21,11 @@ export class ContextFactory {
}
getContext(scope: string, namespace: string): IContext {
const context = new StorageContext(scope, namespace, this.storage);
return context;
return new StorageContext(scope, namespace, this.storage);
}
getMemoryContext(scope: string, namespace: string): IContext {
const context = new StorageContext(scope, namespace, this.memoryStorage);
return context;
return new StorageContext(scope, namespace, this.memoryStorage);
}
}