@ronin/compiler
Advanced tools
Comparing version 0.7.0 to 0.7.1
@@ -1130,8 +1130,15 @@ // src/utils/helpers.ts | ||
if (instructions.including) { | ||
const filteredObject = Object.entries(instructions.including).filter(([_, value]) => { | ||
const filteredObject = Object.entries(instructions.including).map(([key, value]) => { | ||
const symbol = getSymbol(value); | ||
const hasQuery = symbol?.type === "query"; | ||
if (hasQuery) isJoining = true; | ||
return !hasQuery; | ||
}); | ||
if (symbol) { | ||
if (symbol.type === "query") { | ||
isJoining = true; | ||
return null; | ||
} | ||
if (symbol.type === "expression") { | ||
value = parseFieldExpression(model, "including", symbol.value); | ||
} | ||
} | ||
return [key, value]; | ||
}).filter((entry) => entry !== null); | ||
const newObjectEntries = Object.entries(flatten(Object.fromEntries(filteredObject))); | ||
@@ -1141,2 +1148,4 @@ if (newObjectEntries.length > 0) { | ||
statement += newObjectEntries.map(([key, value]) => { | ||
if (typeof value === "string" && value.startsWith('"')) | ||
return `(${value}) as "${key}"`; | ||
return `${prepareStatementValue(statementParams, value)} as "${key}"`; | ||
@@ -1143,0 +1152,0 @@ }).join(", "); |
{ | ||
"name": "@ronin/compiler", | ||
"version": "0.7.0", | ||
"version": "0.7.1", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "description": "Compiles RONIN queries to SQL statements.", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
435791
7233