Minor Changes
-
8eb25b2Thanks @gajus! - fix: the type ofQueryResult.command(and ofDriverCommand) now includes every command that Postgres reports, e.g.MERGE,SETandCREATE(forCREATE TABLE), not onlyCOPY,DELETE,INSERT,SELECTandUPDATE. The command isnullif the query has no statement (e.g. it consists only of a comment), which was already the case at runtime. Code that handles the commands exhaustively, or that uses the command without checking fornull, may need to be updated. -
#832
6090a3cThanks @sgtoj! - addqueueTimeoutconfiguration, which limits how long a query waits for a connection when the pool is full. Once the timeout elapses, the query fails withQueueTimeoutError, which extendsConnectionError. The query is not retried:connectionRetryLimitapplies to establishing a connection. The timeout is disabled by default, i.e. a query waits until a connection becomes available. -
625c3e7Thanks @gajus! - fix: the types no longer accept arrays and buffers as values interpolated in a query, or as members ofsql.join,sql.list,sql.andandsql.or. They passed type-checking, but always threw at runtime (e.g. "Unexpected value expression."). Bind arrays usingsql.arrayand buffers usingsql.binary. Code that interpolates a value typed asPrimitiveValueExpression(which includes arrays and buffers) no longer compiles; type the value asValueExpressioninstead.
Patch Changes
-
777d254Thanks @gajus! - fix: the connections that the pool keeps open forminPoolSizeare no longer closed and replaced afteridleTimeout. Besides the pool, the driver closed every connectionidleTimeoutafter it was released, regardless ofminPoolSize, so the pool kept opening new connections to replace them. Now only the pool closes idle connections, and it keepsminPoolSizeconnections open. -
#832
6090a3cThanks @sgtoj! - fix: the pool no longer exceedsmaxPoolSizewhen it replaces a destroyed connection to keepminPoolSizeconnections while another connection is being established. -
#832
6090a3cThanks @sgtoj! - fix: queries that wait for a connection no longer wait forever when the connections that the pool is establishing fail (e.g. because the database refuses connections) and the pool has no other connections. They fail with the connection error, which is retried according toconnectionRetryLimit. -
4edcfd6Thanks @gajus! - fix:rowCountis the number of returned rows for statements that do not report a row count (e.g.SHOWandEXPLAIN), instead of 0. This also stopsslonik-interceptor-query-cachefrom treating the results of such statements as empty (discardEmpty). -
Updated dependencies [
8eb25b2,777d254,6090a3c,625c3e7]:- @slonik/driver@49.14.0
- @slonik/errors@49.14.0
- @slonik/sql-tag@49.14.0
- @slonik/pg-driver@49.14.0
- @slonik/utilities@49.14.0