Could you recommend an #ElixirLang library for tracking changes in the database, such as for audit purposes? I need it to work with Postgres and Ecto.
1 repost8 likes
Could you recommend an #ElixirLang library for tracking changes in the database, such as for audit purposes? I need it to work with Postgres and Ecto.
1 repost8 likes
I went for the opposite of overkill and ended up with a pure SQL solution (credits to Claude): bsky.app/profile/mxgr...
Poor man's audit log for Postgres tables. Pure SQL, no Elixir required. Time-to-shelf: 1 minute. Run the final part for each table you want to audit. Use Postico as the UI. gist.github.com/mxgrn/9900c2...
I was going to suggest this same approach: triggers that convert the updated/deleted row to a JSON object that can be logged or archived. @brandur.bsky.social provides a great example in brandur.org/fragments/de...
In the end, didn't even need Postgres events (neither Elixir), went with triggers: bsky.app/profile/mxgr...
Poor man's audit log for Postgres tables. Pure SQL, no Elixir required. Time-to-shelf: 1 minute. Run the final part for each table you want to audit. Use Postico as the UI. gist.github.com/mxgrn/9900c2...
Ash is nice, but I haven't yet introduced it into the codebase. Ended up with very incomplete express solution employing pure SQL (triggers, specifically): bsky.app/profile/mxgr...
Poor man's audit log for Postgres tables. Pure SQL, no Elixir required. Time-to-shelf: 1 minute. Run the final part for each table you want to audit. Use Postico as the UI. gist.github.com/mxgrn/9900c2...