DebugDBProviderclass
new DebugDBProvider<I, T>()
| Return | |
|---|---|
DebugDBProvider<I, T> | Database provider that logs every operation it performs to the console for debugging. |
Database provider that logs every operation it performs to the console for debugging.
- Wraps a
sourceprovider and writesconsole.debuglines (with ANSI direction markers) before and after each call, andconsole.erroron failure. - Drop it into a provider chain while developing to trace database reads and writes; it changes no data.
Examples
const provider = new DebugDBProvider(new MemoryDBProvider()); await provider.getItem(users, 123); // Logs the call and its result.