log cleanup
This commit is contained in:
@ -67,7 +67,10 @@ impl<'a> Compiler<'a> {
|
||||
if let Some(items) = &node.schema.obj.items {
|
||||
let mut resolved_type = None;
|
||||
if let Some(family_target) = items.obj.family.as_ref() {
|
||||
let base_type_name = family_target.split('.').next_back().unwrap_or(family_target);
|
||||
let base_type_name = family_target
|
||||
.split('.')
|
||||
.next_back()
|
||||
.unwrap_or(family_target);
|
||||
resolved_type = self.db.types.get(base_type_name);
|
||||
} else if let Some(base_type_name) = items.obj.identifier() {
|
||||
resolved_type = self.db.types.get(&base_type_name);
|
||||
@ -89,7 +92,10 @@ impl<'a> Compiler<'a> {
|
||||
}
|
||||
|
||||
// 3. Fallback for root execution of standalone non-entity arrays
|
||||
Err("Cannot compile a root array without a valid entity reference or table mapped via `items`.".to_string())
|
||||
Err(
|
||||
"Cannot compile a root array without a valid entity reference or table mapped via `items`."
|
||||
.to_string(),
|
||||
)
|
||||
}
|
||||
|
||||
fn compile_reference(&mut self, node: Node<'a>) -> Result<(String, String), String> {
|
||||
@ -452,7 +458,6 @@ impl<'a> Compiler<'a> {
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
let (val_sql, val_type) = self.compile_node(child_node)?;
|
||||
|
||||
if val_type != "abort" {
|
||||
@ -515,7 +520,13 @@ impl<'a> Compiler<'a> {
|
||||
// Determine if the property schema resolves to a physical Database Entity
|
||||
let mut bound_type_name = None;
|
||||
if let Some(family_target) = prop_schema.obj.family.as_ref() {
|
||||
bound_type_name = Some(family_target.split('.').next_back().unwrap_or(family_target).to_string());
|
||||
bound_type_name = Some(
|
||||
family_target
|
||||
.split('.')
|
||||
.next_back()
|
||||
.unwrap_or(family_target)
|
||||
.to_string(),
|
||||
);
|
||||
} else if let Some(lookup_key) = prop_schema.obj.identifier() {
|
||||
bound_type_name = Some(lookup_key);
|
||||
}
|
||||
@ -536,7 +547,10 @@ impl<'a> Compiler<'a> {
|
||||
}
|
||||
|
||||
if let Some(col) = poly_col {
|
||||
if let Some(alias) = type_aliases.get(table_to_alias).or_else(|| type_aliases.get(&node.parent_alias)) {
|
||||
if let Some(alias) = type_aliases
|
||||
.get(table_to_alias)
|
||||
.or_else(|| type_aliases.get(&node.parent_alias))
|
||||
{
|
||||
where_clauses.push(format!("{}.{} = '{}'", alias, col, type_name));
|
||||
}
|
||||
}
|
||||
@ -710,8 +724,6 @@ impl<'a> Compiler<'a> {
|
||||
) -> Result<(), String> {
|
||||
if let Some(prop_ref) = &node.property_name {
|
||||
let prop = prop_ref.as_str();
|
||||
println!("DEBUG: Eval prop: {}", prop);
|
||||
|
||||
let mut parent_relation_alias = node.parent_alias.clone();
|
||||
let mut child_relation_alias = base_alias.to_string();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user