()
| 55 | let storeInstance: AdcpStateStore | null = null; |
| 56 | |
| 57 | function getStore(): AdcpStateStore { |
| 58 | if (storeInstance) return storeInstance; |
| 59 | storeInstance = isDatabaseInitialized() |
| 60 | ? new PostgresStateStore(getPool()) |
| 61 | : new InMemoryStateStore(); |
| 62 | return storeInstance; |
| 63 | } |
| 64 | |
| 65 | /** Override the store (tests only — refuses to run in production). */ |
| 66 | export function setStateStore(store: AdcpStateStore | null): void { |
no test coverage detected