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
pg_channel-0.0.2.tar.gz
(4.6 kB
view hashes)
Built Distribution
Close
Hashes for pg_channel-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | da65b21d0a5bb35de5aa7ae776cf73dbe8ddcfde5ba9140e54c64085f845d80d |
|
MD5 | 9d1e354307ecf9e7b8e8fa15e07b3e86 |
|
BLAKE2b-256 | 2ea7b42fb4f162d42e198572cdf5073d1068a3132a6bce68afeffef5fcecfe8e |