{"id":21766380,"url":"https://github.com/rtasalem/busgres","last_synced_at":"2025-09-09T01:43:33.069Z","repository":{"id":233640231,"uuid":"787602899","full_name":"rtasalem/busgres","owner":"rtasalem","description":"Busgres is a Node.js package that will receieve a message from an Azure Service Bus queue or topic and save it into a PostgreSQL database.","archived":false,"fork":false,"pushed_at":"2025-07-28T00:07:55.000Z","size":227,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-09T02:48:58.763Z","etag":null,"topics":["azure","npm","postgresql","service-bus"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/busgres","language":"JavaScript","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/rtasalem.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-04-16T20:49:51.000Z","updated_at":"2025-07-11T09:09:41.000Z","dependencies_parsed_at":"2024-04-17T01:20:21.300Z","dependency_job_id":"81b9f680-e03a-49ee-9dae-07d54dc91965","html_url":"https://github.com/rtasalem/busgres","commit_stats":null,"previous_names":["rtasalem/busgres"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rtasalem/busgres","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtasalem%2Fbusgres","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtasalem%2Fbusgres/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtasalem%2Fbusgres/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtasalem%2Fbusgres/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rtasalem","download_url":"https://codeload.github.com/rtasalem/busgres/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtasalem%2Fbusgres/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274232024,"owners_count":25245856,"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","status":"online","status_checked_at":"2025-09-08T02:00:09.813Z","response_time":121,"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":["azure","npm","postgresql","service-bus"],"created_at":"2024-11-26T13:17:05.442Z","updated_at":"2025-09-09T01:43:33.057Z","avatar_url":"https://github.com/rtasalem.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Busgres\nService BUS + PostGRES = Busgres\n\n[Busgres](https://www.npmjs.com/package/busgres) is a Node.js package that will receive a message from an Azure Service Bus queue or topic and save it into a PostgreSQL database. It abstracts the [`@azure/service-bus`](https://www.npmjs.com/package/@azure/service-bus) and [`pg` (node-postgres)](https://www.npmjs.com/package/pg) packages for Service Bus and Postgres integration.\n\n## Note\n\nFor the best experience, use only Busgres `v5.0.3` and above.\n\n## Installation\n\nThis package can be installed using NPM:\n\n```\nnpm i busgres\n```\n\n## Usage\n\n`BusgresClient` set-up \u0026 configuration:\n\n```javascript\nimport { BusgresClient } from 'busgres'\nimport 'dotenv/config'\n\nconst busgresClient = new BusgresClient({\n  serviceBus: {\n        connectionString: process.env.SB_CONNECTION_STRING,\n    entity: process.env.SB_ENTITY,\n    entityType: 'queue'\n  },\n  postgres: {\n    username: process.env.PG_USERNAME,\n    password: process.env.PG_PASSWORD,\n    database: process.env.PG_DATABASE,\n    host: process.env.PG_HOST,\n    port: process.env.PG_PORT\n  }\n})\n\nconst tableName = 'busgres'\nconst columnNames = ['message']\n\nexport {\n  busgresClient,\n  tableName,\n  columnNames\n}\n```\n\nNOTE: If using topics, provide the topic name for `sbEntityName` in place of a queue name. Additionally, ensure `sbEntityType` is set to `'topic'` and that a value for `sbEntitySubscription` is also provided.  \n\nStarting the `BusgresClient` connection:\n\n```javascript\nimport { \n  busgresClient, \n  tableNames, \n  columnNames \n} from './busgres-config.js'\n\nawait busgresClient.start(tableName, columnNames)\n\nprocess.on('SIGINT', async () =\u003e {\n  await busgresClient.stop()\n  process.exit()\n})\n\n```\nWith the above set-up and configuration a basic working `BusgresClient` connection can be established.\n\n## Demo\n\nA simple demo Node.js application, [busgres-demo](https://github.com/rtasalem/busgres-demo), was created to test the functionality of this package during its development and to provide further example of usage.\n\n## License\n\nThis package is licensed under the [MIT License](./LICENSE).\n\n## Feedback\n\nFeel free to reach out if you have any suggestions for improvement or further development.\n\n## Dependencies\n\nThis package has a total of 2 dependencies on the following:  \n- [@azure/service-bus](https://www.npmjs.com/package/@azure/service-bus)  \n- [pg](https://www.npmjs.com/package/pg)\n\n## Author\n\n[Rana Salem](https://github.com/rtasalem)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frtasalem%2Fbusgres","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frtasalem%2Fbusgres","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frtasalem%2Fbusgres/lists"}