drogon icon indicating copy to clipboard operation
drogon copied to clipboard

Support postgresql asynchronous notification (LISTEN command).

Open hwc0919 opened this issue 3 years ago • 2 comments

hwc0919 avatar Sep 15 '22 06:09 hwc0919

functions for FastDbClient not implemented yet.

hwc0919 avatar Sep 15 '22 06:09 hwc0919

TODOS:

  1. Forgot to handle concurrent query!!!
  2. Need to handle LISTEN query failure caused by too many queued quries.
  3. LISTEN and NOTIFY commands don't take parameter placeholders ($1), the whole sql must be plain text. Need to handle character escaping.

hwc0919 avatar Sep 15 '22 09:09 hwc0919

GREAT !!!

This is really a useful feature. Now to create a real time applications one must use other messaging libraries or create and extra column in every table in DB called "last_modified_time" and check the table periodically to figure out has the table changed or not. With PostgreSQL notifications mechanism one can avoid all this hell and use PostgreSQL itself as a messaging library and have your data in application synchronized with DB also.

I would appreciate if you accept this PR. Thanks!!!

Baxulio avatar Nov 11 '22 15:11 Baxulio

Unfortunately I was stuck here...

hwc0919 avatar Nov 11 '22 15:11 hwc0919

This PR has been discarded. Please refer to the new PR #1464.

hwc0919 avatar Dec 29 '22 08:12 hwc0919