{"id":20913089,"url":"https://github.com/tbe/pqparser","last_synced_at":"2025-05-13T09:31:16.655Z","repository":{"id":57491673,"uuid":"198052392","full_name":"tbe/pqparser","owner":"tbe","description":"A helper library to support libpq style connection strings for go-pg","archived":false,"fork":false,"pushed_at":"2019-08-23T11:27:02.000Z","size":19,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-01T20:31:35.888Z","etag":null,"topics":["go","golang","postgres","postgresql"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tbe.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":"2019-07-21T12:16:31.000Z","updated_at":"2022-04-22T06:58:08.000Z","dependencies_parsed_at":"2022-08-30T23:20:50.347Z","dependency_job_id":null,"html_url":"https://github.com/tbe/pqparser","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tbe%2Fpqparser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tbe%2Fpqparser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tbe%2Fpqparser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tbe%2Fpqparser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tbe","download_url":"https://codeload.github.com/tbe/pqparser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253913048,"owners_count":21983246,"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":["go","golang","postgres","postgresql"],"created_at":"2024-11-18T14:34:47.465Z","updated_at":"2025-05-13T09:31:16.343Z","avatar_url":"https://github.com/tbe.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pqparser\n\nA helper library to support libpq style connection strings for go-pg\n\n## Why?\n\n[go-pg][1] does have a very limited support for URI style DSN's. The goal of this library is,\nto support the full feature set of [libpq][2]'s connection strings.\n\n## Usage\n\n```go\npackage main\nimport (\n\t\"gitlab.com/tbe/pqparser\"\n\t\"github.com/go-pg/pg\"\n)\t\nfunc main() {\n\toptions,err := pqparser.Parse(\"postgres://%2Fvar%2Flib%2Fpostgresql/dbname\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\t\n\tdb := pg.Connect(options)\n\t...\n}\n```\n\nFor full documentation about the behavior of `Parse`, see the [`libpq` documenation][2]\n\n## Limitations\n\nIn difference to `libpq`, we use a TCP connection to `localhost` if no hostname is given.\n`libpq` has a default socket path, but we don't know where the socket could be found.\n\nCurrently, there are a few features that are not implemented.\n\n### `keepalive*` settings\n\nAs go-pq does not have support for keepalive settings, we ignore these parameters.\n\n### `sslcompression`\n\nI'm not sure if it is possible to implement this without dark hacks.\n\n### `requirepeer`\n\nThis may be implemented later. We could implement this by overriding the `Dialer` function.\n\n### `krbsrvname` and `gsslib`\n\nThere is no support for this authentication methods in go-pg.\n\n### `service`\n\nCould be implemented later. PR's welcome\n\n### `sslmode`\n\nExpect `verify-full`, all sslmodes skip the host verification at the moment.\n\n### `sslrootcert` and `sslcrl`\n\nShould be simple to implement, but the work is not done yet\n\n[1]: https://github.com/go-pg/pg\n[2]: https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftbe%2Fpqparser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftbe%2Fpqparser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftbe%2Fpqparser/lists"}