Transaction table row is not created if the transaction values is empty. I would argue that transaction should always be created in order to tie related activity table rows together. The current implementation is really explicit about not creating the row, thus I would like to know if there is some reason for it.
|
values = convert_callables(self.get_transaction_values()) |
|
if values: |
|
values['native_transaction_id'] = sa.func.txid_current() |
|
values['issued_at'] = sa.text("now() AT TIME ZONE 'UTC'") |
|
stmt = ( |
|
insert(table) |
|
.values(**values) |
|
.on_conflict_do_nothing( |
|
constraint='transaction_unique_native_tx_id' |
|
) |
|
) |
|
session.execute(stmt) |
Transaction table row is not created if the transaction values is empty. I would argue that transaction should always be created in order to tie related activity table rows together. The current implementation is really explicit about not creating the row, thus I would like to know if there is some reason for it.
postgresql-audit/postgresql_audit/base.py
Lines 304 to 315 in 824c4f9