{"id":22894252,"url":"https://github.com/clearcodehq/npm-postgresql-connector","last_synced_at":"2026-05-03T04:32:34.849Z","repository":{"id":57102438,"uuid":"124525527","full_name":"ClearcodeHQ/npm-postgresql-connector","owner":"ClearcodeHQ","description":null,"archived":false,"fork":false,"pushed_at":"2018-03-16T12:06:15.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-30T13:37:09.508Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/ClearcodeHQ.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}},"created_at":"2018-03-09T10:25:47.000Z","updated_at":"2018-03-16T12:06:16.000Z","dependencies_parsed_at":"2022-08-20T18:40:36.375Z","dependency_job_id":null,"html_url":"https://github.com/ClearcodeHQ/npm-postgresql-connector","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClearcodeHQ%2Fnpm-postgresql-connector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClearcodeHQ%2Fnpm-postgresql-connector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClearcodeHQ%2Fnpm-postgresql-connector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClearcodeHQ%2Fnpm-postgresql-connector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ClearcodeHQ","download_url":"https://codeload.github.com/ClearcodeHQ/npm-postgresql-connector/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246552972,"owners_count":20795835,"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":[],"created_at":"2024-12-13T23:17:19.124Z","updated_at":"2026-05-03T04:32:34.796Z","avatar_url":"https://github.com/ClearcodeHQ.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PostgreSQL connector\n\nSimplifies asynchronous connection to PostgreSQL with connection retrying.\n\nIf connection cannot be established, a new attempt will be made after a delay set in config (5 seconds by default). Every subsequent retry will occur after two times as long (so by default 10, 20, 40, 80 etc seconds). You can set how many times connection will be retried (10 by default).\n\n## Installation\n\nAdd to your dependencies:\n\n```\n\"dependencies\": {\n    \"postgresql-connector\": \"https://github.com/ClearcodeHQ/npm-postgresql-connector\"\n}\n```\n\n# Usage\n\n```\nconst PgConnector = require(\"postgresql-connector\");\n\n// You can, but don't have to pass the config array or any of its values\nconst config = {\n    host: 'postgres', // by default process.env.PGSQL_DB_HOST,\n    port: 5432, // by default process.env.PGSQL_DB_PORT,\n    database: 'mydb', // by default process.env.PGSQL_DB_NAME,\n    user: 'myuser', // by default process.env.PGSQL_DB_USER,\n    password: 'mypassword', // by default process.env.PGSQL_DB_PASSWORD,\n    maxPostgresqlConnectionRetries: 5, // by default 10,\n    retryAfter: 3000, // in miliseconds, by default 5000\n}\n\nconst Connector = new PgConnector(config);\n\n// The returned value can be an instance node-postgres (pg) Pool object\n// if the connection was successful, or null if it couldn't be obtained\n// under constraints specified in config\nconst pool = await Connector.connectToPostgresql();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclearcodehq%2Fnpm-postgresql-connector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclearcodehq%2Fnpm-postgresql-connector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclearcodehq%2Fnpm-postgresql-connector/lists"}