@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.js
CHANGED
|
@@ -8524,11 +8524,11 @@ var QueryNameMapper = class extends OperationNodeTransformer {
|
|
|
8524
8524
|
import { createQueryId as createQueryId2 } from "kysely";
|
|
8525
8525
|
function buildRlsSetConfigSql(rlsDef, rlsValues) {
|
|
8526
8526
|
const parts = [];
|
|
8527
|
-
for (const [name,
|
|
8527
|
+
for (const [name, settingName] of Object.entries(rlsDef.keys)) {
|
|
8528
8528
|
const rawValue = rlsValues[name];
|
|
8529
|
-
const
|
|
8530
|
-
const escaped =
|
|
8531
|
-
parts.push(`set_config('${
|
|
8529
|
+
const value = rawValue != null ? String(rawValue) : "undefined";
|
|
8530
|
+
const escaped = value.replace(/'/g, "''");
|
|
8531
|
+
parts.push(`set_config('${settingName}', '${escaped}', true)`);
|
|
8532
8532
|
}
|
|
8533
8533
|
return `SELECT ${parts.join(", ")}`;
|
|
8534
8534
|
}
|