@vibeorm/adapter-bun 6.1.0 → 6.2.0
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/README.md +1 -1
- package/dist/bun-version.d.ts +1 -10
- package/dist/config.d.ts +1 -20
- package/dist/connection-url.d.ts +0 -48
- package/dist/driver.d.ts +1 -10
- package/dist/errors.d.ts +0 -2
- package/dist/index.js +19 -8
- package/dist/index.js.map +12 -12
- package/dist/params.d.ts +0 -11
- package/dist/raw-json-text.d.ts +1 -26
- package/dist/template-cache.d.ts +0 -24
- package/dist/transaction-sql.d.ts +0 -23
- package/package.json +4 -4
package/dist/params.d.ts
CHANGED
|
@@ -40,17 +40,6 @@
|
|
|
40
40
|
* @throws VibeError `VIBE_VALIDATION` for unsupported binary elements.
|
|
41
41
|
*/
|
|
42
42
|
export declare function toPgArrayLiteral(values: readonly unknown[]): string;
|
|
43
|
-
/**
|
|
44
|
-
* `Date` → UTC ISO-8601 text (`2026-03-08T19:38:08.538Z`), the same spelling
|
|
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.
|
|
50
|
-
*/
|
|
51
|
-
export declare function serializeDate(params: {
|
|
52
|
-
value: Date;
|
|
53
|
-
}): unknown;
|
|
54
43
|
/**
|
|
55
44
|
* ORM hot path, node-postgres's rules (`@vibeorm/adapter-pg` `serializeParams`):
|
|
56
45
|
* scalars as text ({@link serializeScalar}), `Date` as UTC ISO text
|
package/dist/raw-json-text.d.ts
CHANGED
|
@@ -26,30 +26,5 @@
|
|
|
26
26
|
* cannot be seen in the text, so bun:sql still JSON-encodes a string bound
|
|
27
27
|
* there. Spell `$n::jsonb` (or `$n::text::jsonb`).
|
|
28
28
|
*/
|
|
29
|
-
|
|
30
|
-
export type JsonSlotPlan = {
|
|
31
|
-
readonly chunks: readonly string[];
|
|
32
|
-
readonly indices: readonly number[];
|
|
33
|
-
/** 1-based placeholders whose every reference is a direct cast to the SAME json type. */
|
|
34
|
-
readonly slots: ReadonlySet<number>;
|
|
35
|
-
};
|
|
36
|
-
/** Respells raw texts for named statements; bounded LRU of the per-text scan. */
|
|
37
|
-
export type JsonTextRespeller = {
|
|
38
|
-
/**
|
|
39
|
-
* The text to send for the ORIGINAL values, before serialization: `text`
|
|
40
|
-
* itself unless a certain json/jsonb slot was given a JS string.
|
|
41
|
-
*/
|
|
42
|
-
readonly respell: (params: {
|
|
43
|
-
readonly text: string;
|
|
44
|
-
readonly values: readonly unknown[];
|
|
45
|
-
}) => string;
|
|
46
|
-
};
|
|
47
|
-
/** Scan `text` once: which placeholders are certainly `json` / `jsonb` slots. `null` = none. */
|
|
48
|
-
export declare function planJsonSlots(params: {
|
|
49
|
-
text: string;
|
|
50
|
-
}): JsonSlotPlan | null;
|
|
51
|
-
/** Build a respeller whose scan cache holds at most `max` texts. */
|
|
52
|
-
export declare function createJsonTextRespeller(params: {
|
|
53
|
-
max: number;
|
|
54
|
-
}): JsonTextRespeller;
|
|
29
|
+
export {};
|
|
55
30
|
//# sourceMappingURL=raw-json-text.d.ts.map
|
package/dist/template-cache.d.ts
CHANGED
|
@@ -44,18 +44,6 @@ export type TemplateCache = {
|
|
|
44
44
|
/** Number of texts currently held — diagnostics and tests. */
|
|
45
45
|
size(): number;
|
|
46
46
|
};
|
|
47
|
-
/** Skip PostgreSQL whitespace and comments, including nested block comments and CR line endings. */
|
|
48
|
-
export declare function skipSqlTrivia(params: {
|
|
49
|
-
text: string;
|
|
50
|
-
start: number;
|
|
51
|
-
}): number;
|
|
52
|
-
/**
|
|
53
|
-
* Split `text` at its real `$n` placeholders. `chunks.length` is always
|
|
54
|
-
* `indices.length + 1`, which is exactly the shape a tagged template needs.
|
|
55
|
-
*/
|
|
56
|
-
export declare function scanPlaceholders(params: {
|
|
57
|
-
text: string;
|
|
58
|
-
}): PreparedTemplate;
|
|
59
47
|
/**
|
|
60
48
|
* Split a SQL text on `$n` placeholders into the literal chunks around them.
|
|
61
49
|
*
|
|
@@ -66,18 +54,6 @@ export declare function scanPlaceholders(params: {
|
|
|
66
54
|
export declare function templateChunks(params: {
|
|
67
55
|
text: string;
|
|
68
56
|
}): string[];
|
|
69
|
-
/**
|
|
70
|
-
* The values to hand a synthetic template, in gap order: `$n` picks
|
|
71
|
-
* `values[n - 1]`, a repeated placeholder repeats its value.
|
|
72
|
-
*
|
|
73
|
-
* A `$n` with no matching value is REFUSED (`VIBE_VALIDATION`) rather than
|
|
74
|
-
* bound to `undefined` — misbinding is exactly the failure mode F19 records.
|
|
75
|
-
*/
|
|
76
|
-
export declare function bindTemplateValues(params: {
|
|
77
|
-
text: string;
|
|
78
|
-
indices: readonly number[];
|
|
79
|
-
values: readonly unknown[];
|
|
80
|
-
}): unknown[];
|
|
81
57
|
/**
|
|
82
58
|
* Create a template cache holding at most `max` texts (least recently used
|
|
83
59
|
* evicted first).
|
|
@@ -16,29 +16,6 @@ export declare function beginStatement(params: {
|
|
|
16
16
|
isolationLevel?: IsolationLevel;
|
|
17
17
|
readOnly?: boolean;
|
|
18
18
|
}): string;
|
|
19
|
-
/**
|
|
20
|
-
* The whole opening of a reserved-path transaction as ONE simple-protocol
|
|
21
|
-
* message (round-trip EPIC 3, A-05): `BEGIN …` alone, or `BEGIN …; SET LOCAL
|
|
22
|
-
* statement_timeout = N` when a timeout is requested — one wait instead of
|
|
23
|
-
* two. Parameterless text from validated values; PostgreSQL stops at the first
|
|
24
|
-
* failing statement and the driver rejects with that error, so the caller sees
|
|
25
|
-
* BEGIN's or the SET's own error exactly as when they were two messages.
|
|
26
|
-
*
|
|
27
|
-
* @throws VibeError `VIBE_VALIDATION` for an invalid timeout (before anything
|
|
28
|
-
* is sent).
|
|
29
|
-
*/
|
|
30
|
-
export declare function openTransactionStatement(params: {
|
|
31
|
-
isolationLevel?: IsolationLevel;
|
|
32
|
-
readOnly?: boolean;
|
|
33
|
-
timeout?: number;
|
|
34
|
-
}): string;
|
|
35
|
-
/**
|
|
36
|
-
* The cancel deadline's per-statement bound (round-trip EPIC 6): a CONSTANT
|
|
37
|
-
* extended-protocol text, with the milliseconds bound as a string `$1`, so
|
|
38
|
-
* bun:sql keeps it prepared and pipelines it with the statement it bounds.
|
|
39
|
-
* `is_local = true` makes it transaction-scoped, like `SET LOCAL`.
|
|
40
|
-
*/
|
|
41
|
-
export declare const STATEMENT_BOUND_TEXT: string;
|
|
42
19
|
/**
|
|
43
20
|
* `SET LOCAL statement_timeout = <ms>` — transaction-scoped, so PostgreSQL
|
|
44
21
|
* cancels an over-long statement with SQLSTATE 57014 (mapped to
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibeorm/adapter-bun",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.2.0",
|
|
4
4
|
"description": "bun:sql (Postgres) adapter for VibeORM v2",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"orm",
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
"bun": ">=1.4.4"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@vibeorm/runtime": "^5.
|
|
47
|
-
"@vibeorm/schema": "^5.
|
|
48
|
-
"@vibeorm/sql": "^5.
|
|
46
|
+
"@vibeorm/runtime": "^5.12.0",
|
|
47
|
+
"@vibeorm/schema": "^5.10.0",
|
|
48
|
+
"@vibeorm/sql": "^5.10.0"
|
|
49
49
|
},
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public"
|