Repository navigation
v1.2.0 - Rule Repository
[1.2.0] - 2025-12-07
Added
Event Triggers Integration 馃帀 (RFC-0002)
Database Schema:
rule_triggerstable: Trigger configurations with foreign key to rule_definitionsrule_trigger_historytable: Execution audit trail with timing metricsrule_trigger_statsview: Real-time statistics for monitoring- Generic trigger function
execute_rule_trigger()for all event types - Indexes for performance optimization
New SQL Functions:
rule_trigger_create(name, table_name, rule_name, event_type)- Create automatic triggersrule_trigger_enable(trigger_id, enabled)- Enable/disable without deletingrule_trigger_history(trigger_id, start_time, end_time)- View execution historyrule_trigger_delete(trigger_id)- Remove triggers with cleanup
Features:
- Automatic rule execution on INSERT/UPDATE/DELETE events
- Full audit trail with OLD/NEW data snapshots
- Error handling without transaction rollback
- Performance monitoring (<10ms overhead per trigger)
- Support for multiple triggers per table/event
- Trigger enable/disable for maintenance
Documentation:
- RFC-0002 with complete technical design
- Usage examples in README
- Comprehensive test suite in
tests/test_event_triggers.sql - Performance benchmarks and best practices
Changed
- Updated version to 1.2.0 across all files
- Enhanced control file description to include event triggers
- Improved Docker build process (manual installation method)
Fixed
- Fixed Rust compilation errors in triggers module (simplified SPI usage)
- Updated
rule_trigger_history()to return JSON instead of table type - Dockerfile now uses
cargo build+ manual copy (avoids pgrx_embed dependency)