{"id":23881774,"url":"https://github.com/zikani03/postnat","last_synced_at":"2026-03-11T04:02:23.401Z","repository":{"id":70575099,"uuid":"490430735","full_name":"zikani03/postnat","owner":"zikani03","description":"Your App -\u003e Postgres NOTIFY -\u003e NATS","archived":false,"fork":false,"pushed_at":"2022-05-09T20:39:39.000Z","size":14,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-09T11:32:50.531Z","etag":null,"topics":["golang","listen-notify","nats","postgresql"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zikani03.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-05-09T20:14:00.000Z","updated_at":"2024-05-08T14:39:19.000Z","dependencies_parsed_at":"2023-06-26T01:46:10.923Z","dependency_job_id":null,"html_url":"https://github.com/zikani03/postnat","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zikani03/postnat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zikani03%2Fpostnat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zikani03%2Fpostnat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zikani03%2Fpostnat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zikani03%2Fpostnat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zikani03","download_url":"https://codeload.github.com/zikani03/postnat/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zikani03%2Fpostnat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30370267,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T21:41:54.280Z","status":"online","status_checked_at":"2026-03-11T02:00:07.027Z","response_time":84,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["golang","listen-notify","nats","postgresql"],"created_at":"2025-01-04T01:58:55.769Z","updated_at":"2026-03-11T04:02:23.376Z","avatar_url":"https://github.com/zikani03.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"postnat\n=======\n\nPublish messages to NATS via Postgres' LISTEN/NOTIFY feature.\n\n## Why would I use this?\n\nLet's assume you already have a postgresql backed application and you want to\nintroduce a Messaging layer but don't have the resources to modify the system \nto introduce more dependencies or you just want to put it off for a bit more.\n\n`postnat` helps you use the facilities of Postgres to publish messages to a NATS\nserver with minimal changes to your code.\n\n```sql\nNOTIFY 'time_us_east', '\u003cbinary-or-json-message-here\u003e';\n```\n\nWhat `postnat` does is basically listen to all registered patterns and publishes\nthe payloads to the configured NATS server.\n\n## Usage\n\nYou can run it like so:\n\n```sh\n$ postnat --config \"postnat.toml\" run\n```\n\n### CLI \n```text\nUsage: postnat \u003ccommand\u003e\n\nPublish messages to NATS from PostgreSQL LISTEN/NOTIFY messages\n\nFlags:\n  -h, --help                     Show context-sensitive help.\n      --config=\"postnat.toml\"    Location of configuration file\n      --debug                    Enable debug mode\n      --version                  Show version and quit\n\nCommands:\n  run    Start the postnat daemon\n\nRun \"postnat \u003ccommand\u003e --help\" for more information on a command.\n```\n\n### Configuration\n\n```toml\n[postgres]\nhost = \"localhost\"\nport = 5432\ndatabase = \"database\"\nusername = \"username\"\npassword = \"password\"\nsslmode = \"disable\"\n\n[nats]\nurl = \"nats://username:password@localhost:4222\"\nmax_reconnects = 10\n\n[topics]\nlisten_for = [\"users\", \"users_id\"]\n# optional topic prefix\nprefix = \"app.\"\n# This replaces the underscore when publishing to nats, e.g. emails_signup -\u003e emails.signup\nreplace_underscore_with_dot = true\n```\n\n## Building\n\nFirst clone this repo:\n\n```sh\n$ git clone https://github.com/zikani03/postnat\n$ cd postnat\n```\n\n### Building from source\n\n```sh\n$ go build ./cmd/postnat.go\n```\n\n### Docker, with docker compose\n\nCreate a configuration file named `development.toml` and update as appropriate, then run:\n\n```sh\n$ docker compose up\n```\n\n---\n\nMIT LICENSE \u0026copy; Zikani Nyirenda Mwase","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzikani03%2Fpostnat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzikani03%2Fpostnat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzikani03%2Fpostnat/lists"}