Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Implements database audit logging with triggers, CDC, or application-level logs to track INSERT, UPDATE, and DELETE changes for compliance.
41% 68%+27 ptsof test cases passed
Passed 15 of 22 test cases with the skill, and 9 of 22 without it.
An auditor asks for a report of all database modifications initiated by employee '[email protected]'. Write the SQL query against audit_log ordered so the most recent changes appear first.
Filters records by changed_by = '[email protected]'.
3 of 3 safety checks passed
Implement database audit logging to track all data modifications (INSERT, UPDATE, DELETE) with full before/after values, user identity, timestamps, and application context. This skill supports trigger-based auditing for PostgreSQL and MySQL, change data capture (CDC) patterns, and application-level audit logging.
psql or mysql CLI for executing audit setup DDLIdentify tables requiring audit logging based on compliance and business needs:
Create the audit log table with comprehensive metadata:
CREATE TABLE audit_log (
id BIGSERIAL PRIMARY KEY,
table_name VARCHAR(100) NOT NULL,
record_id TEXT NOT NULL,
action VARCHAR(10) NOT NULL CHECK (action IN ('INSERT', 'UPDATE', 'DELETE')),
old_values JSONB,
new_values JSONB,
changed_columns TEXT[],
changed_by VARCHAR(100),
changed_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
client_ip INET,
application_name VARCHAR(100),
transaction_id BIGINT
);
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.