59 Commits

Author SHA1 Message Date
Brian Carlson
cd877a5761 Publish
- pg-bundler-test@0.0.1
 - pg-cloudflare@1.2.6
 - pg-connection-string@2.9.1
 - pg-cursor@2.15.1
 - pg-esm-test@1.2.1
 - pg-native@3.5.1
 - pg-pool@3.10.1
 - pg-protocol@1.10.1
 - pg-query-stream@4.10.1
 - pg@8.16.1
2025-06-18 10:46:26 -05:00
Joan Miquel Torres
14dc8dd100
Use performance.now() instead of Date.now()... (#3483)
* Use performance.now() instead of Date.now()...

  * Wherever applicable (measuring performance, not time).
  * Failback to support node < 16.0.0 (perf_hook not globally exposed)
  * Failback to Date.now() for node < 8.5.0

  ✔ Tests passed with node > 16.0.0 (22.12.0)
  ✕ Couldn't pass with node prior 16.0.0 but not due to this changes.

https://nodejs.org/docs/latest-v8.x/api/perf_hooks.html#perf_hooks_performance_now
https://w3c.github.io/hr-time/

* Yarn prettier

* More lint fixes.

* Removed polyfill code for node <16

They are no longer supported:

https://github.com/brianc/node-postgres/pull/3483#issuecomment-2967119692
2025-06-14 16:38:51 -05:00
Brian Carlson
abff18d6f9 Publish
- pg-connection-string@2.9.0
 - pg-cursor@2.15.0
 - pg-esm-test@1.2.0
 - pg-native@3.5.0
 - pg-pool@3.10.0
 - pg-protocol@1.10.0
 - pg-query-stream@4.10.0
 - pg@8.16.0
2025-05-12 11:49:59 -05:00
Davide Violante
f528433e9d
chore: minor eslint fixes, reenable no-unused vars (#3445) 2025-04-28 11:59:26 -05:00
Brian C
9e7a5d97cf
Replace all usages of var with let / const - eslint auto applied (#3444) 2025-04-27 11:50:33 -05:00
Brian Carlson
56e2862577 Publish
- pg-cloudflare@1.2.5
 - pg-connection-string@2.8.5
 - pg-cursor@2.14.5
 - pg-esm-test@1.1.5
 - pg-native@3.4.5
 - pg-pool@3.9.5
 - pg-protocol@1.9.5
 - pg-query-stream@4.9.5
 - pg@8.15.5
2025-04-23 13:48:25 -05:00
Brian Carlson
2919f28d31 Manually advance patch versions to re-align with lerna 2025-04-23 13:48:13 -05:00
Brian C
6ab0c4608c
More tests & exports from pg-protocol (#3436) 2025-04-23 13:22:31 -05:00
Brian Carlson
9ec9e5f58d Publish
- pg-cloudflare@1.2.0
 - pg-connection-string@2.8.0
 - pg-cursor@2.14.0
 - pg-esm-test@1.1.0
 - pg-native@3.4.0
 - pg-pool@3.9.0
 - pg-protocol@1.9.0
 - pg-query-stream@4.9.0
 - pg@8.15.0
2025-04-22 10:55:24 -05:00
Brian C
940479bc4b
Add esm exports (#3423)
* build: add esm exports

* fix: add defaults as per arethetypeswrong report

* fix: add missing types

* lint

* Fix broken tests

* Add (failing) test for esm compat

* Begin moving files to proper extension and adding tests

* Add tests for connection-string and fix cloudflare module type and esm compat

* Add query-stream and cursor as esm exports

* Update PR copilot review

* Publish

 - pg-cloudflare@1.1.2-alpha.0
 - pg-connection-string@2.7.1-alpha.0
 - pg-cursor@2.13.2-alpha.0
 - pg-esm-test@1.0.1-alpha.0
 - pg-native@3.3.1-alpha.0
 - pg-pool@3.8.1-alpha.0
 - pg-protocol@1.8.1-alpha.0
 - pg-query-stream@4.8.2-alpha.0
 - pg@8.14.2-alpha.0

* More cf compat work

* Publish

 - pg-cloudflare@1.1.2-alpha.1
 - pg-cursor@2.13.2-alpha.1
 - pg-esm-test@1.0.1-alpha.1
 - pg-pool@3.8.1-alpha.1
 - pg-query-stream@4.8.2-alpha.1
 - pg@8.14.2-alpha.1

* Add more cf compat and update tests

* Make tests pass - update exports for esm

* Use env vars for test connection in cf tests

* Fix lint

* Fit vitest into existing legacy framework

* Skip worker tests on node below 18

* Revert doc changes for now

* Remove legacy worker test in favor of vitest

---------

Co-authored-by: Luca Ban <mesqueeb@users.noreply.github.com>
2025-04-22 10:53:22 -05:00
Alex Anderson
9b510373a6
eslint: enable recommended ruleset (#3263) 2025-04-12 08:17:33 +00:00
Brian Carlson
f7c92e487c Publish
- pg-cursor@2.13.0
 - pg-native@3.3.0
 - pg-pool@3.8.0
 - pg-protocol@1.8.0
 - pg-query-stream@4.8.0
 - pg@8.14.0
2025-03-11 10:25:26 -05:00
Charmander
582cdaf919
Assorted test fixes and cleanup (#3383)
* test: Actually test split messages in split message parsing test

* cleanup: Fix spelling in tests

* test: Wait on asynchronous tests

* cleanup: Remove unused parameter from test method `BufferList#getByteLength`

If someone did want this functionality, it would be better to use addition separate from the method anyway.

* cleanup: Remove unused test function `BufferList.concat`
2025-02-13 09:42:33 -06:00
Brian Carlson
732580782f Publish
- pg-cursor@2.12.2
 - pg-native@3.2.1
 - pg-pool@3.7.1
 - pg-protocol@1.7.1
 - pg-query-stream@4.7.2
 - pg@8.13.2
2025-02-11 10:19:52 -06:00
Alexandre Weinberger
9fbcf17908
read dataTypeID and tableID as unsigned uint (#3347)
* read dataTypeID and tableID as unsigned uint

this is causing issues in other projects, like https://github.com/sequelize/sequelize/issues/15466

* added tests for oids larger than 2^31
2025-01-13 13:28:25 -06:00
Brian Carlson
92cb640fd3 Publish
- pg-connection-string@2.7.0
 - pg-cursor@2.12.0
 - pg-native@3.2.0
 - pg-pool@3.7.0
 - pg-protocol@1.7.0
 - pg-query-stream@4.7.0
 - pg@8.13.0
2024-09-17 10:08:42 -05:00
dependabot[bot]
54eb0fa216
Bump mocha and @types/mocha (#3273)
Bumps [mocha](https://github.com/mochajs/mocha) and [@types/mocha](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mocha). These dependencies needed to be updated together.

Updates `mocha` from 3.4.2 to 10.5.2
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/main/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v3.4.2...v10.5.2)

Updates `@types/mocha` from 5.2.7 to 10.0.7
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mocha)

---
updated-dependencies:
- dependency-name: mocha
  dependency-type: direct:development
  update-type: version-update:semver-major
- dependency-name: "@types/mocha"
  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-07-25 12:20:59 -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
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
2024-03-30 15:40:05 -05:00
Sehrope Sarkuni
b4bfd63f63
CI clean up to fix lint task and remove Windows / MacOS from matrix (#3122)
* Remove unused travis CI config

* Bump eslint and friends

* Fix lint errors after eslint upgrade

* Remove windows and macos from CI workflow as they are actually running linux

Removes the windows and macos matrix from the CI workflow as they were never actually setting
the OS. Both were running against the "ubuntu-latest" OS. Trying to actually use them would
not work either as neither windows or macos is supported for service containers. A different
means will be needed to test on those platforms. Until that's done, this removes those from
the matrix as we were simply running the same thing 3x for the same node versions.
2024-03-05 14:08:44 -06:00
Romain Gilliotte
b1a8947738
Fail gracefully when connecting to other database (#3026)
* Fail gracefully when connecting to other SGDB vendor

* Make test more flexible. Adjust error wording to match native better.

---------

Co-authored-by: Brian Carlson <brian.m.carlson@gmail.com>
2023-09-15 16:23:05 -05:00
Brian Carlson
20a243e8b3 Publish
- pg-cursor@2.8.0
 - pg-protocol@1.6.0
 - pg-query-stream@4.3.0
 - pg@8.9.0
2023-01-27 09:12:49 -06:00
Alex Anderson
5bcc05d1e9
pg-protocol: fix link to message format docs (#2835) 2022-10-06 09:59:11 -07:00
Brian M. Carlson
d459479382 Publish
- pg-connection-string@2.5.0
 - pg-cursor@2.6.0
 - pg-pool@3.3.0
 - pg-protocol@1.5.0
 - pg-query-stream@4.1.0
 - pg@8.6.0
2021-04-13 11:02:40 -05:00
Sven Over
6121bd3bb0
Add ParameterDescription message to pg-protocol (#2464) 2021-04-06 09:01:04 -05:00
Emily Marigold Klassen
45fa27ea4a
[pg-protocol] use literals instead of const enum (#2490)
Co-authored-by: Emily Marigold Klassen <forivall@users.noreply.github.com>
2021-03-12 11:01:51 -06:00
Emily Marigold Klassen
5a41a56862
Add missing metadata to package.jsons (#2487)
Co-authored-by: Emily Marigold Klassen <forivall@users.noreply.github.com>
2021-03-12 08:23:13 -06:00
Jumpaku
fae2c98870
Fix typo (#2444) 2021-01-19 23:24:44 +00:00
Brian M. Carlson
ec1dcab966 Publish
- pg-cursor@2.5.0
 - pg-protocol@1.4.0
 - pg-query-stream@3.4.0
 - pg@8.5.0
2020-11-10 11:01:03 -06:00
Brian C
07988f985a
Speed up bind functionality (#2286)
Move from 3 loops (prepareValue, check for buffers, write param types, write param values) to a single loop. This speeds up the insert benchmark by around 100 queries per second. Performance improvement depends on number of parameters being bound.
2020-11-04 08:27:40 -06:00
Marcin K
78a14a164d
feat(): pg-query-stream typescript (#2376)
* feat(): start converting pg-query stream

* feat(): solution project, initial version of typescript-pg-query stream

* chore(): mocha with typescript

* fix(): eslint ignore query stream dist

* refactor(pg-query-stream): convert test to ts

* chore(): fixed type errors

* chore(): fix helper usage

* chore(): use ts-node compatibile with node v8

* fix(): addd es extension

* chore(): remove emitClose and added compilation for async iterators

* chore(): condition for asyc iteration test

* chore(): rename class to match ts-defs

* chore(): tests to import from src instead of dist

* chore(): remove prettier from peer deps:

* chore(): update lock file
2020-11-03 11:17:49 -06:00
Brian M. Carlson
7ffe68eba0 Publish
- pg-connection-string@2.4.0
 - pg-cursor@2.4.0
 - pg-protocol@1.3.0
 - pg-query-stream@3.3.0
 - pg@8.4.0
2020-10-04 14:26:29 -05:00
Tom Carrio
58258430d5 Public export of DatabaseError
- Updated root exports of 'pg-protocol' to include DatabaseError

Ref: #2340
2020-10-04 13:33:49 -05:00
Brian M. Carlson
65156e7d24 Small readme updates & auto-formatting 2020-08-18 09:22:05 -05:00
Brian M. Carlson
dec892ed01 Publish
- pg-cursor@2.2.2
 - pg-protocol@1.2.5
 - pg-query-stream@3.1.2
 - pg@8.2.2
2020-07-07 08:58:57 -05:00
regevbr
1d3f155d4f
fix: major performance issues with bytea performance #2240 2020-07-03 17:57:07 +03:00
regevbr
bf53552a15
fix: major performance issues with bytea performance #2240 2020-07-03 17:53:22 +03:00
regevbr
64c78b0b0e
fix: major performance issues with bytea performance #2240 2020-07-03 17:52:26 +03:00
regevbr
5e0d684446
fix: major performance issues with bytea performance #2240 2020-06-20 10:51:29 +03:00
regevbr
89758cee2f
fix: major performance issues with bytea performance #2240 2020-06-19 03:39:06 +03:00
regevbr
316b119e63
fix: major performance issues with bytea performance #2240 2020-06-19 03:27:39 +03:00
regevbr
13ff0e11ed
fix: major performance issues with bytea performance #2240 2020-06-19 02:53:17 +03:00
regevbr
c31205f437
fix: major performance issues with bytea performance #2240 2020-06-19 02:32:00 +03:00
regevbr
0455504e22
fix: major performance issues with bytea performance #2240 2020-06-18 14:49:50 +03:00
Brian M. Carlson
f3136a7d5d Publish
- pg-connection-string@2.2.3
 - pg-cursor@2.2.1
 - pg-pool@3.2.1
 - pg-protocol@1.2.4
 - pg-query-stream@3.1.1
 - pg@8.2.1
2020-05-15 18:33:34 -05:00
Charmander
d8422552d1 Merge branch 'master' into normal-encoding-parameter 2020-05-13 23:59:39 -07:00
Charmander
bf40f03788 Send the client_encoding startup parameter value with more typical formatting
All non-alphanumerics are ignored, but `'utf-8'` is weird. `UTF8` is the canonical name, and is what libpq sends.
2020-05-13 23:56:20 -07:00
Brian M. Carlson
8404434279 Upgrade mocha 2020-05-13 11:49:37 -05:00
Brian M. Carlson
9e55a7073b Publish
- pg-cursor@2.2.0
 - pg-protocol@1.2.3
 - pg-query-stream@3.1.0
 - pg@8.2.0
2020-05-13 09:10:34 -05:00
Brian M. Carlson
72b5f6d669 Add test & fix packed packet parsing error for SASL authentication messages 2020-05-12 17:20:17 -05:00