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.5.tar.gz (4.1 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.5-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

Details for the file pg_channel-0.0.5.tar.gz.

File metadata

  • Download URL: pg_channel-0.0.5.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.9

File hashes

Hashes for pg_channel-0.0.5.tar.gz
Algorithm Hash digest
SHA256 2cf42ca5517e6a2c4de20feab28357726e6322cfb8b0070f874ab9476fd86147
MD5 9afcbad8175d6370b89d7758fa733c93
BLAKE2b-256 7045214798bb0b3b54f2719c33136ac93172a8b73141a5a1de7c2454ab08f265

See more details on using hashes here.

File details

Details for the file pg_channel-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: pg_channel-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 2.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.9

File hashes

Hashes for pg_channel-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 6bd9e5f7b1c09d80a588d572bde6a45d74f765fea9137a62120157ff2397aee9
MD5 5b670c147345e4ffc827972e7ab01076
BLAKE2b-256 55556248b5a482935142c05c180f0e6816827d6e21e466628554c1a87190336e

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