@danielhritcu/zenstack-orm 3.5.22 → 3.5.23
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/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -8573,11 +8573,11 @@ var QueryNameMapper = class extends import_kysely7.OperationNodeTransformer {
|
|
|
8573
8573
|
var import_kysely8 = require("kysely");
|
|
8574
8574
|
function buildRlsSetConfigSql(rlsDef, rlsValues) {
|
|
8575
8575
|
const parts = [];
|
|
8576
|
-
for (const [name,
|
|
8576
|
+
for (const [name, settingName] of Object.entries(rlsDef.keys)) {
|
|
8577
8577
|
const rawValue = rlsValues[name];
|
|
8578
|
-
const
|
|
8579
|
-
const escaped =
|
|
8580
|
-
parts.push(`set_config('${
|
|
8578
|
+
const value = rawValue != null ? String(rawValue) : "undefined";
|
|
8579
|
+
const escaped = value.replace(/'/g, "''");
|
|
8580
|
+
parts.push(`set_config('${settingName}', '${escaped}', true)`);
|
|
8581
8581
|
}
|
|
8582
8582
|
return `SELECT ${parts.join(", ")}`;
|
|
8583
8583
|
}
|