1.8 CQL: Hooks
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
    • Packages
      • Constraint Query Language A high level interface to SQL databases
        • library(cql/cql): CQL - Constraint Query Language
          • CQL: Hooks
            • CQL: Generated Code Hooks
            • CQL: Data Representation Hooks
            • CQL: Application Integration
            • CQL: Inline values
            • CQL: Schema
            • CQL: Event Processing and History
            • CQL: Statistical Hooks

1.8.6 CQL: Event Processing and History

CQL provides hooks for maintaining detailed history of data in the database.

The hook predicates are:

  • cql:cql_event_notification_table(+Schema, +TableName)
  • cql:cql_history_attribute(+Schema, +TableName, +ColumnName)
  • cql:cql_update_history_hook(+Schema, +TableName, +ColumnName, +PrimaryKeyColumnName, +PrimaryKeyValue, +ApplicationValueBefore, +ApplicationValueAfter, +AccessToken, +TransactionId, +TransactionTimestamp, +ThreadId, +Connection, +Goal).
  • cql:process_database_events(+Events)

Event Processing and History recording can be suppressed for a particular update/insert/delete statement by including the _no_state_change_actions_9 directive.

For example

{[],
 update(se_lt_x, [f-'LILAC']
 @ :: [a-'ELSTON_M'],
 no_state_change_actions,   % Don't want history to record this change
 row_count(RowCount)}