kysely-postgrejs 1.2.0 โ†’ 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/CHANGELOG.md +14 -1
  2. package/README.md +40 -40
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,6 +1,19 @@
1
1
  # Changelog
2
2
 
3
- <!-- rman:documented-up-to a13fa6fec34f8c99f10b1c50ff257b79fbccad0b -->
3
+ <!-- rman:documented-up-to b60cfe166e126812c607076709c441756040d4ce -->
4
+
5
+ ## v1.2.1 (2026-10-06)
6
+
7
+ ### ๐Ÿงน Chores
8
+
9
+ - sync lockfile (1cc575b)
10
+
11
+ ### ๐Ÿ’ฌ General Changes
12
+
13
+ - say that the 4MB write's clock is mostly PostgreSQL (c6ace54)
14
+ - stop billing PostgreJS for a feature pg does not have (85c175b)
15
+
16
+ ---
4
17
 
5
18
  ## v1.2.0 (2026-10-05)
6
19
 
package/README.md CHANGED
@@ -11,11 +11,11 @@ types, your queries, your migrations.
11
11
 
12
12
  <!-- bench:intro -->
13
13
 
14
- It is faster where it counts, and it allocates far less doing it. A 4 MB `bytea` comes back in 15.6
15
- ms against 34.2 ms, on 4.1 MB a call against 51.7 MB - `pg` reads that column as hex text, twice the
16
- size, off the JS heap where a heap figure alone cannot see it. A 100k-element `int4[]` runs 3.3x, on
17
- 2.2 MB against 22.7 MB. Ordinary queries gain less and gain it repeatably: a point read is the
18
- faster of the two in 92 of 101 alternated pairs. All of it measured through Kysely against Kysely's
14
+ It is faster where it counts, and it allocates far less doing it. A 4 MB `bytea` comes back in 15.8
15
+ ms against 37.2 ms, on 4.1 MB a call against 51.6 MB - `pg` reads that column as hex text, twice the
16
+ size, off the JS heap where a heap figure alone cannot see it. A 100k-element `int4[]` runs 3.9x, on
17
+ 2.2 MB against 22.9 MB. Ordinary queries gain less and gain it repeatably: a point read is the
18
+ faster of the two in 100 of 101 alternated pairs. All of it measured through Kysely against Kysely's
19
19
  own `PostgresDialect` over `pg`, on the same server: [`doc/BENCHMARKS.md`](doc/BENCHMARKS.md).
20
20
 
21
21
  <!-- /bench:intro -->
@@ -183,7 +183,7 @@ the same schema types, the same queries, the same migrations. What you get for i
183
183
 
184
184
  <!-- bench:payload -->
185
185
 
186
- - **Faster where the payload is large** - 2.2x on a 4 MB `bytea` and 3.3x on a 100k-element
186
+ - **Faster where the payload is large** - 2.4x on a 4 MB `bytea` and 3.9x on a 100k-element
187
187
  `int4[]`, on a fraction of the memory, because the values arrive in PostgreSQL's binary format
188
188
  rather than as text to be parsed.
189
189
 
@@ -200,23 +200,23 @@ the same schema types, the same queries, the same migrations. What you get for i
200
200
 
201
201
  | Scenario | node-postgres<br>allocated per call | postgrejs<br>allocated per call | |
202
202
  | ------------------------------------------------------------------------------------------------------ | ----------------------------------- | -------------------------------- | --------------------- |
203
- | point read - 1 row of 9 columns | 0.313 ms<br>**27 KB**/call | **0.268 ms**<br>30 KB/call | **1.17x**<br>+13% |
204
- | point read through the builder - the same row, selected with selectFrom().where() instead of a sql tag | 0.311 ms<br>**29 KB**/call | **0.267 ms**<br>33 KB/call | **1.16x**<br>+14% |
205
- | page of 200 - 200 rows of 9 columns, mixed types | 1.452 ms<br>479 KB/call | **1.267 ms**<br>**348 KB**/call | **1.15x**<br>**-27%** |
206
- | concurrent reads - 20 reads at once of 1 row each, pool of 10 | 1.673 ms<br>**433 KB**/call | **1.494 ms**<br>511 KB/call | **1.12x**<br>+18% |
207
- | int4[] of 100k, full width - 1 row holding 1 array of 100 000 values that use the whole type | 26.082 ms<br>22.7 MB/call | **7.879 ms**<br>**2.2 MB**/call | **3.31x**<br>**-90%** |
208
- | float8 of 5k rows, full width - 5000 rows of 1 value, eight bytes against seventeen significant digits | 1.241 ms<br>1.4 MB/call | **0.788 ms**<br>**1.2 MB**/call | **1.57x**<br>**-13%** |
209
- | float8[] of 5k in one row - 1 row holding 1 array of the same 5000 values | 2.286 ms<br>2.9 MB/call | **0.664 ms**<br>**228 KB**/call | **3.44x**<br>**-92%** |
210
- | uuid of 5k rows - 5000 rows of 1 value, sixteen bytes against thirty-six characters | 1.447 ms<br>1.5 MB/call | **1.067 ms**<br>1.5 MB/call | **1.36x**<br>level |
211
- | box of 5k rows - 5000 rows of 1 value, four float8s against coordinates that use them | 2.543 ms<br>1.9 MB/call | **1.358 ms**<br>1.9 MB/call | **1.87x**<br>level |
212
- | bytea of 4MB - 1 row holding 1 value of 4 MB | 34.175 ms<br>51.7 MB/call | **15.566 ms**<br>**4.1 MB**/call | **2.20x**<br>**-92%** |
213
- | insert one row - 1 row, six parameters | 0.336 ms<br>**22 KB**/call | **0.291 ms**<br>30 KB/call | **1.16x**<br>+33% |
214
- | insert 500 rows - 500 rows in 1 statement, 2500 parameters that fill their types | 4.149 ms<br>**1.4 MB**/call | **3.383 ms**<br>1.5 MB/call | **1.23x**<br>+9% |
215
- | insert a 4MB bytea - 1 row holding 1 value of 4 MB, binary on both sides | 19.470 ms<br>**3.3 MB**/call | **17.370 ms**<br>4.1 MB/call | **1.12x**<br>+24% |
216
- | insert a 100k int4[] - 1 row holding 1 array of 100 000 values, text on both sides | 18.573 ms<br>27.3 MB/call | **13.414 ms**<br>**1.7 MB**/call | **1.38x**<br>**-94%** |
217
- | twenty inserts in a transaction - 20 rows, one statement each, inside one transaction | 6.633 ms<br>**289 KB**/call | **5.884 ms**<br>406 KB/call | **1.13x**<br>+40% |
218
-
219
- `kysely` 0.29.6, `postgrejs` 3.12.1, `pg` 8.23.0, PostgreSQL on loopback, Node 24.15.0. Medians; how
203
+ | point read - 1 row of 9 columns | 0.288 ms<br>**26 KB**/call | **0.251 ms**<br>28 KB/call | **1.15x**<br>+8% |
204
+ | point read through the builder - the same row, selected with selectFrom().where() instead of a sql tag | 0.288 ms<br>**28 KB**/call | **0.252 ms**<br>30 KB/call | **1.15x**<br>+8% |
205
+ | page of 200 - 200 rows of 9 columns, mixed types | 0.656 ms<br>471 KB/call | **0.531 ms**<br>**339 KB**/call | **1.24x**<br>**-28%** |
206
+ | concurrent reads - 20 reads at once of 1 row each, pool of 10 | 1.164 ms<br>**420 KB**/call | **1.054 ms**<br>464 KB/call | **1.10x**<br>+11% |
207
+ | int4[] of 100k, full width - 1 row holding 1 array of 100 000 values that use the whole type | 21.859 ms<br>22.9 MB/call | **5.545 ms**<br>**2.2 MB**/call | **3.94x**<br>**-90%** |
208
+ | float8 of 5k rows, full width - 5000 rows of 1 value, eight bytes against seventeen significant digits | 1.194 ms<br>1.4 MB/call | **0.822 ms**<br>**1.2 MB**/call | **1.45x**<br>**-13%** |
209
+ | float8[] of 5k in one row - 1 row holding 1 array of the same 5000 values | 2.240 ms<br>2.8 MB/call | **0.612 ms**<br>**226 KB**/call | **3.66x**<br>**-92%** |
210
+ | uuid of 5k rows - 5000 rows of 1 value, sixteen bytes against thirty-six characters | 1.294 ms<br>1.5 MB/call | **0.950 ms**<br>1.5 MB/call | **1.36x**<br>level |
211
+ | box of 5k rows - 5000 rows of 1 value, four float8s against coordinates that use them | 2.161 ms<br>1.9 MB/call | **1.219 ms**<br>**1.9 MB**/call | **1.77x**<br>**-2%** |
212
+ | bytea of 4MB - 1 row holding 1 value of 4 MB | 37.207 ms<br>51.6 MB/call | **15.819 ms**<br>**4.1 MB**/call | **2.35x**<br>**-92%** |
213
+ | insert one row - 1 row, six parameters | 0.314 ms<br>**22 KB**/call | **0.273 ms**<br>27 KB/call | **1.15x**<br>+22% |
214
+ | insert 500 rows - 500 rows in 1 statement, 2500 parameters that fill their types | 4.398 ms<br>**1.3 MB**/call | 4.309 ms<br>1.4 MB/call | level<br>+7% |
215
+ | insert a 4MB bytea - 1 row holding 1 value of 4 MB - the clock is mostly the server | 17.322 ms<br>**2.6 MB**/call | **15.038 ms**<br>2.7 MB/call | **1.15x**<br>+3% |
216
+ | insert a 100k int4[] - 1 row holding 1 array of 100 000 values, text on both sides | 17.951 ms<br>27.2 MB/call | **12.847 ms**<br>**993 KB**/call | **1.40x**<br>**-96%** |
217
+ | twenty inserts in a transaction - 20 rows, one statement each, inside one transaction | 5.610 ms<br>**276 KB**/call | **4.901 ms**<br>362 KB/call | **1.14x**<br>+31% |
218
+
219
+ `kysely` 0.29.6, `postgrejs` 3.13.0, `pg` 8.23.1, PostgreSQL on loopback, Node 24.15.0. Medians; how
220
220
  that was measured and how much each row can bear are in [How the numbers were
221
221
  measured](#how-the-numbers-were-measured).
222
222
 
@@ -240,21 +240,21 @@ What does not drift is _which_ of the two won each pair, so that is counted sepa
240
240
 
241
241
  | Scenario | pairs | postgrejs faster in | odds of that by luck |
242
242
  | ------------------------------- | ----- | ------------------- | -------------------- |
243
- | point read | 101 | 92 | < 1 in 10^17 |
244
- | point read through the builder | 101 | 95 | < 1 in 10^20 |
245
- | page of 200 | 101 | 78 | < 1 in 10^7 |
246
- | concurrent reads | 61 | 46 | < 1 in 10^4 |
243
+ | point read | 101 | 100 | < 1 in 10^28 |
244
+ | point read through the builder | 101 | 100 | < 1 in 10^28 |
245
+ | page of 200 | 101 | 93 | < 1 in 10^18 |
246
+ | concurrent reads | 61 | 41 | p = 0.010 |
247
247
  | int4[] of 100k, full width | 41 | 41 | < 1 in 10^12 |
248
- | float8 of 5k rows, full width | 61 | 60 | < 1 in 10^16 |
248
+ | float8 of 5k rows, full width | 61 | 61 | < 1 in 10^18 |
249
249
  | float8[] of 5k in one row | 61 | 61 | < 1 in 10^18 |
250
- | uuid of 5k rows | 61 | 54 | < 1 in 10^9 |
250
+ | uuid of 5k rows | 61 | 57 | < 1 in 10^12 |
251
251
  | box of 5k rows | 61 | 61 | < 1 in 10^18 |
252
252
  | bytea of 4MB | 41 | 41 | < 1 in 10^12 |
253
- | insert one row | 101 | 90 | < 1 in 10^15 |
254
- | insert 500 rows | 61 | 55 | < 1 in 10^10 |
255
- | insert a 4MB bytea | 41 | 36 | < 1 in 10^6 |
256
- | insert a 100k int4[] | 41 | 40 | < 1 in 10^10 |
257
- | twenty inserts in a transaction | 61 | 58 | < 1 in 10^13 |
253
+ | insert one row | 101 | 98 | < 1 in 10^24 |
254
+ | insert 500 rows | 61 | 38 | not distinguishable |
255
+ | insert a 4MB bytea | 41 | 40 | < 1 in 10^10 |
256
+ | insert a 100k int4[] | 41 | 41 | < 1 in 10^12 |
257
+ | twenty inserts in a transaction | 61 | 59 | < 1 in 10^14 |
258
258
 
259
259
  <!-- /bench:signtest -->
260
260
 
@@ -267,8 +267,8 @@ split a coin would produce is printed as level rather than rounded into a win.
267
267
  <!-- bench:binary -->
268
268
 
269
269
  Result columns arrive in PostgreSQL's binary format and are decoded per type, where `pg` asks for
270
- text and parses it. On bulk that is the whole difference: a 100k-element `int4[]` costs 7.9 ms and
271
- 2.2 MB here against 26.1 ms and 22.7 MB, because the text path has to materialise the array literal
270
+ text and parses it. On bulk that is the whole difference: a 100k-element `int4[]` costs 5.5 ms and
271
+ 2.2 MB here against 21.9 ms and 22.9 MB, because the text path has to materialise the array literal
272
272
  as one string before it can parse it.
273
273
 
274
274
  <!-- /bench:binary -->
@@ -278,16 +278,16 @@ as one string before it can parse it.
278
278
  PostgreJS names and caches a statement per connection - 64 by default, least-recently-used closed -
279
279
  so each distinct SQL string is parsed and planned once rather than on every call. `pg` prepares only
280
280
  a query it was given a name for, and Kysely does not give it one, so the same statement is parsed
281
- again on every call there. That is what the point read's 92 pairs of 101 is made of.
281
+ again on every call there. That is what the point read's 100 pairs of 101 is made of.
282
282
 
283
283
  <!-- /bench:prepared -->
284
284
 
285
285
  <!-- bench:builder -->
286
286
 
287
- The query builder itself costs 2.5 KB a call over a `sql` tag here and 1.9 KB on `pg`, and nothing
287
+ The query builder itself costs 1.7 KB a call over a `sql` tag here and 1.6 KB on `pg`, and nothing
288
288
  that separates from drift on the clock - Kysely's own compiler runs on both sides, so it is the same
289
- work paid once per driver rather than a difference between them. The same read is 1.17x through the
290
- tag and 1.16x through the builder.
289
+ work paid once per driver rather than a difference between them. The same read is 1.15x through the
290
+ tag and 1.15x through the builder.
291
291
 
292
292
  <!-- /bench:builder -->
293
293
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "kysely-postgrejs",
3
3
  "description": "Kysely dialect for PostgreJS - run a Kysely query builder on PostgreJS's wire-protocol client",
4
- "version": "1.2.0",
4
+ "version": "1.2.1",
5
5
  "author": "Panates",
6
6
  "license": "BSD-3-Clause",
7
7
  "peerDependencies": {