Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: brianc/node-postgres
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3ac356a812f473ad1f0a748b662524f9b7913583
Choose a base ref
...
head repository: brianc/node-postgres
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7ffe68eba056b9a6d0fa88f928aa85e768c28838
Choose a head ref
Loading
Showing with 19,015 additions and 4,379 deletions.
  1. +73 −0 .devcontainer/Dockerfile
  2. +31 −0 .devcontainer/devcontainer.json
  3. +44 −0 .devcontainer/docker-compose.yml
  4. +12 −3 .eslintrc
  5. +3 −0 .github/FUNDING.yml
  6. +4 −0 .gitignore
  7. +0 −8 .npmignore
  8. +51 −28 .travis.yml
  9. +158 −21 CHANGELOG.md
  10. +1 −1 LICENSE
  11. +67 −44 README.md
  12. +21 −1 SPONSORS.md
  13. +12 −0 lerna.json
  14. +0 −419 lib/client.js
  15. +0 −119 lib/connection-parameters.js
  16. +0 −654 lib/connection.js
  17. +0 −57 lib/index.js
  18. +0 −232 lib/query.js
  19. +0 −104 lib/result.js
  20. +29 −41 package.json
  21. +2 −0 packages/pg-connection-string/.coveralls.yml
  22. +26 −0 packages/pg-connection-string/.gitignore
  23. +6 −0 packages/pg-connection-string/.travis.yml
  24. +21 −0 packages/pg-connection-string/LICENSE
  25. +72 −0 packages/pg-connection-string/README.md
  26. +15 −0 packages/pg-connection-string/index.d.ts
  27. +106 −0 packages/pg-connection-string/index.js
  28. +38 −0 packages/pg-connection-string/package.json
  29. +1 −0 packages/pg-connection-string/test/example.ca
  30. +1 −0 packages/pg-connection-string/test/example.cert
  31. +1 −0 packages/pg-connection-string/test/example.key
  32. +320 −0 packages/pg-connection-string/test/parse.js
  33. +37 −0 packages/pg-cursor/README.md
  34. +218 −0 packages/pg-cursor/index.js
  35. +22 −0 packages/pg-cursor/package.json
  36. +54 −0 packages/pg-cursor/test/close.js
  37. +86 −0 packages/pg-cursor/test/error-handling.js
  38. +181 −0 packages/pg-cursor/test/index.js
  39. +3 −0 packages/pg-cursor/test/mocha.opts
  40. +34 −0 packages/pg-cursor/test/no-data-handling.js
  41. +107 −0 packages/pg-cursor/test/pool.js
  42. +35 −0 packages/pg-cursor/test/query-config.js
  43. +43 −0 packages/pg-cursor/test/transactions.js
  44. +21 −0 packages/pg-pool/LICENSE
  45. +376 −0 packages/pg-pool/README.md
  46. +403 −0 packages/pg-pool/index.js
  47. +39 −0 packages/pg-pool/package.json
  48. +42 −0 packages/pg-pool/test/bring-your-own-promise.js
  49. +29 −0 packages/pg-pool/test/connection-strings.js
  50. +229 −0 packages/pg-pool/test/connection-timeout.js
  51. +40 −0 packages/pg-pool/test/ending.js
  52. +260 −0 packages/pg-pool/test/error-handling.js
  53. +86 −0 packages/pg-pool/test/events.js
  54. +87 −0 packages/pg-pool/test/idle-timeout.js
  55. +226 −0 packages/pg-pool/test/index.js
  56. +20 −0 packages/pg-pool/test/logging.js
  57. +98 −0 packages/pg-pool/test/max-uses.js
  58. +54 −0 packages/pg-pool/test/releasing-clients.js
  59. +10 −0 packages/pg-pool/test/setup.js
  60. +58 −0 packages/pg-pool/test/sizing.js
  61. +19 −0 packages/pg-pool/test/submittable.js
  62. 0 packages/pg-pool/test/timeout.js
  63. +25 −0 packages/pg-pool/test/verify.js
  64. +3 −0 packages/pg-protocol/README.md
  65. +25 −0 packages/pg-protocol/package.json
  66. +28 −0 packages/pg-protocol/src/b.ts
  67. +53 −0 packages/pg-protocol/src/buffer-reader.ts
  68. +85 −0 packages/pg-protocol/src/buffer-writer.ts
  69. +522 −0 packages/pg-protocol/src/inbound-parser.test.ts
  70. +11 −0 packages/pg-protocol/src/index.ts
  71. +222 −0 packages/pg-protocol/src/messages.ts
  72. +243 −0 packages/pg-protocol/src/outbound-serializer.test.ts
  73. +377 −0 packages/pg-protocol/src/parser.ts
  74. +264 −0 packages/pg-protocol/src/serializer.ts
  75. +75 −0 packages/pg-protocol/src/testing/buffer-list.ts
  76. +156 −0 packages/pg-protocol/src/testing/test-buffers.ts
  77. +1 −0 packages/pg-protocol/src/types/chunky.d.ts
  78. +24 −0 packages/pg-protocol/tsconfig.json
  79. +9 −0 packages/pg-query-stream/LICENSE
  80. +68 −0 packages/pg-query-stream/README.md
  81. +48 −0 packages/pg-query-stream/index.js
  82. +37 −0 packages/pg-query-stream/package.json
  83. +112 −0 packages/pg-query-stream/test/async-iterator.es6
  84. +4 −0 packages/pg-query-stream/test/async-iterator.js
  85. +27 −0 packages/pg-query-stream/test/client-options.js
  86. +91 −0 packages/pg-query-stream/test/close.js
  87. +28 −0 packages/pg-query-stream/test/concat.js
  88. +26 −0 packages/pg-query-stream/test/config.js
  89. +22 −0 packages/pg-query-stream/test/empty-query.js
  90. +24 −0 packages/pg-query-stream/test/error.js
  91. +35 −0 packages/pg-query-stream/test/fast-reader.js
  92. +17 −0 packages/pg-query-stream/test/helper.js
  93. +17 −0 packages/pg-query-stream/test/instant.js
  94. +32 −0 packages/pg-query-stream/test/issue-3.js
  95. +38 −0 packages/pg-query-stream/test/passing-options.js
  96. +23 −0 packages/pg-query-stream/test/pauses.js
  97. +31 −0 packages/pg-query-stream/test/slow-reader.js
  98. +25 −0 packages/pg-query-stream/test/stream-tester-timestamp.js
  99. +12 −0 packages/pg-query-stream/test/stream-tester.js
  100. +2 −6 { → packages/pg}/Makefile
  101. +96 −0 packages/pg/README.md
  102. +84 −0 packages/pg/bench.js
  103. +604 −0 packages/pg/lib/client.js
  104. +156 −0 packages/pg/lib/connection-parameters.js
  105. +208 −0 packages/pg/lib/connection.js
  106. +20 −10 { → packages/pg}/lib/defaults.js
  107. +56 −0 packages/pg/lib/index.js
  108. +140 −72 { → packages/pg}/lib/native/client.js
  109. 0 { → packages/pg}/lib/native/index.js
  110. +36 −31 { → packages/pg}/lib/native/query.js
  111. +228 −0 packages/pg/lib/query.js
  112. +100 −0 packages/pg/lib/result.js
  113. +151 −0 packages/pg/lib/sasl.js
  114. +7 −11 { → packages/pg}/lib/type-overrides.js
  115. +58 −36 { → packages/pg}/lib/utils.js
  116. +55 −0 packages/pg/package.json
  117. +71 −0 packages/pg/script/create-test-tables.js
  118. +18 −0 packages/pg/script/dump-db-types.js
  119. +10 −0 packages/pg/script/list-db-types.js
  120. +14 −8 { → packages/pg}/test/buffer-list.js
  121. +1 −1 { → packages/pg}/test/cli.js
  122. +114 −63 { → packages/pg}/test/integration/client/api-tests.js
  123. +23 −18 { → packages/pg}/test/integration/client/appname-tests.js
  124. +231 −0 packages/pg/test/integration/client/array-tests.js
  125. +51 −15 { → packages/pg}/test/integration/client/big-simple-query-tests.js
  126. +26 −4 { → packages/pg}/test/integration/client/configuration-tests.js
  127. +13 −0 packages/pg/test/integration/client/connection-parameter-tests.js
  128. +87 −0 packages/pg/test/integration/client/connection-timeout-tests.js
  129. +42 −0 packages/pg/test/integration/client/custom-types-tests.js
  130. +1 −1 { → packages/pg}/test/integration/client/empty-query-tests.js
  131. +82 −47 { → packages/pg}/test/integration/client/error-handling-tests.js
  132. 0 { → packages/pg}/test/integration/client/field-name-escape-tests.js
  133. +27 −0 packages/pg/test/integration/client/huge-numeric-tests.js
  134. +95 −0 packages/pg/test/integration/client/idle_in_transaction_session_timeout-tests.js
  135. +37 −0 packages/pg/test/integration/client/json-type-parsing-tests.js
  136. +78 −0 packages/pg/test/integration/client/multiple-results-tests.js
  137. +34 −28 { → packages/pg}/test/integration/client/network-partition-tests.js
  138. +45 −0 packages/pg/test/integration/client/no-data-tests.js
  139. +7 −5 { → packages/pg}/test/integration/client/no-row-result-tests.js
  140. +75 −0 packages/pg/test/integration/client/notice-tests.js
  141. +37 −0 packages/pg/test/integration/client/parse-int-8-tests.js
  142. +75 −39 { → packages/pg}/test/integration/client/prepared-statement-tests.js
  143. +43 −0 packages/pg/test/integration/client/promise-api-tests.js
  144. +54 −0 packages/pg/test/integration/client/query-as-promise-tests.js
  145. +20 −0 packages/pg/test/integration/client/query-column-names-tests.js
  146. +125 −0 packages/pg/test/integration/client/query-error-handling-prepared-statement-tests.js
  147. +115 −0 packages/pg/test/integration/client/query-error-handling-tests.js
  148. 0 { → packages/pg}/test/integration/client/quick-disconnect-tests.js
  149. +47 −0 packages/pg/test/integration/client/result-metadata-tests.js
  150. +17 −12 { → packages/pg}/test/integration/client/results-as-array-tests.js
  151. +24 −12 { → packages/pg}/test/integration/client/row-description-on-results-tests.js
  152. +75 −0 packages/pg/test/integration/client/sasl-scram-tests.js
  153. +11 −5 { → packages/pg}/test/integration/client/simple-query-tests.js
  154. +21 −0 packages/pg/test/integration/client/ssl-tests.js
  155. +29 −22 { → packages/pg}/test/integration/client/statement_timeout-tests.js
  156. 0 { → packages/pg}/test/integration/client/test-helper.js
  157. 0 { → packages/pg}/test/integration/client/timezone-tests.js
  158. +99 −0 packages/pg/test/integration/client/transaction-tests.js
  159. +243 −0 packages/pg/test/integration/client/type-coercion-tests.js
  160. +44 −0 packages/pg/test/integration/client/type-parser-override-tests.js
  161. 0 { → packages/pg}/test/integration/connection-pool/connection-pool-size-tests.js
  162. +166 −0 packages/pg/test/integration/connection-pool/error-tests.js
  163. +7 −5 { → packages/pg}/test/integration/connection-pool/idle-timeout-tests.js
  164. +18 −0 packages/pg/test/integration/connection-pool/native-instance-tests.js
  165. 0 { → packages/pg}/test/integration/connection-pool/test-helper.js
  166. +23 −0 packages/pg/test/integration/connection-pool/yield-support-tests.js
  167. +3 −3 { → packages/pg}/test/integration/connection/bound-command-tests.js
  168. +12 −14 { → packages/pg}/test/integration/connection/copy-tests.js
  169. +119 −0 packages/pg/test/integration/connection/dynamic-password-tests.js
  170. +1 −1 { → packages/pg}/test/integration/connection/notification-tests.js
  171. +1 −1 { → packages/pg}/test/integration/connection/query-tests.js
  172. +7 −7 { → packages/pg}/test/integration/connection/test-helper.js
  173. +62 −0 packages/pg/test/integration/domain-tests.js
  174. +14 −9 { → packages/pg}/test/integration/gh-issues/130-tests.js
  175. +33 −0 packages/pg/test/integration/gh-issues/131-tests.js
  176. +1 −1 { → packages/pg}/test/integration/gh-issues/1382-tests.js
  177. +22 −0 packages/pg/test/integration/gh-issues/1542-tests.js
  178. +33 −0 packages/pg/test/integration/gh-issues/1854-tests.js
  179. +2 −1 { → packages/pg}/test/integration/gh-issues/199-tests.js
  180. +10 −0 packages/pg/test/integration/gh-issues/1992-tests.js
  181. +21 −0 packages/pg/test/integration/gh-issues/2056-tests.js
  182. +31 −0 packages/pg/test/integration/gh-issues/2064-tests.js
  183. +53 −0 packages/pg/test/integration/gh-issues/2079-tests.js
  184. +29 −0 packages/pg/test/integration/gh-issues/2085-tests.js
  185. +13 −0 packages/pg/test/integration/gh-issues/2108-tests.js
  186. +24 −0 packages/pg/test/integration/gh-issues/2307-tests.js
  187. +19 −0 packages/pg/test/integration/gh-issues/507-tests.js
  188. +90 −0 packages/pg/test/integration/gh-issues/600-tests.js
  189. 0 { → packages/pg}/test/integration/gh-issues/675-tests.js
  190. +31 −0 packages/pg/test/integration/gh-issues/699-tests.js
  191. +3 −2 { → packages/pg}/test/integration/gh-issues/787-tests.js
  192. +1 −1 { → packages/pg}/test/integration/gh-issues/882-tests.js
  193. +10 −11 { → packages/pg}/test/integration/gh-issues/981-tests.js
  194. +8 −5 { → packages/pg}/test/integration/test-helper.js
  195. +16 −9 { → packages/pg}/test/native/callback-api-tests.js
  196. +10 −6 { → packages/pg}/test/native/evented-api-tests.js
  197. 0 { → packages/pg}/test/native/missing-native.js
  198. 0 { → packages/pg}/test/native/native-vs-js-error-tests.js
  199. +2 −2 { → packages/pg}/test/native/stress-tests.js
  200. +23 −11 { → packages/pg}/test/suite.js
  201. +24 −28 { → packages/pg}/test/test-buffers.js
  202. +19 −24 { → packages/pg}/test/test-helper.js
  203. +30 −0 packages/pg/test/unit/client/cleartext-password-tests.js
  204. +5 −4 { → packages/pg}/test/unit/client/configuration-tests.js
  205. +5 −3 { → packages/pg}/test/unit/client/early-disconnect-tests.js
  206. +65 −0 packages/pg/test/unit/client/escape-tests.js
  207. +3 −3 { → packages/pg}/test/unit/client/md5-password-tests.js
  208. +1 −1 { → packages/pg}/test/unit/client/notification-tests.js
  209. +1 −0 packages/pg/test/unit/client/pgpass.file
  210. +15 −13 { → packages/pg}/test/unit/client/prepared-statement-tests.js
  211. +5 −6 { → packages/pg}/test/unit/client/query-queue-tests.js
  212. +9 −6 { → packages/pg}/test/unit/client/result-metadata-tests.js
  213. +168 −0 packages/pg/test/unit/client/sasl-scram-tests.js
  214. +32 −0 packages/pg/test/unit/client/set-keepalives-tests.js
  215. +37 −7 { → packages/pg}/test/unit/client/simple-query-tests.js
  216. +18 −9 { → packages/pg}/test/unit/client/stream-and-query-error-interaction-tests.js
  217. +8 −5 { → packages/pg}/test/unit/client/test-helper.js
  218. +5 −5 { → packages/pg}/test/unit/client/throw-in-type-parser-tests.js
  219. +109 −70 { → packages/pg}/test/unit/connection-parameters/creation-tests.js
  220. +41 −26 { → packages/pg}/test/unit/connection-parameters/environment-variable-tests.js
  221. +14 −0 packages/pg/test/unit/connection-pool/configuration-tests.js
  222. +11 −12 { → packages/pg}/test/unit/connection/error-tests.js
  223. +132 −91 { → packages/pg}/test/unit/connection/inbound-parser-tests.js
  224. +5 −23 { → packages/pg}/test/unit/connection/startup-tests.js
  225. +2 −0 packages/pg/test/unit/connection/test-helper.js
  226. +13 −8 { → packages/pg}/test/unit/test-helper.js
  227. +58 −24 { → packages/pg}/test/unit/utils-tests.js
  228. +0 −52 script/create-test-tables.js
  229. +0 −23 script/dump-db-types.js
  230. +0 −7 script/list-db-types.js
  231. +0 −177 test/integration/client/array-tests.js
  232. +0 −20 test/integration/client/custom-types-tests.js
  233. +0 −22 test/integration/client/huge-numeric-tests.js
  234. +0 −28 test/integration/client/json-type-parsing-tests.js
  235. +0 −69 test/integration/client/multiple-results-tests.js
  236. +0 −39 test/integration/client/no-data-tests.js
  237. +0 −56 test/integration/client/notice-tests.js
  238. +0 −29 test/integration/client/parse-int-8-tests.js
  239. +0 −49 test/integration/client/promise-api-tests.js
  240. +0 −33 test/integration/client/query-as-promise-tests.js
  241. +0 −15 test/integration/client/query-column-names-tests.js
  242. +0 −98 test/integration/client/query-error-handling-prepared-statement-tests.js
  243. +0 −88 test/integration/client/query-error-handling-tests.js
  244. +0 −32 test/integration/client/result-metadata-tests.js
  245. +0 −15 test/integration/client/ssl-tests.js
  246. +0 −76 test/integration/client/transaction-tests.js
  247. +0 −193 test/integration/client/type-coercion-tests.js
  248. +0 −37 test/integration/client/type-parser-override-tests.js
  249. +0 −50 test/integration/connection-pool/error-tests.js
  250. +0 −16 test/integration/connection-pool/native-instance-tests.js
  251. +0 −20 test/integration/connection-pool/yield-support-tests.js
  252. +0 −53 test/integration/domain-tests.js
  253. +0 −22 test/integration/gh-issues/131-tests.js
  254. +0 −17 test/integration/gh-issues/507-tests.js
  255. +0 −80 test/integration/gh-issues/600-tests.js
  256. +0 −31 test/integration/gh-issues/699-tests.js
  257. +0 −21 test/unit/client/cleartext-password-tests.js
  258. +0 −73 test/unit/client/escape-tests.js
  259. +0 −201 test/unit/connection/outbound-sending-tests.js
  260. +0 −2 test/unit/connection/test-helper.js
  261. +6,128 −0 yarn.lock
73 changes: 73 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
#-------------------------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------

FROM node:12

# Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive

# The node image includes a non-root user with sudo access. Use the
# "remoteUser" property in devcontainer.json to use it. On Linux, update
# these values to ensure the container user's UID/GID matches your local values.
# See https://aka.ms/vscode-remote/containers/non-root-user for details.
ARG USERNAME=node
ARG USER_UID=1000
ARG USER_GID=$USER_UID

# Configure apt and install packages
RUN apt-get update \
&& apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \
#
# Verify git and needed tools are installed
&& apt-get -y install git iproute2 procps \
#
# Remove outdated yarn from /opt and install via package
# so it can be easily updated via apt-get upgrade yarn
&& rm -rf /opt/yarn-* \
&& rm -f /usr/local/bin/yarn \
&& rm -f /usr/local/bin/yarnpkg \
&& apt-get install -y curl apt-transport-https lsb-release \
&& curl -sS https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/pubkey.gpg | apt-key add - 2>/dev/null \
&& echo "deb https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& apt-get update \
&& apt-get -y install --no-install-recommends yarn tmux locales postgresql \
#
# Install eslint globally
&& npm install -g eslint \
#
# [Optional] Update a non-root user to UID/GID if needed.
&& if [ "$USER_GID" != "1000" ] || [ "$USER_UID" != "1000" ]; then \
groupmod --gid $USER_GID $USERNAME \
&& usermod --uid $USER_UID --gid $USER_GID $USERNAME \
&& chown -R $USER_UID:$USER_GID /home/$USERNAME; \
fi \
# [Optional] Add add sudo support for non-root user
&& apt-get install -y sudo \
&& echo node ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME \
#
# Clean up
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*

RUN curl https://raw.githubusercontent.com/brianc/dotfiles/master/.tmux.conf > ~/.tmux.conf

# install nvm
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash

# set up a nicer prompt
RUN git clone https://github.com/magicmonty/bash-git-prompt.git ~/.bash-git-prompt --depth=1

RUN echo "source $HOME/.bash-git-prompt/gitprompt.sh" >> ~/.bashrc

# Set the locale
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && locale-gen
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8

# Switch back to dialog for any ad-hoc use of apt-get
ENV DEBIAN_FRONTEND=dialog
31 changes: 31 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// If you want to run as a non-root user in the container, see .devcontainer/docker-compose.yml.
{
"name": "Node.js 12 & Postgres",
"dockerComposeFile": "docker-compose.yml",
"service": "web",
"workspaceFolder": "/workspace",

// Use 'settings' to set *default* container specific settings.json values on container create.
// You can edit these settings after create using File > Preferences > Settings > Remote.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},

// Uncomment the next line if you want start specific services in your Docker Compose config.
// "runServices": [],

// Uncomment the line below if you want to keep your containers running after VS Code shuts down.
// "shutdownAction": "none",

// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "npm install",

// Uncomment the next line to have VS Code connect as an existing non-root user in the container. See
// https://aka.ms/vscode-remote/containers/non-root for details on adding a non-root user if none exist.
// "remoteUser": "node",

// Add the IDs of extensions you want installed when the container is created in the array below.
"extensions": [
"dbaeumer.vscode-eslint"
]
}
44 changes: 44 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#-------------------------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------

version: '3'
services:
web:
# Uncomment the next line to use a non-root user for all processes. You can also
# simply use the "remoteUser" property in devcontainer.json if you just want VS Code
# and its sub-processes (terminals, tasks, debugging) to execute as the user. On Linux,
# you may need to update USER_UID and USER_GID in .devcontainer/Dockerfile to match your
# user if not 1000. See https://aka.ms/vscode-remote/containers/non-root for details.
# user: node

build:
context: .
dockerfile: Dockerfile

volumes:
- ..:/workspace:cached

environment:
PGPASSWORD: pass
PGUSER: user
PGDATABASE: data
PGHOST: db

# Overrides default command so things don't shut down after the process ends.
command: sleep infinity

links:
- db

db:
image: postgres
restart: unless-stopped
ports:
- 5432:5432
environment:
POSTGRES_PASSWORD: pass
POSTGRES_USER: user
POSTGRES_DB: data

15 changes: 12 additions & 3 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
{
"extends": "standard",
"rules": {
"no-new-func": "off"
"plugins": ["prettier"],
"parser": "@typescript-eslint/parser",
"extends": ["plugin:prettier/recommended", "prettier/@typescript-eslint"],
"ignorePatterns": ["node_modules", "coverage", "packages/pg-protocol/dist/**/*"],
"parserOptions": {
"ecmaVersion": 2017,
"sourceType": "module"
},
"env": {
"node": true,
"es6": true,
"mocha": true
}
}
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

github: [brianc]
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -5,3 +5,7 @@ build/
node_modules/
package-lock.json
*.swp
dist
.DS_Store
.vscode/
manually-test-on-heroku.js
8 changes: 0 additions & 8 deletions .npmignore

This file was deleted.

79 changes: 51 additions & 28 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,64 @@
language: node_js
sudo: false
dist: trusty
before_script:
- node script/create-test-tables.js pg://postgres@127.0.0.1:5432/postgres
dist: bionic

before_script: |
yarn build
node packages/pg/script/create-test-tables.js postgresql:///
env:
- CC=clang CXX=clang++ npm_config_clang=1 PGUSER=postgres PGDATABASE=postgres

node_js:
- lts/dubnium
- lts/erbium
# node 13.7 seems to have changed behavior of async iterators exiting early on streams
# if 13.8 still has this problem when it comes down I'll talk to the node team about the change
# in the mean time...peg to 13.6
- 13.6
- 14

addons:
postgresql: '10'

matrix:
include:
- node_js: "lts/boron"
addons:
postgresql: "9.6"
- node_js: "lts/argon"
addons:
postgresql: "9.6"
- node_js: "9"
addons:
postgresql: "9.6"
- node_js: "10"
addons:
postgresql: "9.6"
- node_js: "lts/carbon"
# Run tests/paths that require password authentication
- node_js: lts/erbium
env:
- CC=clang CXX=clang++ npm_config_clang=1 PGUSER=postgres PGDATABASE=postgres PGPASSWORD=test-password SCRAM_TEST_PGUSER=scram_test SCRAM_TEST_PGPASSWORD=test4scram
before_script: |
sudo -u postgres sed -i \
-e '/^local/ s/trust$/peer/' \
-e '/^host/ s/trust$/md5/' \
/etc/postgresql/10/main/pg_hba.conf
sudo -u postgres psql -c "ALTER ROLE postgres PASSWORD 'test-password'; SELECT pg_reload_conf()"
yarn build
node packages/pg/script/create-test-tables.js postgresql:///
sudo -u postgres -- psql \
-c "SET password_encryption = 'scram-sha-256'" \
-c "CREATE ROLE scram_test login password 'test4scram'"
- node_js: lts/carbon
addons:
postgresql: "9.1"
postgresql: '9.5'
dist: precise
- node_js: "lts/carbon"

# different PostgreSQL versions on Node LTS
- node_js: lts/erbium
addons:
postgresql: "9.2"
- node_js: "lts/carbon"
postgresql: '9.3'
- node_js: lts/erbium
addons:
postgresql: "9.3"
- node_js: "lts/carbon"
postgresql: '9.4'
- node_js: lts/erbium
addons:
postgresql: "9.4"
- node_js: "lts/carbon"
postgresql: '9.5'
- node_js: lts/erbium
addons:
postgresql: "9.5"
- node_js: "lts/carbon"
postgresql: '9.6'

# PostgreSQL 9.2 only works on precise
- node_js: lts/carbon
addons:
postgresql: "9.6"
postgresql: '9.2'
dist: precise
Loading