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 source provider and writes console.debug lines (with ANSI direction markers) before and after each call, and console.error on 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.