Generates PL/pgSQL script creating LISTEN/NOTIFY channels
Project description
Postgres channels
Generates PL/pgSQL script creating LISTEN/NOTIFY channels from just table name and dict of update triggers with fields sets.
Function plsql
takes one requiered :str
arg - table_name, and generates PL/pgSQL script for creating 3 channels for 3 type events:
Examples
On table: Fire tables_new
: on create entity in table
, tables_del
: on delete entity from table
, and tables_upd
: on update any table.field
:
plsql('table')
And second optional :dict
arg - dict of list/tuples
of specified fields for triggering update event(s):
Set exactly field for triggering event: Fire tables_upd_event1
: on update table.field1
:
plsql('table', {'event1': ['field1']})
AND/OR conditions: Fire tables_upd_event1
: on update field1 AND field2
, and tables_upd_event2
: on update field2 OR field3
:
{'event1': ('field1','field2'), 'event2': ['field2', 'field3']}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
x_pg_channels-0.0.1.tar.gz
(4.5 kB
view hashes)
Built Distribution
Close
Hashes for x_pg_channels-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d76b1476af2946127312c85b3c6bde2742876979d621700ee1fa7a975f0742f0 |
|
MD5 | 5cbcac4ca4ad42dbcacbc04e00ccb21c |
|
BLAKE2b-256 | cf3dd19c3e9faa3f3eaa12b629102f0ce802a9c97f0a5406f438c8016011eb2c |