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
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
Akash
2a8efbee09
Minor typo correction ( #3135 )
2024-02-09 21:27:50 -08:00
Shane da Silva
81c287a49b
Serialize arrays of Uint8Array objects as hex escape sequences ( #2930 )
...
Previously, if you attempted to pass an array of `Uint8Array` objects to
a prepared statement, it would render each literal numeric value of that
array.
Since `Uint8Array` (and `TypedArray` types) represent views over raw
bytes, ensure these are serialized to Postgres as a byte representation.
2024-02-09 21:25:41 -08:00
Tunçer Damat
df0f4d19fb
Correction of the "e" variable to "err" in snippet ( #3123 )
2024-01-10 08:22:00 -08:00
FB
6cd0aeb212
Uppercase LTS in docs home page ( #3103 )
...
Changed 'lts' to 'LTS' for better readability, so people get it stands for Long-Term-Support
2023-11-29 22:52:36 -08:00
dependabot[bot]
9c3ecdca69
Bump prettier from 2.8.8 to 3.0.3 ( #3054 )
...
Bumps [prettier](https://github.com/prettier/prettier ) from 2.8.8 to 3.0.3.
- [Release notes](https://github.com/prettier/prettier/releases )
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md )
- [Commits](https://github.com/prettier/prettier/compare/2.8.8...3.0.3 )
---
updated-dependencies:
- dependency-name: 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>
2023-11-19 17:06:13 -06:00
dependabot[bot]
5164959d20
Bump workerd from 1.20230724.0 to 1.20231030.0 ( #3088 )
...
Bumps [workerd](https://github.com/cloudflare/workerd ) from 1.20230724.0 to 1.20231030.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.20230724.0...v1.20231030.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>
2023-11-19 17:06:04 -06:00
Kyle Gray
a733b40f99
docs: Link to current PostgreSQL data types page ( #3097 )
...
The data types link pointed at PostgreSQL 9.5. Update the link to always point to the latest version of PostgreSQL.
2023-11-19 17:05:44 -06:00
Alex Anderson
e8259e04fc
ci: add lint job ( #3079 )
...
* ci: add lint job
* rebuild
* Revert "rebuild"
This reverts commit d330184140b64661027b634511bc5a8eb874a5ce.
* mad debugging
* wtf
* add eslintignore
* remove git status
---------
Co-authored-by: alxndrsn <alxndrsn>
2023-10-19 14:24:22 -05:00
Alex Anderson
16322c2d50
Fix eslint violations ( #3078 )
...
Co-authored-by: alxndrsn <alxndrsn>
2023-10-19 10:27:25 -05:00
Alex Anderson
b9a528cb3b
eslintrc: update prettier base config ( #3077 )
...
Co-authored-by: alxndrsn <alxndrsn>
2023-10-19 10:27:11 -05: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
Sebastien Stettler
d21cc09556
fix: conflict between browser URL object and Node URL object ( #3061 )
...
I am running this package using electron, what i noticed was that due to
the fact that the lines between node and browser environments become a
bit blurred, the URL class that was being used was the one defined by
the browser and not node. By making an explicit require it ensures the
correct Class is used.
While creating a test for this would be difficuilt i think adding an
eslint rule to stop using globally defined objects and require imports
instead would resolve issues like this in the future
2023-09-15 16:22:18 -05:00
Brian C
da0f5c5eb2
Remove 1 loop on rowDescription event ( #3056 )
...
* Remove 1 loop on rowDescription event
* Update packages/pg/lib/result.js
Co-authored-by: Charmander <~@charmander.me>
---------
Co-authored-by: Charmander <~@charmander.me>
2023-09-15 16:21:45 -05:00
Sehrope Sarkuni
106ca8a178
Fix get value of last column with same name in result rows ( #3063 )
...
* Add failing test for result rows with the same column names
* Fix handling of duplicate column names in results to ensure last value is populated
Fixes handling of result rows that have the same column name duplicated in the results to ensure
that the last value is the one returned to the user. This was the old behavior but unintentionally
broken when the pre-built object optimization was added.
2023-09-14 14:43:14 -05:00
Brian Carlson
a84ebb3fe8
Publish
...
- pg-cursor@2.10.3
- pg-query-stream@4.5.3
- pg@8.11.3
pg-cursor@2.10.3
pg-query-stream@4.5.3
pg@8.11.3
2023-08-16 16:50:05 -07:00
Koen
b5c5e52aa0
Option to use pre-shaped result rows; fixes #3042 ( #3043 )
...
* Add property usePrebuiltEmptyResultObjects to Query constructor which generates pre-shaped result rows
* Remove option and test for prebuiltEmptyResultObject
* Remove errorneously added newline
* Move all logic for prebuilding objects to Result
* Move prebuilding to addFields
* Use a clone as clone-base
---------
Co-authored-by: HZ111 / Dev2 <hz111@wielick.nl>
2023-08-15 08:42:54 -07:00
dependabot[bot]
58865b2c04
Bump workerd from 1.20230518.0 to 1.20230724.0 ( #3036 )
...
Bumps [workerd](https://github.com/cloudflare/workerd ) from 1.20230518.0 to 1.20230724.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.20230518.0...v1.20230724.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>
2023-08-12 08:52:37 -07:00
Brian Carlson
a2a355a680
Publish
...
- pg-connection-string@2.6.2
- pg-cursor@2.10.2
- pg-query-stream@4.5.2
- pg@8.11.2
pg-connection-string@2.6.2
pg-cursor@2.10.2
pg-query-stream@4.5.2
pg@8.11.2
2023-07-31 22:36:33 -05:00
Rafi Shamim
cf24ef28ee
pg-connection-string: avoid clobbering port from queryparams ( #2833 )
...
If the connection string is something like:
postgresql://demo:password@/postgres?host=localhost&port=26258
Then the port from the query parameters should be used. Previously, the
parsing function would end up with a null port, and the default port
would end up being used by the connecetion package.
2023-07-21 11:57:02 -05:00
Ben Reinhart
3644730d2b
Remove early return for non commonjs environments ( #3033 )
2023-07-18 19:01:07 -05:00
Riku Rauhala
970804b6c1
Update pg-connection-string url in connecting.mdx ( #3005 )
2023-07-07 17:47:35 -05:00
dependabot[bot]
8d211e2be8
Bump workerd from 1.20230419.0 to 1.20230518.0 ( #3023 )
...
Bumps [workerd](https://github.com/cloudflare/workerd ) from 1.20230419.0 to 1.20230518.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.20230419.0...v1.20230518.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>
2023-07-07 17:47:09 -05:00
dependabot[bot]
d17da9e1d9
Bump prettier from 2.7.1 to 2.8.8 ( #3024 )
...
Bumps [prettier](https://github.com/prettier/prettier ) from 2.7.1 to 2.8.8.
- [Release notes](https://github.com/prettier/prettier/releases )
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md )
- [Commits](https://github.com/prettier/prettier/compare/2.7.1...2.8.8 )
---
updated-dependencies:
- dependency-name: prettier
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>
2023-07-07 17:47:00 -05:00
Brian Carlson
eaafac36dc
Publish
...
- pg-cloudflare@1.1.1
- pg-connection-string@2.6.1
- pg-cursor@2.10.1
- pg-pool@3.6.1
- pg-query-stream@4.5.1
- pg@8.11.1
pg-cloudflare@1.1.1
pg-connection-string@2.6.1
pg-cursor@2.10.1
pg-pool@3.6.1
pg-query-stream@4.5.1
pg@8.11.1
2023-06-26 11:36:32 -05:00
Arian Mirahmadi
735683c5cb
Fix typo in project-structure.md ( #3008 )
2023-06-13 14:22:04 -07:00
Filipe Correa
46cfb25baf
Remove await from client release ( #3006 )
...
Co-authored-by: Filipe Correa <f.avelino-correa@klarna.com>
2023-06-12 12:50:40 -07:00
Riku Rauhala
e2d8fa2dc2
Fix a typo in README.md ( #3002 )
...
Change finanical to financial
2023-06-05 21:01:47 +00:00
Jason Ford
4dbf1af069
Add note about case sensitivity of result of pg.escapeIdentifier ( #2993 )
2023-06-01 01:03:50 -05:00
phiresky
d59cd15ed2
fix stack traces of query() to include the async context ( #1762 ) ( #2983 )
...
* fix stack traces of query() to include the async context (#1762 )
* rename tests so they are actually run
* conditionally only run async stack trace tests on node 16+
* add stack trace to pg-native
---------
Co-authored-by: Charmander <~@charmander.me>
2023-05-31 11:28:53 -05:00
Pete Bacon Darwin
0dfd955be5
fix: ensure that pg-cloudflare can be used with bundlers that don't know about Cloudflare sockets ( #2978 )
...
By implementing package.json `exports` we can avoid processing the Cloudflare
specific code, which contains `import ... from "cloudflare:sockets"`, in bundlers such
as Webpack.
If you are bundling for a Worker environment using Webpack then you need to add the
`workerd` condition and ignore `cloudflare:sockets` imports:
**webpack.config.js**
```js
resolve: { conditionNames: ["require", "node", "workerd"] },
plugins: [
new webpack.IgnorePlugin({
resourceRegExp: /^cloudflare:sockets$/,
}),
],
```
2023-05-31 11:25:56 -05:00
Rijk van Zanten
20d2c08027
Make async/await the primary examples in the docs ( #2932 )
...
* Correctly capitalize GitHub
* Add note on callbacks to index
* Add note on error handling
* Update client examples to use promises
* Update pooling examples
* Fix readme link
* Update cursor docs
* Update connecting examples
* Update Queries
* Update examples in pooling
* Update trx examples
* Update SSL example
* Update example
* Use ESM instead of CJS
* Update docs/pages/apis/cursor.mdx
Co-authored-by: Charmander <~@charmander.me>
* Update docs/pages/apis/cursor.mdx
Co-authored-by: Charmander <~@charmander.me>
* Update docs/pages/apis/pool.mdx
Co-authored-by: Charmander <~@charmander.me>
* Update docs/pages/apis/pool.mdx
Co-authored-by: Charmander <~@charmander.me>
* Update docs/pages/apis/pool.mdx
Co-authored-by: Charmander <~@charmander.me>
* Update docs/pages/features/connecting.mdx
Co-authored-by: Charmander <~@charmander.me>
* Update docs/pages/features/connecting.mdx
Co-authored-by: Charmander <~@charmander.me>
* Update docs/pages/features/ssl.mdx
Co-authored-by: Charmander <~@charmander.me>
---------
Co-authored-by: Charmander <~@charmander.me>
2023-05-31 11:25:24 -05:00
Novikov Evgeniy
dee3ae5cd6
feat: add connection parameter nativeConnectionString ( #2941 )
...
Co-authored-by: Evgeniy Novikov <e.p.novikov@tinkoff.ru>
2023-05-31 11:16:36 -05:00
Adam Jones
c38ecf3405
Fix connection string parsing for overriden hosts ( #2977 )
...
* Add failing test
* Fix test
This corresponds to what was line 48 previously, see https://github.com/brianc/node-postgres/pull/2971/files#diff-08a5e82487ebd9b43751630019753901fae0a111f8d009ad2e9d194445e96922L48
* Update packages/pg-connection-string/index.js
Co-authored-by: Pete Bacon Darwin <pete@bacondarwin.com>
---------
Co-authored-by: Brian C <brian.m.carlson@gmail.com>
Co-authored-by: Pete Bacon Darwin <pete@bacondarwin.com>
2023-05-31 10:24:08 -05:00
Shane
65406985b9
Fix typo in types.mdx ( #2989 )
2023-05-29 12:07:05 -07:00
Charmander
3039f1da77
Revert "Update utils.js ( #2981 )"
...
This reverts commit 522e2dcb76f92d0096177b10204bdc385375020d.
2023-05-23 08:42:54 +00:00
sudarshanvn
522e2dcb76
Update utils.js ( #2981 )
...
Fixed following error
ReferenceError: TextEncoder is not defined
2023-05-19 16:53:52 -05:00
Brian Carlson
14b840e96e
Publish
...
- pg-cloudflare@1.1.0
- pg-connection-string@2.6.0
- pg-cursor@2.10.0
- pg-query-stream@4.5.0
- pg@8.11.0
pg-cloudflare@1.1.0
pg-connection-string@2.6.0
pg-cursor@2.10.0
pg-query-stream@4.5.0
pg@8.11.0
2023-05-15 10:36:31 -05:00
Pete Bacon Darwin
f2062936b9
Clean up pg-native in Makefile better
2023-05-15 07:29:07 +01:00
Pete Bacon Darwin
7152d4db5d
Add example Cloudflare Worker and test
2023-05-15 07:29:07 +01:00
Pete Bacon Darwin
07553428e9
Add Cloudflare Worker compatible socket
2023-05-15 07:29:07 +01:00
Pete Bacon Darwin
5532ca51db
Use WebCrypto APIs where possible
...
The only place we are stuck with node's original crypto API
is for generating md5 hashes, which are not supported by WebCrypto.
2023-05-15 07:29:07 +01:00
Pete Bacon Darwin
2b469d01da
avoid accessing Node specific requires when not needed
2023-05-15 07:29:07 +01:00
Pete Bacon Darwin
f305419676
Use URL rather than url.parse() in pg-connection-string
...
Swapping the deprecated Node.js API for the modern cross
environment API.
2023-05-15 07:29:07 +01:00