Release: weekly deploy

This commit is contained in:
Danila Khodjaef
2026-07-27 20:14:51 +03:00
parent 485c7d3e6f
commit 23e1210e86
2 changed files with 30 additions and 1 deletions
+5
View File
@@ -32,6 +32,11 @@ function sqlLiteral(value) {
if (typeof value === 'boolean') return value ? 'TRUE' : 'FALSE';
if (value instanceof Date) return `'${value.toISOString()}'`;
if (typeof value === 'number' || typeof value === 'bigint') return String(value);
// node-pg returns JS arrays for Postgres array columns (e.g. users.permissions TEXT[])
if (Array.isArray(value)) {
if (value.length === 0) return `ARRAY[]::text[]`;
return `ARRAY[${value.map((item) => sqlLiteral(item)).join(', ')}]`;
}
if (typeof value === 'object') {
return `'${JSON.stringify(value).replace(/'/g, "''")}'`;
}