2815 Commits

Author SHA1 Message Date
Brian C
3e4d545c20
Fix lint (#3262) 2024-06-19 09:45:52 -05:00
srieding
9baa56eaa2
feat: allow specifying a timeout on a per query base (#3074) 2024-06-19 09:36:35 -05:00
Herman J. Radtke III
b7d5b3b667
chore: add codeowners file (#3129)
This makes it clear who is maintaining which package. This will also
allow commit privileges for a specific package instead of the entire
repo.
2024-06-19 09:35:09 -05:00
Alex Anderson
4f457e12e0
Remove unused file: list-db-types (#3249)
Co-authored-by: alxndrsn <alxndrsn>
2024-06-19 09:32:52 -05:00
Brian C
53dc4e6cb3
Add test for date type (#3261) 2024-06-19 09:32:16 -05:00
Alex Anderson
83a0e3e90e
eslint: enable rule: @typescript-eslint/no-unused-vars (#3247)
When enabling this rule, it's recommended to also *disable* the standard `no-unused-vars` rule.  Although `no-unused-vars` is not currently enabled, it seems helpful to explicitly disable it here.

See: https://typescript-eslint.io/rules/no-unused-vars/

Co-authored-by: alxndrsn <alxndrsn>
2024-06-18 15:55:17 -05:00
Alex Anderson
a24a24dea1
test/connection/inbound-parser: remove unused vars (#3245)
Co-authored-by: alxndrsn <alxndrsn>
2024-06-05 11:00:26 -05:00
Alex Anderson
d650741eea
lib/client: remove no-op statement (#3240)
This looks like it was a refactoring of

  var connectionTimeoutHandle;

Co-authored-by: alxndrsn <alxndrsn>
2024-06-05 11:00:04 -05:00
Alex Anderson
d1548d6e77
docs/apis.result: fix typo (#3238)
Co-authored-by: alxndrsn <alxndrsn>
2024-06-05 10:59:45 -05:00
Alex Anderson
cc419341e8
CHANGELOG: fix typo (#3239)
Co-authored-by: alxndrsn <alxndrsn>
2024-06-05 10:59:25 -05:00
Alex Anderson
e4cb1cdc38
client/escape-tests: remove unused function (#3244)
Co-authored-by: alxndrsn <alxndrsn>
2024-06-05 10:51:56 -05:00
Alex Anderson
cd73e9bf86
pg-native/test: remove unused "done" arg from describe() calls (#3242)
Co-authored-by: alxndrsn <alxndrsn>
2024-06-05 10:51:34 -05:00
Alex Anderson
f2279f3529
pg-connection-string/test: remove unused var (#3243)
Co-authored-by: alxndrsn <alxndrsn>
2024-06-05 10:51:13 -05:00
Alex Anderson
1625861981
Remove unused imports (#3241)
* Remove unused imports

* reinstate test helper

---------

Co-authored-by: alxndrsn <alxndrsn>
2024-06-05 10:50:52 -05:00
Alex Anderson
6e96e45bae
test/type-coercion: fix typo in test title (#3237)
`timestamptz` was written `timestampz`

Co-authored-by: alxndrsn <alxndrsn>
2024-06-05 10:50:16 -05:00
Alex Anderson
ba07d19459
docs: fix typos in announcements (#3236)
Co-authored-by: alxndrsn <alxndrsn>
2024-06-05 10:49:28 -05:00
Brian C
f41afdafe6
Add pg-native link to monorepo readme (#3235)
Should add it here, I suppose, for consistency.
2024-06-04 12:46:17 -05:00
Brendan Irvine-Broque
5c846ca06e
Clarify usage and update readme (#3114)
refs https://github.com/Ethan-Arrowood/socket/pull/17

@petebacondarwin @brianc — publishing `pg-cloudflare` as a separate package seems to be really helpful to people. Ex:

https://github.com/sidorares/node-mysql2/pull/2289/files#diff-e56fabfb5e90fd8f6265cfbe84f3701a85261d884e198bf61de34958cee4864aR12

Added some docs to clarify usage, and cross link to the Node.js implementation of the Socket API.

Co-authored-by: Brian Carlson <brian.m.carlson@gmail.com>
2024-06-04 11:49:30 -05:00
Brian C
7fcf941a33
Improve race condition in pg-native cancel test (#3234) 2024-06-04 11:39:52 -05:00
Brian Carlson
b3f0dddbcf Update changelog 2024-06-04 11:21:07 -05:00
Brian Carlson
0f42880861 Publish
- pg-cursor@2.11.0
 - pg-native@3.1.0
 - pg-query-stream@4.6.0
 - pg@8.12.0
pg-cursor@2.11.0 pg-native@3.1.0 pg-query-stream@4.6.0 pg@8.12.0
2024-06-04 11:19:08 -05:00
Alex Anderson
ff47a97f28
Add option to force use of Extended Queries (#3214)
This feature can be used as follows:

```
client.query({ text: 'SELECT 1', queryMode: 'extended' })
```

This will force the query to be sent with parse/bind/execute even when it has no parameters and disallows multiple statements being executed.  This can be useful in scenarios where you want to enforce more security & help prevent sql injection attacks...particularly by library authors.

---------

Co-authored-by: alxndrsn <alxndrsn>
Co-authored-by: Brian Carlson <brian.m.carlson@gmail.com>
2024-06-04 11:14:04 -05:00
Brian C
fe88e825e5
Add pg-native to monorepo (#3225)
I didn't do much to "modernize" the pg-native codebase other than running it through the standard eslint --fix that is applied to the rest of the code. There's some easy opportunities there to update it to es6 and so on...it still uses some pretty antiquated coding styles in places.  This PR re-introduces the native tests on node v20, and updates test matrix to drop unsupported versions of node & add in node v22.
2024-06-04 10:26:11 -05:00
dependabot[bot]
46156956e2
Bump workerd from 1.20240329.0 to 1.20240529.0 (#3227)
Bumps [workerd](https://github.com/cloudflare/workerd) from 1.20240329.0 to 1.20240529.0.
- [Release notes](https://github.com/cloudflare/workerd/releases)
- [Changelog](https://github.com/cloudflare/workerd/blob/main/RELEASE.md)
- [Commits](https://github.com/cloudflare/workerd/compare/v1.20240329.0...v1.20240529.0)

---
updated-dependencies:
- dependency-name: workerd
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-04 09:36:29 -05:00
dependabot[bot]
988314ae00
Bump eslint-plugin-promise from 6.0.1 to 6.2.0 (#3229)
Bumps [eslint-plugin-promise](https://github.com/eslint-community/eslint-plugin-promise) from 6.0.1 to 6.2.0.
- [Release notes](https://github.com/eslint-community/eslint-plugin-promise/releases)
- [Changelog](https://github.com/eslint-community/eslint-plugin-promise/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint-community/eslint-plugin-promise/compare/v6.0.1...v6.2.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-promise
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-01 22:45:16 -05:00
Alex Anderson
e25428c8dc
eslint: use cache (#3218)
This significantly speeds up eslint after first run.

Co-authored-by: alxndrsn <alxndrsn>
2024-05-16 11:32:41 -05:00
Wes Lord
81e2ff0524
Update reference in docs from done to release (#3211) 2024-05-15 17:04:16 -05:00
Brian C
0cebc513e3
Add tea contract (#3216) 2024-05-15 17:00:11 -05:00
Juan GP
0096856e2e
reorder user-password-host-port-database appearences (#3207) 2024-05-10 12:03:11 -05:00
dependabot[bot]
13ec7d106e
Bump @typescript-eslint/eslint-plugin from 6.17.0 to 7.0.0 (#3205)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.17.0 to 7.0.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.0.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-02 12:20:50 -05:00
Joan Miquel Torres
c3bd279953
Documented lock_timeout in client.mdx (#3199)
Added 'lock_timeout' option in Config object documentation since it's explicitly declared in node-postgres (packages/pg/lib/connection-parameters.js)

I also checked it works as documented in PostgreSQL Docs:

https://www.postgresql.org/docs/current/runtime-config-client.html#GUC-LOCK-TIMEOUT
2024-04-30 09:49:39 -05:00
Italo A
3cde785e38
Update queries.mdx link to markdown (#3192)
If we use `<a>` here, the template does not visually identify it as a link, so I have switched to the markdown link format.
2024-04-05 18:07:31 -07:00
Brian C
408bebd990
Fix import syntax for commonJS in documentation (#3191) 2024-04-05 16:48:44 -05:00
dependabot[bot]
68171dd00f
Bump eslint-config-prettier from 8.5.0 to 9.1.0 (#3185)
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 8.5.0 to 9.1.0.
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v8.5.0...v9.1.0)

---
updated-dependencies:
- dependency-name: eslint-config-prettier
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-02 18:00:26 -05:00
Brian Carlson
a37a93bf79 Publish
- pg-connection-string@2.6.4
 - pg-cursor@2.10.5
 - pg-query-stream@4.5.5
 - pg@8.11.5
pg-connection-string@2.6.4 pg-cursor@2.10.5 pg-query-stream@4.5.5 pg@8.11.5
2024-04-02 15:26:02 -05:00
Brian C
95655fea0b
Revert "fix: conflict between browser URL object and Node URL object (#3061)" (#3188)
This reverts commit d21cc09556899b8038ec23613a801c19228637ca.
2024-04-02 15:23:53 -05:00
dependabot[bot]
ef24134a5a
Bump workerd from 1.20231030.0 to 1.20240329.0 (#3182)
Bumps [workerd](https://github.com/cloudflare/workerd) from 1.20231030.0 to 1.20240329.0.
- [Release notes](https://github.com/cloudflare/workerd/releases)
- [Changelog](https://github.com/cloudflare/workerd/blob/main/RELEASE.md)
- [Commits](https://github.com/cloudflare/workerd/compare/v1.20231030.0...v1.20240329.0)

---
updated-dependencies:
- dependency-name: workerd
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-01 11:19:30 -05:00
dependabot[bot]
50dbcd2453
Bump eslint from 8.56.0 to 8.57.0 (#3183)
Bumps [eslint](https://github.com/eslint/eslint) from 8.56.0 to 8.57.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.56.0...v8.57.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-01 11:17:21 -05:00
Brian Carlson
b03c071d2d Publish
- pg-connection-string@2.6.3
 - pg-cursor@2.10.4
 - pg-pool@3.6.2
 - pg-protocol@1.6.1
 - pg-query-stream@4.5.4
 - pg@8.11.4
pg-connection-string@2.6.3 pg-cursor@2.10.4 pg-pool@3.6.2 pg-protocol@1.6.1 pg-query-stream@4.5.4 pg@8.11.4
2024-03-30 15:40:05 -05:00
Charmander
5807a00d93
Remove unused protocol-related dependencies from pg (#3181)
buffer-writer was replaced with pg-protocol in 3ff91eaa3222657fd51ea463b8086d134a505404, and packet-reader in 520bd3531990f32c3e00b20020c67f6ac6c70261.
2024-03-29 21:35:50 -05:00
Alex Anderson
2ab6f367c0
query: remove unused prop: isPreparedStatement (#3177)
Use of this property was removed in 2020 (dd3ce616d0fbdb92a7e146ecf4171bf3c1b3ea97).

Co-authored-by: alxndrsn <alxndrsn>
2024-03-28 10:28:30 -05:00
Alex Anderson
b400d33c33
query: remove unused prop: _promise (#3178)
Use of this prop was probably removed in 2017 (a0eb36d81938e488b3bc5369faee74fe22f36949).

Co-authored-by: alxndrsn <alxndrsn>
2024-03-28 10:26:00 -05:00
Alex Anderson
91de4b9453
Cursor: avoid closing connection twice if error received after destroy() (#2836)
* Cursor: avoid closing connection twice if error received after destroy()

Includes test case from @nathanjcochran

* Resolve lint violations

* revert fix to check tests fail without it

* Re-introdce fix

This reverts commit 5f5d42a071e40f8851035dba182642937dd35664.

---------

Co-authored-by: alxndrsn <alxndrsn>
2024-03-15 12:26:25 -05:00
Alex Anderson
ebba3d812f
ci: don't fail fast (#3173)
This allows all matrix builds to run, making it easier to understand if a given
failure is specific to nodejs version(s), or more general.

Co-authored-by: alxndrsn <alxndrsn>
2024-03-15 12:08:03 -05:00
Alex Anderson
a717c00b7b
chore (ci): add node v20 to build matrix (#3148)
* chore (ci): add node v20 to build matrix

* skip pg-native tests on node 20

---------

Co-authored-by: alxndrsn <alxndrsn>
2024-03-15 12:05:15 -05:00
Jakob Runge
aedae81c75
Fix broken link in docs (#3155)
* Fix broken link to /apis/types in docs

* Adjust slugs in docs pages
2024-03-14 22:54:57 -07:00
Alex Anderson
641ab436a0
ci: add build timeouts (#3172)
This should prevent runaway builds.

I noticed this issue when working on a fork of https://github.com/brianc/node-postgres/pull/2836.  Example builds with/without these timeouts:

1. 6 hours: https://github.com/alxndrsn/node-postgres/actions/runs/8277192701
2. 10 minutes: https://github.com/alxndrsn/node-postgres/actions/runs/8277388503

These timeouts are 4-5x what a current healthy build takes.
2024-03-14 22:53:08 -07:00
Alex Anderson
1481f8d1f4
ci: yarn: freeze lockfile (#3171)
This should highlight when the yarn.lock file is out of sync with package.json.

From the docs:

> If you need reproducible dependencies, which is usually the case with the continuous integration systems, you should pass --frozen-lockfile flag.
> - https://classic.yarnpkg.com/lang/en/docs/cli/install/
2024-03-14 22:49:33 -07:00
Alex Anderson
119078230e
chore (ci): upgrade github actions to use node 20 (#3149)
Fixes:

> Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3, actions/setup-node@v3. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.

Co-authored-by: alxndrsn <alxndrsn>
2024-03-13 12:45:42 -05:00
Matthew Richmond
0ee010e5a0
Update project-structure.md (#3166)
Small path update
2024-03-13 12:42:59 -05:00