{"id":13683584,"url":"https://github.com/musicglue/pg-ts","last_synced_at":"2025-10-23T19:42:59.945Z","repository":{"id":57322669,"uuid":"91326499","full_name":"musicglue/pg-ts","owner":"musicglue","description":"Typescript wrapper around node-postgres","archived":false,"fork":false,"pushed_at":"2020-07-15T20:39:58.000Z","size":491,"stargazers_count":16,"open_issues_count":0,"forks_count":5,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-02-01T02:33:50.269Z","etag":null,"topics":["node-postgres","nodejs","pgsql","postgresql","typescript"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/musicglue.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":"2017-05-15T10:41:43.000Z","updated_at":"2024-02-20T22:48:03.000Z","dependencies_parsed_at":"2022-08-26T01:11:23.380Z","dependency_job_id":null,"html_url":"https://github.com/musicglue/pg-ts","commit_stats":null,"previous_names":[],"tags_count":44,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/musicglue%2Fpg-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/musicglue%2Fpg-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/musicglue%2Fpg-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/musicglue%2Fpg-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/musicglue","download_url":"https://codeload.github.com/musicglue/pg-ts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238445830,"owners_count":19473820,"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":["node-postgres","nodejs","pgsql","postgresql","typescript"],"created_at":"2024-08-02T13:02:16.545Z","updated_at":"2025-10-23T19:42:59.858Z","avatar_url":"https://github.com/musicglue.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# pg-ts\nTypescript wrapper around node-postgres\n\n:boom: breaking change\n:rocket: new feature\n:bug: bug fix\n:wrench: chore\n:notebook: docs\n\n## v10.0.0\n\n- :wrench: Dependency updates\n\n#### v9.0.3\n- :wrench: improve PgDriverQueryError message\n\n#### v9.0.2\n- :bug: If a `queryOneOrNone` was executed with SQL that selected insufficient columns to fully\n  populate the row type, it would erroneously return `None`. Fixed now to return the expected\n  `PgRowValidationError` type.\n\n#### v9.0.1\n- :bug: Prevent array positional parameters from being deduped.\n\n## v9.0.0\n- :boom: An additional `context` param has been added to `connection.query` and `queryX`\n  functions. This is a blob of data that will be attached to query and transaction error instances.\n  The normal use case for this is attaching application context so that error reporting functions\n  can group errors together, or log out additional information about where the error came from.\n\n### v8.1.0\n- :rocket: Add `named` function to set the name of a given `SQL`-templated query.\n\n### v8.0.1\n- :bug: Sql fragment parser should unwrap complex types (e.g. NonEmptyArray, Option) before\n  passing it to the driver.\n\n## v8.0.0\n- :bug: Fix broken nominal typing on classes by changing `public readonly _T = \"\u003cclass name\u003e\"`\n  to `public readonly _\u003cclass name\u003e: void`.\n- :boom: As a result of fixing nominal typing, `makeConnectionPool` now returns an error union\n  of `PgPoolCreationError | PgTypeParserSetupError` instead of `PgPoolCreationError`. Other errors\n  may occur in application code as a result of the error classes now being correctly differentiated.\n\n## v7.0.0\n- :boom: `fp-ts@1.8.0`\n- :boom: `io-ts@1.3.0`\n- :boom: `monocle-ts@1.2.0`\n\n### v6.0.1\n- :wrench: Add _T symbol to uniquely identify error classes\n\n## v6.0.0\n- :boom: Simplified the API by always requiring an environment object in which pg-ts can\n  store it's state (`Connection`) under a `Symbol` key. This will never conflict with other\n  keys in the `E`, so we can now remove `ConnectionE` and related subsequent design decisions.\n\n### v5.0.1\n- :bug: `QueryAnyError` union included `PgRowCountError`. This is incorrect (obvs).\n- :wrench: Compiled with TS3.0.1.\n\n## v5.0.0\n- `Either`ish functions no longer return a simple `Error` type in their `Left`s. Instead, we now\n  provide a union of concrete error types that make it explicit what the failure conditions are.\n  Clients can pattern match on error type using the provided `ErrorPredicate` functions, e.g,\n  `isRowCountError`. Application-defined error types are propagated through the `pg-ts` stack.\n- Commonly-grouped errors are provided as unions, e.g. `ConnectionError\u003cL\u003e`, `TransactionError\u003cL\u003e`.\n- Renamed `withConnectionE` to `widenToConnectionE` for clarity and to differentiate from the\n  `withConnectionE` function defined on `Connection`.\n- `withTransaction` has been replaced by three similar functions that assist you depending on\n   whether you want to go from:\n\n     | Outer Context    | Inner Context    | Function to use     |\n     |------------------|------------------|---------------------|\n     | `Connection`     | `Connection`     | `withTransactionC`  |\n     | `ConnectionE\u003cE\u003e` | `ConnectionE\u003cE\u003e` | `withTransactionE`  |\n     | `ConnectionE\u003cE\u003e` | `Connection`     | `withTransactionEC` |\n\n- Fixed the `types` setting in package.json, so imports should now default to `from \"pg-ts\"`\n  instead of `from \"pg-ts/dist\"`.\n- Integration tests are provided. A `DATABASE_URL` environment variable must be present. The test\n  suite will create the table it needs and will truncate before each test. Every query type is\n  tested and transaction commit/rollback behaviour is also verified.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmusicglue%2Fpg-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmusicglue%2Fpg-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmusicglue%2Fpg-ts/lists"}