Skip to main content

Generates PL/pgSQL script creating LISTEN/NOTIFY channels

Project description

pre-commit

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


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)

Uploaded Source

Built Distribution

pg_channel-0.0.2-py3-none-any.whl (3.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page