Skip to content

Investigate using PostgreSQL NOTIFY and commit hooks #60

@hishnash

Description

@hishnash

Is your feature request related to a problem? Please describe.
Currently this lib uses Django Signals to detect changes however Django does not send these events if you do bulk updates or raw SQL operations and if you have other clients connecting to the database making changes you also do not get any events.

Describe the solution you'd like
PostgreSQL support the concept of NOTIFY and LISTEN, since commit hocks can send NOTIFY messages it would be possible to have PG automatically inform all LISTENs of db changes regardless of were the changes came from.

I would like to investigate a little more how NOTIFY and LISTEN work in PG and how easy/hard it would be to add something to Django's DB manager that automatically adds migrations for ObservableModel classes to trigger the NOTIFY on commit.

As a first pass it could be interesting to implement a PG packed change channels layer that uses the LISTEN and NOTIFY api this could be an interesting option for people who do not want to deploy an additional redis.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions