{"id":13412280,"url":"https://github.com/lib/pq","last_synced_at":"2026-01-29T00:13:11.389Z","repository":{"id":2704761,"uuid":"3698588","full_name":"lib/pq","owner":"lib","description":"Go PostgreSQL driver for database/sql","archived":false,"fork":false,"pushed_at":"2026-01-18T19:41:00.000Z","size":1236,"stargazers_count":9760,"open_issues_count":119,"forks_count":934,"subscribers_count":145,"default_branch":"master","last_synced_at":"2026-01-19T03:13:42.903Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/lib/pq","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/lib.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2012-03-12T18:50:22.000Z","updated_at":"2026-01-18T19:30:53.000Z","dependencies_parsed_at":"2023-07-06T13:31:32.758Z","dependency_job_id":"1a860748-f66e-4379-a296-9e9c0194d55e","html_url":"https://github.com/lib/pq","commit_stats":{"total_commits":586,"total_committers":143,"mean_commits":"4.0979020979020975","dds":0.7593856655290102,"last_synced_commit":"3d613208bca2e74f2a20e04126ed30bcb5c4cc27"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/lib/pq","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lib%2Fpq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lib%2Fpq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lib%2Fpq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lib%2Fpq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lib","download_url":"https://codeload.github.com/lib/pq/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lib%2Fpq/sbom","scorecard":{"id":587762,"data":{"date":"2025-08-11","repo":{"name":"github.com/lib/pq","commit":"b7ffbd3b47da4290a4af2ccd253c74c2c22bfabf"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":5.1,"checks":[{"name":"Code-Review","score":8,"reason":"Found 18/22 approved changesets -- score normalized to 8","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql-analysis.yml:10","Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql-analysis.yml:11","Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1","Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/lib/pq/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/lib/pq/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/lib/pq/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:177: update your workflow using https://app.stepsecurity.io/secureworkflow/lib/pq/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:180: update your workflow using https://app.stepsecurity.io/secureworkflow/lib/pq/test.yml/master?enable=pin","Warn: goCommand not pinned by hash: .github/workflows/test.yml:201","Info:   0 out of   5 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 goCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":7,"reason":"SAST tool detected but not run on all commits","details":["Info: SAST configuration detected: CodeQL","Warn: 0 commits out of 28 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T21:02:19.903Z","repository_id":2704761,"created_at":"2025-08-20T21:02:19.903Z","updated_at":"2025-08-20T21:02:19.903Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28857212,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T22:56:21.783Z","status":"ssl_error","status_checked_at":"2026-01-28T22:56:00.861Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-07-30T20:01:22.926Z","updated_at":"2026-01-29T00:13:11.383Z","avatar_url":"https://github.com/lib.png","language":"Go","readme":"pq is a Go PostgreSQL driver for database/sql.\n\nAll [maintained versions of PostgreSQL] are supported. Older versions may work,\nbut this is not tested.\n\nAPI docs: https://pkg.go.dev/github.com/lib/pq\n\nInstall with:\n\n    go get github.com/lib/pq@latest\n\n[maintained versions of PostgreSQL]: https://www.postgresql.org/support/versioning\n\nFeatures\n--------\n* SSL\n* Handles bad connections for `database/sql`\n* Scan `time.Time` correctly (i.e. `timestamp[tz]`, `time[tz]`, `date`)\n* Scan binary blobs correctly (i.e. `bytea`)\n* Package for `hstore` support\n* COPY FROM support\n* pq.ParseURL for converting urls to connection strings for sql.Open.\n* Many libpq compatible environment variables\n* Unix socket support\n* Notifications: `LISTEN`/`NOTIFY`\n* pgpass support\n* GSS (Kerberos) auth\n\nRunning Tests\n-------------\nTests need to be run against a PostgreSQL database; you can use Docker compose\nto start one:\n\n    docker compose up -d\n\nThis starts the latest PostgreSQL; use `docker compose up -d pg«v»` to start a\ndifferent version.\n\nIn addition, your `/etc/hosts` currently needs an entry:\n\n    127.0.0.1 postgres postgres-invalid\n\nOr you can use any other PostgreSQL instance; see\n`testdata/init/docker-entrypoint-initdb.d` for the required setup. You can use\nthe standard `PG*` environment variables to control the connection details; it\nuses the following defaults:\n\n    PGHOST=localhost\n    PGDATABASE=pqgo\n    PGUSER=pqgo\n    PGSSLMODE=disable\n    PGCONNECT_TIMEOUT=20\n\n`PQTEST_BINARY_PARAMETERS` can be used to add `binary_parameters=yes` to all\nconnection strings:\n\n    PQTEST_BINARY_PARAMETERS=1 go test\n\nTests can be run against pgbouncer with:\n\n    docker compose up -d pgbouncer pg18\n    PGPORT=6432 go test ./...\n\nand pgpool with:\n\n    docker compose up -d pgpool pg18\n    PGPORT=7432 go test ./...\n\nYou can use PQGO_DEBUG=1 to make the driver print the communication with\nPostgreSQL to stderr; this works anywhere (test or applications) and can be\nuseful to debug protocol problems.\n\nFor example:\n\n    % PQGO_DEBUG=1 go test -run TestSimpleQuery\n    CLIENT → Startup                 69  \"\\x00\\x03\\x00\\x00database\\x00pqgo\\x00user [..]\"\n    SERVER ← (R) AuthRequest          4  \"\\x00\\x00\\x00\\x00\"\n    SERVER ← (S) ParamStatus         19  \"in_hot_standby\\x00off\\x00\"\n    [..]\n    SERVER ← (Z) ReadyForQuery        1  \"I\"\n             START conn.query\n             START conn.simpleQuery\n    CLIENT → (Q) Query                9  \"select 1\\x00\"\n    SERVER ← (T) RowDescription      29  \"\\x00\\x01?column?\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x17\\x00\\x04\\xff\\xff\\xff\\xff\\x00\\x00\"\n    SERVER ← (D) DataRow              7  \"\\x00\\x01\\x00\\x00\\x00\\x011\"\n             END conn.simpleQuery\n             END conn.query\n    SERVER ← (C) CommandComplete      9  \"SELECT 1\\x00\"\n    SERVER ← (Z) ReadyForQuery        1  \"I\"\n    CLIENT → (X) Terminate            0  \"\"\n    PASS\n    ok      github.com/lib/pq       0.010s\n","funding_links":[],"categories":["数据库驱动","Go","开源类库","Database Drivers","Open source library","数据库驱动`连接和操作数据库工具`","Drivers","Relational Databases","Generators","数据库驱动程序","Compiled list","數據庫驅動","\u003cspan id=\"数据库驱动-database-drivers\"\u003e数据库驱动 Database Drivers\u003c/span\u003e","Language bindings","Data Integration Frameworks"],"sub_categories":["Advanced Console UIs","数据库","Relational Database Drivers","Database","SQL 查询语句构建库","Go","关系数据库驱动程序","plv8:","高級控制台界面","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e","高级控制台界面","Middlewares"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flib%2Fpq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flib%2Fpq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flib%2Fpq/lists"}