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 Distribution

pg_channel-0.0.4.dev2.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

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

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

Uploaded Python 3

File details

Details for the file pg_channel-0.0.4.dev2.tar.gz.

File metadata

  • Download URL: pg_channel-0.0.4.dev2.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.7

File hashes

Hashes for pg_channel-0.0.4.dev2.tar.gz
Algorithm Hash digest
SHA256 880698a9b4d66ec7263ffd9fb40fd75b6939abaa457eea747eee311722a0588c
MD5 83f0cd8d23d8ae07eb16fb3d10289b23
BLAKE2b-256 9d32dfcb44cfa51bad2120ac9d1692ab5c2e24eff00dfd4f52e558dcf4248dbf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pg_channel-0.0.4.dev2-py3-none-any.whl
Algorithm Hash digest
SHA256 c1ae2355c80f4081c62dac3ef84718f4cd665ce6c232fee86b9418d9dda99586
MD5 d3999f6dfc6c318650b9a642a92a69cb
BLAKE2b-256 12522f486ab04cd090323496a6190e483474586c89c7f4415bdd8022a1d741d5

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