{"id":20434174,"url":"https://github.com/casecommons/pg_audit_log","last_synced_at":"2025-04-12T21:11:45.538Z","repository":{"id":1317193,"uuid":"1262066","full_name":"Casecommons/pg_audit_log","owner":"Casecommons","description":"Create a trigger-based audit log for PostgreSQL","archived":false,"fork":false,"pushed_at":"2024-07-19T17:07:12.000Z","size":117,"stargazers_count":3,"open_issues_count":6,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-12T21:11:37.987Z","etag":null,"topics":["activerecord","audit-log","postgresql"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Casecommons.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-01-17T02:04:07.000Z","updated_at":"2021-11-08T10:26:16.000Z","dependencies_parsed_at":"2024-07-21T19:48:04.238Z","dependency_job_id":null,"html_url":"https://github.com/Casecommons/pg_audit_log","commit_stats":null,"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Casecommons%2Fpg_audit_log","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Casecommons%2Fpg_audit_log/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Casecommons%2Fpg_audit_log/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Casecommons%2Fpg_audit_log/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Casecommons","download_url":"https://codeload.github.com/Casecommons/pg_audit_log/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248631682,"owners_count":21136562,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["activerecord","audit-log","postgresql"],"created_at":"2024-11-15T08:24:35.441Z","updated_at":"2025-04-12T21:11:45.507Z","avatar_url":"https://github.com/Casecommons.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pg_audit_log\n\n[![Build Status](https://secure.travis-ci.org/Casecommons/pg_audit_log.svg?branch=master)](https://travis-ci.org/Casecommons/pg_audit_log)\n[![Code Climate](https://img.shields.io/codeclimate/github/Casecommons/pg_audit_log.svg?style=flat)](https://codeclimate.com/github/Casecommons/pg_audit_log)\n[![Gem Version](https://img.shields.io/gem/v/pg_audit_log.svg?style=flat)](https://rubygems.org/gems/pg_audit_log)\n\n## Description\n\nPostgreSQL-only database-level audit logging of all databases changes using a completely transparent stored procedure and triggers.\nComes with specs for your project and a rake task to generate the reverse SQL to undo changes logged.\n\nAll SQL `INSERT`s, `UPDATE`s, and `DELETE`s will be captured. Record columns that do not change do not generate an audit log entry.\n\n## Installation\n\n- First, enable plpgsql langauges in your postgresql instance. Execute the following as a superuser in postgres make sure your database has plpgsql enabled:\n\n        CREATE OR REPLACE PROCEDURAL LANGUAGE plpgsql;\n\n- Generate the appropriate Rails files:\n\n        rails generate pg_audit_log:install\n\n- Install the PostgreSQL function and triggers for your project:\n\n        rake pg_audit_log:install\n\n## Usage\n\nThe PgAuditLog::Entry ActiveRecord model represents a single entry in the audit log table. Each entry represents a single change to a single field of a record in a table. So if you change 3 columns of a record, that will generate 3 corresponding PgAuditLog::Entry records.\n\nYou can see the SQL it injects on every query by running with LOG_AUDIT_SQL\n\n### Migrations\n\nTODO\n\n### schema.rb and development_structure.sql\n\nSince schema.rb cannot represent TRIGGERs or FUNCTIONs you will need to set your environment to generate SQL instead of Ruby for your database schema and structure. In your application environment put the following:\n\n    config.active_record.schema_format = :sql\n\nAnd you can generate this sql using:\n\n    rake db:structure:dump\n\n## Uninstalling\n\n    rake pg_audit_log:uninstall\n\n## Performance\n\nOn a 2.93GHz i7 with PostgreSQL 9.1 the audit log has an overhead of about 0.0035 seconds to each `INSERT`, `UPDATE`, or `DELETE`.\n\n## Requirements\n\n- ActiveRecord\n- PostgreSQL\n- Rails 3.2, 4.x\n\n## LICENSE\n\nCopyright © 2010–2014 Case Commons, LLC. Licensed under the MIT license, available in the “LICENSE” file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasecommons%2Fpg_audit_log","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcasecommons%2Fpg_audit_log","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasecommons%2Fpg_audit_log/lists"}