{"id":17861182,"url":"https://github.com/jonathanstowe/pg-notify","last_synced_at":"2025-03-20T21:31:16.528Z","repository":{"id":66980480,"uuid":"83703091","full_name":"jonathanstowe/Pg-Notify","owner":"jonathanstowe","description":"Reactive interface to PostgreSQL notifies","archived":false,"fork":false,"pushed_at":"2022-08-07T08:42:05.000Z","size":36,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-04-22T17:07:00.137Z","etag":null,"topics":["postgresql","raku","rakulang"],"latest_commit_sha":null,"homepage":"","language":"Raku","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"artistic-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonathanstowe.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-02T17:00:16.000Z","updated_at":"2022-10-25T19:53:51.000Z","dependencies_parsed_at":"2023-05-16T10:00:50.189Z","dependency_job_id":null,"html_url":"https://github.com/jonathanstowe/Pg-Notify","commit_stats":null,"previous_names":[],"tags_count":7,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanstowe%2FPg-Notify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanstowe%2FPg-Notify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanstowe%2FPg-Notify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanstowe%2FPg-Notify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonathanstowe","download_url":"https://codeload.github.com/jonathanstowe/Pg-Notify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244084308,"owners_count":20395516,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["postgresql","raku","rakulang"],"created_at":"2024-10-28T08:43:15.127Z","updated_at":"2025-03-20T21:31:16.522Z","avatar_url":"https://github.com/jonathanstowe.png","language":"Raku","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PG::Notify\n\nRaku interface to PostgresQL notifies.\n\n![Build Status](https://github.com/jonathanstowe/Pg-Notify/workflows/CI/badge.svg)\n\n## Synopsis\n\n```raku\n\n\nuse Pg::Notify;\nuse DBIish;\n\nmy $db = DBIish.connect('Pg', database =\u003e \"dbdishtest\");\nmy $channel = \"test\";\n\nmy $notify = Pg::Notify.new(:$db, :$channel );\n\nreact {\n    whenever $notify -\u003e $notification {\n        say $notification.extra;\n    }\n\t# Provide a notification\n\twhenever Supply.interval(1) -\u003e $v {\n\t\t$db.do(\"NOTIFY $channel, '$v'\");\n\t}\n}\n```\n\n## Description\n\nThis provides a simple mechanism to get a supply of the PostgresQL\nnotifications for a particular *channel*.  The supply will emit a stream\nof ```pg-notify``` objects corresponding to a ```NOTIFY``` executed on\nthe connected Postgres database.\n\nTypically the ```NOTIFY``` will be invoked in a trigger or other server\nside code but could just as easily be in some other user code (as in\nthe Synopsis above,)\n\nThe objects of type ```Pg::Notify``` have a ```Supply``` method that\nallows coercion in places that expect a Supply (such as ```whenever```\nin the Synopsis above.) but you can this Supply directly if you want to\n```tap``` it for instance.\n\n## Install\n\nThis relies on [DBIish](https://github.com/raku-community-modules/DBIish) and ideally\nyou will have a working PostgreSQL database connection for the user that you will run the tests as.\n\nFor the tests you can control how it connects to the database with the\nenvironment variables:\n\n*  $PG_NOTIFY_DB   - the name of the database you want to use, otherwise ```dbdishtest```\n*  $PG_NOTIFY_USER - the username to be used, (otherwise will connect as the current user,)\n*  $PG_NOTIFY_PW   - the password to be used, (otherwise no password will be used.)\n*  $PG_NOTIFY_HOST - the host to which the DB connection will made, the default is to connect to a local PG server.\n\nThese should be set before the tests (or install,) are run.\n\nAssuming you have a working Rakudo installation you should just be able to use *zef* :\n\n\tzef install Pg::Notify\n\n\t# or from a local copy\n\n\tzef install .\n\nBut I can't think there should be any problem with any installer that may come along in the future.\n\n## Support\n\nThis relies on the ```poll``` C library function, on Linux this is part\nof the runtime library that is always loaded but it might not be on other\noperating systems, if you have one of those systems I'd be grateful for\na patch to make it work there.\n\nIf you have any other suggestions or problems please report at\nhttps://github.com/jonathanstowe/Pg-Notify/issues\n\n## Copyright and Licence\n\nThis is free software, please see the [LICENCE](LICENCE) file in the distribution.\n\n© Jonathan Stowe 2017 - 2021\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonathanstowe%2Fpg-notify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonathanstowe%2Fpg-notify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonathanstowe%2Fpg-notify/lists"}