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', 7, {'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'), 5, '_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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pg_channel-0.0.4.dev1-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file pg_channel-0.0.4.dev1-py3-none-any.whl.

File metadata

File hashes

Hashes for pg_channel-0.0.4.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 e4cbc8aa08bfe5a97966401f979cf626d300be9f7f5ee82364f0b2c1f96f1be5
MD5 e43c9a8c827b675e8f8fdb96fe09de3f
BLAKE2b-256 a2bb725e87c80f1656c2245ecf53fc6aa0a1ac8bbc3c380c9ac9450e466a5838

See more details on using hashes here.

Supported by

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