@vibeorm/adapter-bun 5.0.3 → 6.0.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.
package/dist/params.d.ts CHANGED
@@ -1,15 +1,15 @@
1
1
  /**
2
2
  * Parameter serialization for bun:sql: the values node-postgres would send.
3
3
  *
4
- * Live-verified on Bun 1.4.1 and 1.4.3 (`tests/node-postgres-parity.live.test.ts`):
4
+ * Live-verified (`tests/node-postgres-parity.live.test.ts`):
5
5
  * - bun:sql types a JS number itself (int32 → `int4`, anything else →
6
6
  * `float8`) and lets the SERVER cast from that type, so numbers, bigints and
7
7
  * booleans go out as text and the server reads them as the slot's own type;
8
- * - a plain JS array bound to a scalar-list column (`text[]`, `int[]`) is NOT
9
- * turned into a PostgreSQL array literal by bun:sql — it arrives as `a,b` and
10
- * the server rejects it with `malformed array literal`. Scalar lists therefore
11
- * have to be pre-rendered with {@link toPgArrayLiteral}, which is exactly what
12
- * the adapter's `formatArrayParam` returns;
8
+ * - a scalar list reaches the server as the PostgreSQL array literal
9
+ * node-postgres sends ({@link toPgArrayLiteral}, what the adapter's
10
+ * `formatArrayParam` returns), so one rule covers every element type: bun:sql
11
+ * types a plain JS array only for built-in element types, not for an enum
12
+ * array;
13
13
  * - with NAMED statements (`preparedStatements: true`) bun:sql learns each
14
14
  * slot's type first and JSON-encodes whatever is bound to a `json`/`jsonb`
15
15
  * slot, a string included; with unnamed statements (the default) a string is
@@ -42,17 +42,11 @@
42
42
  export declare function toPgArrayLiteral(values: readonly unknown[]): string;
43
43
  /**
44
44
  * `Date` → UTC ISO-8601 text (`2026-03-08T19:38:08.538Z`), the same spelling
45
- * the array literal above uses.
46
- *
47
- * bun:sql serializes a `Date` by the parameter's RESOLVED postgres type
48
- * (LEARNINGS): fine for `timestamp`/`timestamptz` (UTC text), but a `date`
49
- * parameter gets `Date#toString()` — `Sun Mar 08 2026 23:30:00 GMT+0000
50
- * (Coordinated Universal Time)` — which the server rejects in every host TZ
51
- * (live on Bun 1.4.3: `invalid input syntax for type date` under UTC, `time
52
- * zone "gmt-0400" not recognized` under America/New_York). The ISO text
53
- * parses for all three, and pins the UTC wall-clock contract the codec table
54
- * and the other postgres adapters share. Dates the ISO form cannot spell
55
- * (invalid, BC, beyond year 9999) keep the driver's serializer.
45
+ * the array literal above uses, whatever type the server resolves for the
46
+ * slot: a zone-less `timestamp` or `date` stores the UTC wall-clock, the
47
+ * contract the codec table and the other postgres adapters share. Dates the
48
+ * ISO form cannot spell (invalid, BC, beyond year 9999) keep the driver's
49
+ * serializer.
56
50
  */
57
51
  export declare function serializeDate(params: {
58
52
  value: Date;
@@ -21,10 +21,10 @@
21
21
  * The cache is LRU-bounded so a long-running process never grows it without
22
22
  * limit.
23
23
  *
24
- * From Bun 1.4.3 `sql.unsafe(text, values)` names its statement too (B-04), so
25
- * the adapter uses the template there only for a text whose placeholders are
26
- * not `$1 … $n` in order with exactly n values, or that binds no value; the
27
- * scan still decides which.
24
+ * bun:sql's `sql.unsafe(text, values)` names its statement too (B-04), so the
25
+ * adapter uses the template only for a text whose placeholders are not
26
+ * `$1 … $n` in order with exactly n values, or that binds no value; the scan
27
+ * still decides which.
28
28
  */
29
29
  /** A SQL text split for bun:sql, with the placeholder index behind each gap. */
30
30
  export type PreparedTemplate = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibeorm/adapter-bun",
3
- "version": "5.0.3",
3
+ "version": "6.0.1",
4
4
  "description": "bun:sql (Postgres) adapter for VibeORM v2",
5
5
  "keywords": [
6
6
  "orm",
@@ -40,12 +40,12 @@
40
40
  "LICENSE"
41
41
  ],
42
42
  "engines": {
43
- "bun": ">=1.4.1"
43
+ "bun": ">=1.4.4"
44
44
  },
45
45
  "dependencies": {
46
- "@vibeorm/runtime": "5.3.0",
47
- "@vibeorm/schema": "5.2.0",
48
- "@vibeorm/sql": "5.2.0"
46
+ "@vibeorm/runtime": "5.4.1",
47
+ "@vibeorm/schema": "5.3.0",
48
+ "@vibeorm/sql": "5.3.0"
49
49
  },
50
50
  "publishConfig": {
51
51
  "access": "public"