changed identation to 2 spaces to match the rest of the project

This commit is contained in:
Ruslan Talpa
2015-09-25 12:04:44 +03:00
parent c42832f1c5
commit ff2c0b63e2
2 changed files with 191 additions and 189 deletions
+4 -2
View File
@@ -145,7 +145,8 @@ dbRequestToQuery (Node (Select mainTable colSelects tbls conditions _ ord) fores
--posible relations are Child Parent Many --posible relations are Child Parent Many
getQueryParts :: Tree Query -> ([Text], [Text]) -> ([Text], [Text]) getQueryParts :: Tree Query -> ([Text], [Text]) -> ([Text], [Text])
getQueryParts (Node q@(Select{qMainTable=table, qRelation=(Just (Relation {relType="child"}))}) forst) (w,s) = (w,sel:s) getQueryParts (Node q@(Select{qMainTable=table, qRelation=(Just (Relation {relType="child"}))}) forst) (w,s) = (w,sel:s)
where name = tableName table where
name = tableName table
sel = "(" sel = "("
<> "SELECT array_to_json(array_agg(row_to_json("<>name<>"))) " <> "SELECT array_to_json(array_agg(row_to_json("<>name<>"))) "
<> "FROM (" <> subquery <> ") " <> name <> "FROM (" <> subquery <> ") " <> name
@@ -153,7 +154,8 @@ dbRequestToQuery (Node (Select mainTable colSelects tbls conditions _ ord) fores
where (B.Stmt subquery _ _) = dbRequestToQuery (Node q forst) where (B.Stmt subquery _ _) = dbRequestToQuery (Node q forst)
getQueryParts (Node q@(Select{qMainTable=table, qRelation=(Just (Relation{relType="parent"}))}) forst) (w,s) = (wit:w,sel:s) getQueryParts (Node q@(Select{qMainTable=table, qRelation=(Just (Relation{relType="parent"}))}) forst) (w,s) = (wit:w,sel:s)
where name = tableName table where
name = tableName table
sel = "row_to_json(" <> name <> ".*) AS "<>name --TODO must be singular sel = "row_to_json(" <> name <> ".*) AS "<>name --TODO must be singular
wit = name <> " AS ( " <> subquery <> " )" wit = name <> " AS ( " <> subquery <> " )"
where (B.Stmt subquery _ _) = dbRequestToQuery (Node q forst) where (B.Stmt subquery _ _) = dbRequestToQuery (Node q forst)