sqlLog (v0.4.2) is a lightweight library that adds a simple logging table to an SQL database, built on top of the davesql package. It provides automatic creation of a 'log' table with fields for event name, error, JSON data, and timestamp. Designed for quick integration, it offers methods to append events and retrieve recent operations. Release cadence is low; last update 2016. Differentiator: minimal setup, ideal for small apps needing basic SQL logging without a full ORM.
npm install sqllogNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initialize davesql, connect to MySQL, then use sqlLog to log events and retrieve recent entries.
Ensure davesql is properly installed and connected before calling sqlLog.init().
Manually create the log table with the expected schema before using sqlLog, or drop the existing table and let sqlLog recreate it.
Consider evaluating if the package is still suitable for production use; check for alternative logging libraries.
Always pass an object for eventData, e.g., { message: 'some string' }.Use import sqlLog from 'sqllog' and then call sqlLog.init().
Run 'npm install davesql' in your project.
Create the database first: CREATE DATABASE test;
Drop the existing log table or ensure it matches the expected schema.