@vibeorm/sql 5.10.0 → 5.11.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/dist/ast.d.ts +217 -0
- package/dist/dialect.d.ts +49 -0
- package/dist/dialects/mysql-json-keys.d.ts +26 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +519 -262
- package/dist/index.js.map +9 -8
- package/dist/key-list.d.ts +38 -0
- package/package.json +2 -2
package/dist/key-list.d.ts
CHANGED
|
@@ -42,6 +42,44 @@ export declare function postgresKeyListElementTypeOf(params: {
|
|
|
42
42
|
export declare function keyListBindsUntypedRows(params: {
|
|
43
43
|
members: readonly KeyListMember[];
|
|
44
44
|
}): boolean;
|
|
45
|
+
/** How MySQL types a key it reads back from JSON text; see {@link mysqlJsonKeyTypeOf}. */
|
|
46
|
+
export type MysqlJsonKeyType = "text" | "signed" | "unsigned";
|
|
47
|
+
/**
|
|
48
|
+
* How MySQL turns the text of a key column, read back out of JSON, into a
|
|
49
|
+
* value its foreign-key column compares with through its index, or
|
|
50
|
+
* `undefined` for a key type nobody measured. `"text"`: the unquoted JSON
|
|
51
|
+
* string, compared under the column's collation like a bound literal.
|
|
52
|
+
* `"signed"` / `"unsigned"`: `CAST(… AS SIGNED | UNSIGNED)`, exact over the
|
|
53
|
+
* whole 64-bit range (text against a BIGINT column compares as a double).
|
|
54
|
+
* Dates, decimals, floats, booleans, bytes and enums are not admitted.
|
|
55
|
+
*/
|
|
56
|
+
export declare function mysqlJsonKeyTypeOf(params: {
|
|
57
|
+
member: KeyListMember;
|
|
58
|
+
}): MysqlJsonKeyType | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Does the token of a key read back from JSON (the key's text, written on the
|
|
61
|
+
* to-one's own row) need a text cast? A key the JSON carries as a number must
|
|
62
|
+
* travel as text, or a 64-bit integer would reach the client rounded; a MySQL
|
|
63
|
+
* string key is text already, and `CAST(… AS CHAR)` would convert it to the
|
|
64
|
+
* CONNECTION's character set, where a `utf8mb3` connection turns every
|
|
65
|
+
* character outside the BMP into `?` and two keys into one.
|
|
66
|
+
*/
|
|
67
|
+
export declare function jsonKeyTokenCast(params: {
|
|
68
|
+
dialect: SqlDialect;
|
|
69
|
+
member: KeyListMember;
|
|
70
|
+
}): boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Can `dialect` type every one of `members` from its JSON text, as
|
|
73
|
+
* `SelectStatement.fromJsonKeys` must? PostgreSQL casts the text to the
|
|
74
|
+
* key-list's base type (not a `DateTime` without a declared native type,
|
|
75
|
+
* whose column may be a zone-less `timestamp`); MySQL admits the types of
|
|
76
|
+
* {@link mysqlJsonKeyTypeOf}. The renderer throws for a member this refuses,
|
|
77
|
+
* so the runtime asks here before it builds a dictionary level.
|
|
78
|
+
*/
|
|
79
|
+
export declare function jsonKeysTyped(params: {
|
|
80
|
+
dialect: SqlDialect;
|
|
81
|
+
members: readonly KeyListMember[];
|
|
82
|
+
}): boolean;
|
|
45
83
|
/**
|
|
46
84
|
* The cast after a bulk-insert column's array placeholder (`$n::<cast>[]`),
|
|
47
85
|
* or `undefined` when the column has none and the insert must keep VALUES.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibeorm/sql",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.11.0",
|
|
4
4
|
"description": "Dialect-aware SQL layer for VibeORM v2 — SQL AST, renderers and capability tables for postgres, sqlite and mysql",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"orm",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"bun": ">=1.2.0"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@vibeorm/schema": "^5.
|
|
53
|
+
"@vibeorm/schema": "^5.11.0"
|
|
54
54
|
},
|
|
55
55
|
"publishConfig": {
|
|
56
56
|
"access": "public"
|