@happyvertical/sql 0.89.1 → 0.89.2
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 +7 -0
- package/dist/chunks/{connection-cache-WEH2ulk5.js → connection-cache-BU3GBQxu.js} +26 -7
- package/dist/chunks/{connection-cache-WEH2ulk5.js.map → connection-cache-BU3GBQxu.js.map} +1 -1
- package/dist/chunks/{duckdb-Di0KdU5i.js → duckdb-hbOqNSuA.js} +2 -2
- package/dist/chunks/{duckdb-Di0KdU5i.js.map → duckdb-hbOqNSuA.js.map} +1 -1
- package/dist/chunks/{sqlite-BTmP_O5Q.js → sqlite-D3sUjQ5Q.js} +4 -4
- package/dist/chunks/{sqlite-BTmP_O5Q.js.map → sqlite-D3sUjQ5Q.js.map} +1 -1
- package/dist/chunks/{sqlite-connection-cache-DfB52hp6.js → sqlite-connection-cache-Cnsr2tuN.js} +2 -2
- package/dist/chunks/{sqlite-connection-cache-DfB52hp6.js.map → sqlite-connection-cache-Cnsr2tuN.js.map} +1 -1
- package/dist/chunks/{sqlite-native-FrjMCnBh.js → sqlite-native-CdNLXZ60.js} +3 -3
- package/dist/chunks/{sqlite-native-FrjMCnBh.js.map → sqlite-native-CdNLXZ60.js.map} +1 -1
- package/dist/index.js +12 -12
- package/dist/index.js.map +1 -1
- package/dist/postgres.d.ts.map +1 -1
- package/dist/shared/alter-utils.d.ts +21 -5
- package/dist/shared/alter-utils.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/postgres.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postgres.d.ts","sourceRoot":"","sources":["../src/postgres.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"postgres.d.ts","sourceRoot":"","sources":["../src/postgres.ts"],"names":[],"mappings":"AAcA,OAAO,EACL,eAAe,EAEhB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAIV,oBAAoB,EACpB,iBAAiB,E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in a column list to prevent SQL injection
|
|
91
91
|
*
|
|
92
92
|
* Column names reaching the CRUD methods come from `Object.keys(data)` and the
|
|
93
|
-
* caller's `conflictColumns`, both of which are interpolated into SQL.
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
93
|
+
* caller's `conflictColumns`, both of which are interpolated into SQL. The
|
|
94
|
+
* accepted shape has no character that can end an identifier. Adapters may
|
|
95
|
+
* render a validated name bare, or quote it under an adapter-specific contract.
|
|
96
|
+
* PostgreSQL upsert uses {@link quotePostgresColumnName}, which canonicalizes
|
|
97
|
+
* the name before quoting so its established unquoted case-folding semantics
|
|
98
|
+
* do not change.
|
|
98
99
|
*
|
|
99
100
|
* @param columnNames - Column names to validate
|
|
100
101
|
* @throws Error if any column name contains invalid characters
|
|
101
102
|
*/
|
|
102
103
|
export declare function validateColumnNames(columnNames: string[]): void;
|
|
104
|
+
/**
|
|
105
|
+
* Quotes a validated column name using PostgreSQL's historic case semantics.
|
|
106
|
+
*
|
|
107
|
+
* PostgreSQL folds every unquoted identifier to lowercase. The CRUD API has
|
|
108
|
+
* always accepted mixed-case inputs while rendering them unquoted, so quoting
|
|
109
|
+
* the caller's spelling directly would silently change which physical column
|
|
110
|
+
* is addressed. Validate the existing plain-identifier contract first, then
|
|
111
|
+
* lowercase before quoting: `mixedCase` still addresses `mixedcase`, while a
|
|
112
|
+
* reserved word such as `end` is no longer parsed as SQL syntax.
|
|
113
|
+
*
|
|
114
|
+
* @param columnName - Plain column name to render for PostgreSQL
|
|
115
|
+
* @returns A lowercase, double-quoted PostgreSQL identifier
|
|
116
|
+
* @throws Error if the column name is outside the CRUD identifier contract
|
|
117
|
+
*/
|
|
118
|
+
export declare function quotePostgresColumnName(columnName: string): string;
|
|
103
119
|
/**
|
|
104
120
|
* Escapes an identifier for interpolation inside double quotes
|
|
105
121
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alter-utils.d.ts","sourceRoot":"","sources":["../../src/shared/alter-utils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,wBAAwB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE5E;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,UAAU,GAAG,QAAQ,CAAC;AAE/D;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,wBAAwB,EAChC,QAAQ,EAAE,eAAe,GACxB,MAAM,CAkDR;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,GAAG,GAChB,MAAM,CAkER;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,eAAe,GACrB,MAAM,CA0BR;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CASzD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAS3D;AAED
|
|
1
|
+
{"version":3,"file":"alter-utils.d.ts","sourceRoot":"","sources":["../../src/shared/alter-utils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,wBAAwB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE5E;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,UAAU,GAAG,QAAQ,CAAC;AAE/D;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,wBAAwB,EAChC,QAAQ,EAAE,eAAe,GACxB,MAAM,CAkDR;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,GAAG,GAChB,MAAM,CAkER;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,eAAe,GACrB,MAAM,CA0BR;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CASzD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAS3D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,IAAI,CAI/D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAGlE;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAcjE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAWzD;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CASzD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/sql",
|
|
3
|
-
"version": "0.89.
|
|
3
|
+
"version": "0.89.2",
|
|
4
4
|
"description": "Database interface with support for SQLite, PostgreSQL, and DuckDB",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@libsql/client": "0.17.2",
|
|
47
47
|
"pg": "^8.20.0",
|
|
48
48
|
"sqlite-vss": "^0.1.2",
|
|
49
|
-
"@happyvertical/utils": "0.89.
|
|
49
|
+
"@happyvertical/utils": "0.89.2"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"@russellthehippo/honker-node": "^0.3.3",
|