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
x_pg_channels-0.0.1.tar.gz
(4.5 kB
view details)
Built Distribution
File details
Details for the file x_pg_channels-0.0.1.tar.gz
.
File metadata
- Download URL: x_pg_channels-0.0.1.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 840773301b36c01c6c983463db8a0221744b1225d4a6432c80f328149aa3b654 |
|
MD5 | 4b63cf63caf3b1e50ae70bd416b8c64e |
|
BLAKE2b-256 | 4f6ee647b7ac6ed6bcb2f727a32f6c78957750e7f7a91a2a4d000de6a155d762 |
File details
Details for the file x_pg_channels-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: x_pg_channels-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d76b1476af2946127312c85b3c6bde2742876979d621700ee1fa7a975f0742f0 |
|
MD5 | 5cbcac4ca4ad42dbcacbc04e00ccb21c |
|
BLAKE2b-256 | cf3dd19c3e9faa3f3eaa12b629102f0ce802a9c97f0a5406f438c8016011eb2c |