diff --git a/snapshot-tests/anorm-sql/CompositeIdsTest/query2.sql b/snapshot-tests/anorm-sql/CompositeIdsTest/query2.sql index 6d2bd37ca..7961d98c8 100644 --- a/snapshot-tests/anorm-sql/CompositeIdsTest/query2.sql +++ b/snapshot-tests/anorm-sql/CompositeIdsTest/query2.sql @@ -1,5 +1,5 @@ with personemailaddress0 as ( - (select personemailaddress0 from "person"."emailaddress" personemailaddress0 where ((personemailaddress0).businessentityid, (personemailaddress0).emailaddressid) in (select unnest(?::int4[]), unnest(?::int4[]))) + (select personemailaddress0 from "person"."emailaddress" personemailaddress0 where ((personemailaddress0).businessentityid , (personemailaddress0).emailaddressid ) in (select unnest(?::int4[]), unnest(?::int4[]))) ) select (personemailaddress0)."businessentityid",(personemailaddress0)."emailaddressid",(personemailaddress0)."emailaddress",(personemailaddress0)."rowguid",(personemailaddress0)."modifieddate"::text from personemailaddress0 \ No newline at end of file diff --git a/snapshot-tests/anorm-sql/DSLTest/doubled.sql b/snapshot-tests/anorm-sql/DSLTest/doubled.sql index 395539f6a..4f34dd7b2 100644 --- a/snapshot-tests/anorm-sql/DSLTest/doubled.sql +++ b/snapshot-tests/anorm-sql/DSLTest/doubled.sql @@ -1,6 +1,6 @@ with salessalesperson0 as ( - (select salessalesperson0 from "sales"."salesperson" salessalesperson0 where ((salessalesperson0).rowguid = ?::uuid)) + (select salessalesperson0 from "sales"."salesperson" salessalesperson0 where ((salessalesperson0).rowguid = ?::uuid)) ), humanresourcesemployee0 as ( (select humanresourcesemployee0 from "humanresources"."employee" humanresourcesemployee0 ) @@ -9,7 +9,7 @@ join_cte5 as ( select salessalesperson0, humanresourcesemployee0 from salessalesperson0 join humanresourcesemployee0 - on ((salessalesperson0).businessentityid = (humanresourcesemployee0).businessentityid) + on ((salessalesperson0).businessentityid = (humanresourcesemployee0).businessentityid ) ), personperson0 as ( @@ -19,7 +19,7 @@ join_cte4 as ( select salessalesperson0, humanresourcesemployee0, personperson0 from join_cte5 join personperson0 - on ((humanresourcesemployee0).businessentityid = (personperson0).businessentityid) + on ((humanresourcesemployee0).businessentityid = (personperson0).businessentityid ) ), personbusinessentity0 as ( @@ -29,17 +29,17 @@ join_cte3 as ( select salessalesperson0, humanresourcesemployee0, personperson0, personbusinessentity0 from join_cte4 join personbusinessentity0 - on ((personperson0).businessentityid = (personbusinessentity0).businessentityid) + on ((personperson0).businessentityid = (personbusinessentity0).businessentityid ) ), personemailaddress0 as ( - (select personemailaddress0 from "person"."emailaddress" personemailaddress0 order by (personemailaddress0).rowguid ASC ) + (select personemailaddress0 from "person"."emailaddress" personemailaddress0 order by (personemailaddress0).rowguid ASC ) ), join_cte2 as ( select salessalesperson0, humanresourcesemployee0, personperson0, personbusinessentity0, personemailaddress0 from join_cte3 join personemailaddress0 - on ((personemailaddress0).businessentityid = (personbusinessentity0).businessentityid) + on ((personemailaddress0).businessentityid = (personbusinessentity0).businessentityid ) ), salessalesperson1 as ( @@ -49,11 +49,11 @@ join_cte1 as ( select salessalesperson0, humanresourcesemployee0, personperson0, personbusinessentity0, personemailaddress0, salessalesperson1 from join_cte2 join salessalesperson1 - on ((personemailaddress0).businessentityid = (salessalesperson1).businessentityid) + on ((personemailaddress0).businessentityid = (salessalesperson1).businessentityid ) ), salessalesperson2 as ( - (select salessalesperson2 from "sales"."salesperson" salessalesperson2 where ((salessalesperson2).rowguid = ?::uuid)) + (select salessalesperson2 from "sales"."salesperson" salessalesperson2 where ((salessalesperson2).rowguid = ?::uuid)) ), humanresourcesemployee1 as ( (select humanresourcesemployee1 from "humanresources"."employee" humanresourcesemployee1 ) @@ -62,7 +62,7 @@ join_cte10 as ( select salessalesperson2, humanresourcesemployee1 from salessalesperson2 join humanresourcesemployee1 - on ((salessalesperson2).businessentityid = (humanresourcesemployee1).businessentityid) + on ((salessalesperson2).businessentityid = (humanresourcesemployee1).businessentityid ) ), personperson1 as ( @@ -72,7 +72,7 @@ join_cte9 as ( select salessalesperson2, humanresourcesemployee1, personperson1 from join_cte10 join personperson1 - on ((humanresourcesemployee1).businessentityid = (personperson1).businessentityid) + on ((humanresourcesemployee1).businessentityid = (personperson1).businessentityid ) ), personbusinessentity1 as ( @@ -82,17 +82,17 @@ join_cte8 as ( select salessalesperson2, humanresourcesemployee1, personperson1, personbusinessentity1 from join_cte9 join personbusinessentity1 - on ((personperson1).businessentityid = (personbusinessentity1).businessentityid) + on ((personperson1).businessentityid = (personbusinessentity1).businessentityid ) ), personemailaddress1 as ( - (select personemailaddress1 from "person"."emailaddress" personemailaddress1 order by (personemailaddress1).rowguid ASC ) + (select personemailaddress1 from "person"."emailaddress" personemailaddress1 order by (personemailaddress1).rowguid ASC ) ), join_cte7 as ( select salessalesperson2, humanresourcesemployee1, personperson1, personbusinessentity1, personemailaddress1 from join_cte8 join personemailaddress1 - on ((personemailaddress1).businessentityid = (personbusinessentity1).businessentityid) + on ((personemailaddress1).businessentityid = (personbusinessentity1).businessentityid ) ), salessalesperson3 as ( @@ -102,14 +102,14 @@ join_cte6 as ( select salessalesperson2, humanresourcesemployee1, personperson1, personbusinessentity1, personemailaddress1, salessalesperson3 from join_cte7 join salessalesperson3 - on ((personemailaddress1).businessentityid = (salessalesperson3).businessentityid) + on ((personemailaddress1).businessentityid = (salessalesperson3).businessentityid ) ), join_cte0 as ( select salessalesperson0, humanresourcesemployee0, personperson0, personbusinessentity0, personemailaddress0, salessalesperson1, salessalesperson2, humanresourcesemployee1, personperson1, personbusinessentity1, personemailaddress1, salessalesperson3 from join_cte1 join join_cte6 - on ((personemailaddress0).businessentityid = (personemailaddress1).businessentityid) + on ((personemailaddress0).businessentityid = (personemailaddress1).businessentityid ) ) select (salessalesperson0)."businessentityid",(salessalesperson0)."territoryid",(salessalesperson0)."salesquota",(salessalesperson0)."bonus",(salessalesperson0)."commissionpct",(salessalesperson0)."salesytd",(salessalesperson0)."saleslastyear",(salessalesperson0)."rowguid",(salessalesperson0)."modifieddate"::text,(humanresourcesemployee0)."businessentityid",(humanresourcesemployee0)."nationalidnumber",(humanresourcesemployee0)."loginid",(humanresourcesemployee0)."jobtitle",(humanresourcesemployee0)."birthdate"::text,(humanresourcesemployee0)."maritalstatus",(humanresourcesemployee0)."gender",(humanresourcesemployee0)."hiredate"::text,(humanresourcesemployee0)."salariedflag",(humanresourcesemployee0)."vacationhours",(humanresourcesemployee0)."sickleavehours",(humanresourcesemployee0)."currentflag",(humanresourcesemployee0)."rowguid",(humanresourcesemployee0)."modifieddate"::text,(humanresourcesemployee0)."organizationnode",(personperson0)."businessentityid",(personperson0)."persontype",(personperson0)."namestyle",(personperson0)."title",(personperson0)."firstname",(personperson0)."middlename",(personperson0)."lastname",(personperson0)."suffix",(personperson0)."emailpromotion",(personperson0)."additionalcontactinfo",(personperson0)."demographics",(personperson0)."rowguid",(personperson0)."modifieddate"::text,(personbusinessentity0)."businessentityid",(personbusinessentity0)."rowguid",(personbusinessentity0)."modifieddate"::text,(personemailaddress0)."businessentityid",(personemailaddress0)."emailaddressid",(personemailaddress0)."emailaddress",(personemailaddress0)."rowguid",(personemailaddress0)."modifieddate"::text,(salessalesperson1)."businessentityid",(salessalesperson1)."territoryid",(salessalesperson1)."salesquota",(salessalesperson1)."bonus",(salessalesperson1)."commissionpct",(salessalesperson1)."salesytd",(salessalesperson1)."saleslastyear",(salessalesperson1)."rowguid",(salessalesperson1)."modifieddate"::text,(salessalesperson2)."businessentityid",(salessalesperson2)."territoryid",(salessalesperson2)."salesquota",(salessalesperson2)."bonus",(salessalesperson2)."commissionpct",(salessalesperson2)."salesytd",(salessalesperson2)."saleslastyear",(salessalesperson2)."rowguid",(salessalesperson2)."modifieddate"::text,(humanresourcesemployee1)."businessentityid",(humanresourcesemployee1)."nationalidnumber",(humanresourcesemployee1)."loginid",(humanresourcesemployee1)."jobtitle",(humanresourcesemployee1)."birthdate"::text,(humanresourcesemployee1)."maritalstatus",(humanresourcesemployee1)."gender",(humanresourcesemployee1)."hiredate"::text,(humanresourcesemployee1)."salariedflag",(humanresourcesemployee1)."vacationhours",(humanresourcesemployee1)."sickleavehours",(humanresourcesemployee1)."currentflag",(humanresourcesemployee1)."rowguid",(humanresourcesemployee1)."modifieddate"::text,(humanresourcesemployee1)."organizationnode",(personperson1)."businessentityid",(personperson1)."persontype",(personperson1)."namestyle",(personperson1)."title",(personperson1)."firstname",(personperson1)."middlename",(personperson1)."lastname",(personperson1)."suffix",(personperson1)."emailpromotion",(personperson1)."additionalcontactinfo",(personperson1)."demographics",(personperson1)."rowguid",(personperson1)."modifieddate"::text,(personbusinessentity1)."businessentityid",(personbusinessentity1)."rowguid",(personbusinessentity1)."modifieddate"::text,(personemailaddress1)."businessentityid",(personemailaddress1)."emailaddressid",(personemailaddress1)."emailaddress",(personemailaddress1)."rowguid",(personemailaddress1)."modifieddate"::text,(salessalesperson3)."businessentityid",(salessalesperson3)."territoryid",(salessalesperson3)."salesquota",(salessalesperson3)."bonus",(salessalesperson3)."commissionpct",(salessalesperson3)."salesytd",(salessalesperson3)."saleslastyear",(salessalesperson3)."rowguid",(salessalesperson3)."modifieddate"::text from join_cte0 \ No newline at end of file diff --git a/snapshot-tests/anorm-sql/ProductTest/delete.sql b/snapshot-tests/anorm-sql/ProductTest/delete.sql index 5436005f7..4d63d607f 100644 --- a/snapshot-tests/anorm-sql/ProductTest/delete.sql +++ b/snapshot-tests/anorm-sql/ProductTest/delete.sql @@ -1 +1 @@ -delete from "production"."product" where coalesce((productid = ?::INTEGER), ?::BOOLEAN) \ No newline at end of file +delete from "production"."product" where coalesce((productid = ?::INTEGER), ?::BOOLEAN) \ No newline at end of file diff --git a/snapshot-tests/anorm-sql/ProductTest/leftJoined.sql b/snapshot-tests/anorm-sql/ProductTest/leftJoined.sql index fa398a614..e756360c6 100644 --- a/snapshot-tests/anorm-sql/ProductTest/leftJoined.sql +++ b/snapshot-tests/anorm-sql/ProductTest/leftJoined.sql @@ -9,7 +9,7 @@ left_join_cte0 as ( select productionproduct0, productionproductmodel0 from productionproduct0 left join productionproductmodel0 - on ((productionproduct0).productmodelid = (productionproductmodel0).productmodelid) + on ((productionproduct0).productmodelid = (productionproductmodel0).productmodelid ) ) select (productionproduct0)."productid",(productionproduct0)."name",(productionproduct0)."productnumber",(productionproduct0)."makeflag",(productionproduct0)."finishedgoodsflag",(productionproduct0)."color",(productionproduct0)."safetystocklevel",(productionproduct0)."reorderpoint",(productionproduct0)."standardcost",(productionproduct0)."listprice",(productionproduct0)."size",(productionproduct0)."sizeunitmeasurecode",(productionproduct0)."weightunitmeasurecode",(productionproduct0)."weight",(productionproduct0)."daystomanufacture",(productionproduct0)."productline",(productionproduct0)."class",(productionproduct0)."style",(productionproduct0)."productsubcategoryid",(productionproduct0)."productmodelid",(productionproduct0)."sellstartdate"::text,(productionproduct0)."sellenddate"::text,(productionproduct0)."discontinueddate"::text,(productionproduct0)."rowguid",(productionproduct0)."modifieddate"::text,(productionproductmodel0)."productmodelid",(productionproductmodel0)."name",(productionproductmodel0)."catalogdescription",(productionproductmodel0)."instructions",(productionproductmodel0)."rowguid",(productionproductmodel0)."modifieddate"::text from left_join_cte0 \ No newline at end of file diff --git a/snapshot-tests/anorm-sql/ProductTest/q.sql b/snapshot-tests/anorm-sql/ProductTest/q.sql index 9d4bcaa63..ccae92f76 100644 --- a/snapshot-tests/anorm-sql/ProductTest/q.sql +++ b/snapshot-tests/anorm-sql/ProductTest/q.sql @@ -1,15 +1,15 @@ with productionproduct0 as ( - (select productionproduct0 from "production"."product" productionproduct0 where (((NOT ((productionproduct0).name LIKE ?::VARCHAR) AND NOT (((productionproduct0).name || (productionproduct0).color) LIKE ?::VARCHAR)) AND ((productionproduct0).daystomanufacture > ?::INTEGER)) AND ((productionproduct0).modifieddate < ?::timestamp))) + (select productionproduct0 from "production"."product" productionproduct0 where (((NOT ((productionproduct0).name LIKE ?::VARCHAR) AND NOT (((productionproduct0).name || (productionproduct0).color ) LIKE ?::VARCHAR)) AND ((productionproduct0).daystomanufacture > ?::INTEGER)) AND ((productionproduct0).modifieddate < ?::timestamp))) ), productionproductmodel0 as ( - (select productionproductmodel0 from "production"."productmodel" productionproductmodel0 where ((productionproductmodel0).modifieddate < ?::timestamp)) + (select productionproductmodel0 from "production"."productmodel" productionproductmodel0 where ((productionproductmodel0).modifieddate < ?::timestamp)) ), join_cte0 as ( select productionproduct0, productionproductmodel0 from productionproduct0 join productionproductmodel0 - on ((productionproduct0).productmodelid = (productionproductmodel0).productmodelid) - where NOT (productionproductmodel0).instructions IS NULL + on ((productionproduct0).productmodelid = (productionproductmodel0).productmodelid ) + where NOT (productionproductmodel0).instructions IS NULL ) select (productionproduct0)."productid",(productionproduct0)."name",(productionproduct0)."productnumber",(productionproduct0)."makeflag",(productionproduct0)."finishedgoodsflag",(productionproduct0)."color",(productionproduct0)."safetystocklevel",(productionproduct0)."reorderpoint",(productionproduct0)."standardcost",(productionproduct0)."listprice",(productionproduct0)."size",(productionproduct0)."sizeunitmeasurecode",(productionproduct0)."weightunitmeasurecode",(productionproduct0)."weight",(productionproduct0)."daystomanufacture",(productionproduct0)."productline",(productionproduct0)."class",(productionproduct0)."style",(productionproduct0)."productsubcategoryid",(productionproduct0)."productmodelid",(productionproduct0)."sellstartdate"::text,(productionproduct0)."sellenddate"::text,(productionproduct0)."discontinueddate"::text,(productionproduct0)."rowguid",(productionproduct0)."modifieddate"::text,(productionproductmodel0)."productmodelid",(productionproductmodel0)."name",(productionproductmodel0)."catalogdescription",(productionproductmodel0)."instructions",(productionproductmodel0)."rowguid",(productionproductmodel0)."modifieddate"::text from join_cte0 \ No newline at end of file diff --git a/snapshot-tests/anorm-sql/ProductTest/q2.sql b/snapshot-tests/anorm-sql/ProductTest/q2.sql index b08fafe8a..16c7dc1ab 100644 --- a/snapshot-tests/anorm-sql/ProductTest/q2.sql +++ b/snapshot-tests/anorm-sql/ProductTest/q2.sql @@ -1,25 +1,25 @@ with productionproduct0 as ( - (select productionproduct0 from "production"."product" productionproduct0 where (((((productionproduct0).productid = ANY(?) AND (length((productionproduct0).name) > ?::INTEGER)) AND NOT (((productionproduct0).name || (productionproduct0).color) LIKE ?::VARCHAR)) AND (coalesce((productionproduct0).color, ?::VARCHAR) != ?::VARCHAR)) AND ((productionproduct0).modifieddate < ?::timestamp))) + (select productionproduct0 from "production"."product" productionproduct0 where (((((productionproduct0).productid = ANY(?) AND (length((productionproduct0).name ) > ?::INTEGER)) AND NOT (((productionproduct0).name || (productionproduct0).color ) LIKE ?::VARCHAR)) AND (coalesce((productionproduct0).color , ?::VARCHAR) != ?::VARCHAR)) AND ((productionproduct0).modifieddate < ?::timestamp))) ), productionproductmodel0 as ( - (select productionproductmodel0 from "production"."productmodel" productionproductmodel0 where (length((productionproductmodel0).name) > ?::INTEGER)) + (select productionproductmodel0 from "production"."productmodel" productionproductmodel0 where (length((productionproductmodel0).name ) > ?::INTEGER)) ), join_cte0 as ( select productionproduct0, productionproductmodel0 from productionproduct0 join productionproductmodel0 - on ((productionproduct0).productmodelid = (productionproductmodel0).productmodelid) - where ((productionproductmodel0).name != ?::VARCHAR) + on ((productionproduct0).productmodelid = (productionproductmodel0).productmodelid ) + where ((productionproductmodel0).name != ?::VARCHAR) ), productionproductmodel1 as ( - (select productionproductmodel1 from "production"."productmodel" productionproductmodel1 where (length((productionproductmodel1).name) > ?::INTEGER)) + (select productionproductmodel1 from "production"."productmodel" productionproductmodel1 where (length((productionproductmodel1).name ) > ?::INTEGER)) ), left_join_cte0 as ( select productionproduct0, productionproductmodel0, productionproductmodel1 from join_cte0 left join productionproductmodel1 - on (((productionproduct0).productmodelid = (productionproductmodel1).productmodelid) AND ?::BOOLEAN) - order by (productionproductmodel1).name ASC , (productionproduct0).color DESC NULLS FIRST + on (((productionproduct0).productmodelid = (productionproductmodel1).productmodelid ) AND ?::BOOLEAN) + order by (productionproductmodel1).name ASC , (productionproduct0).color DESC NULLS FIRST ) select (productionproduct0)."productid",(productionproduct0)."name",(productionproduct0)."productnumber",(productionproduct0)."makeflag",(productionproduct0)."finishedgoodsflag",(productionproduct0)."color",(productionproduct0)."safetystocklevel",(productionproduct0)."reorderpoint",(productionproduct0)."standardcost",(productionproduct0)."listprice",(productionproduct0)."size",(productionproduct0)."sizeunitmeasurecode",(productionproduct0)."weightunitmeasurecode",(productionproduct0)."weight",(productionproduct0)."daystomanufacture",(productionproduct0)."productline",(productionproduct0)."class",(productionproduct0)."style",(productionproduct0)."productsubcategoryid",(productionproduct0)."productmodelid",(productionproduct0)."sellstartdate"::text,(productionproduct0)."sellenddate"::text,(productionproduct0)."discontinueddate"::text,(productionproduct0)."rowguid",(productionproduct0)."modifieddate"::text,(productionproductmodel0)."productmodelid",(productionproductmodel0)."name",(productionproductmodel0)."catalogdescription",(productionproductmodel0)."instructions",(productionproductmodel0)."rowguid",(productionproductmodel0)."modifieddate"::text,(productionproductmodel1)."productmodelid",(productionproductmodel1)."name",(productionproductmodel1)."catalogdescription",(productionproductmodel1)."instructions",(productionproductmodel1)."rowguid",(productionproductmodel1)."modifieddate"::text from left_join_cte0 \ No newline at end of file diff --git a/snapshot-tests/anorm-sql/ProductTest/query.sql b/snapshot-tests/anorm-sql/ProductTest/query.sql index 35a610cbb..09d005889 100644 --- a/snapshot-tests/anorm-sql/ProductTest/query.sql +++ b/snapshot-tests/anorm-sql/ProductTest/query.sql @@ -1,15 +1,15 @@ with productionproduct0 as ( - (select productionproduct0 from "production"."product" productionproduct0 where ((((productionproduct0).class = ?::VARCHAR) AND (((productionproduct0).daystomanufacture > ?::INTEGER) OR ((productionproduct0).daystomanufacture <= ?::INTEGER))) AND ((productionproduct0).productline = ?::VARCHAR))) + (select productionproduct0 from "production"."product" productionproduct0 where ((((productionproduct0).class = ?::VARCHAR) AND (((productionproduct0).daystomanufacture > ?::INTEGER) OR ((productionproduct0).daystomanufacture <= ?::INTEGER))) AND ((productionproduct0).productline = ?::VARCHAR))) ), productionunitmeasure0 as ( - (select productionunitmeasure0 from "production"."unitmeasure" productionunitmeasure0 where ((productionunitmeasure0).name LIKE ?::VARCHAR)) + (select productionunitmeasure0 from "production"."unitmeasure" productionunitmeasure0 where ((productionunitmeasure0).name LIKE ?::VARCHAR)) ), join_cte0 as ( select productionproduct0, productionunitmeasure0 from productionproduct0 join productionunitmeasure0 - on ((productionproduct0).sizeunitmeasurecode = (productionunitmeasure0).unitmeasurecode) + on ((productionproduct0).sizeunitmeasurecode = (productionunitmeasure0).unitmeasurecode ) ), productionproductmodel0 as ( @@ -19,7 +19,7 @@ left_join_cte0 as ( select productionproduct0, productionunitmeasure0, productionproductmodel0 from join_cte0 left join productionproductmodel0 - on ((productionproduct0).productmodelid = (productionproductmodel0).productmodelid) - where ((productionproduct0).productmodelid = (productionproductmodel0).productmodelid) order by (productionproduct0).productmodelid ASC , (productionproductmodel0).name DESC NULLS FIRST + on ((productionproduct0).productmodelid = (productionproductmodel0).productmodelid ) + where ((productionproduct0).productmodelid = (productionproductmodel0).productmodelid ) order by (productionproduct0).productmodelid ASC , (productionproductmodel0).name DESC NULLS FIRST ) select (productionproduct0)."productid",(productionproduct0)."name",(productionproduct0)."productnumber",(productionproduct0)."makeflag",(productionproduct0)."finishedgoodsflag",(productionproduct0)."color",(productionproduct0)."safetystocklevel",(productionproduct0)."reorderpoint",(productionproduct0)."standardcost",(productionproduct0)."listprice",(productionproduct0)."size",(productionproduct0)."sizeunitmeasurecode",(productionproduct0)."weightunitmeasurecode",(productionproduct0)."weight",(productionproduct0)."daystomanufacture",(productionproduct0)."productline",(productionproduct0)."class",(productionproduct0)."style",(productionproduct0)."productsubcategoryid",(productionproduct0)."productmodelid",(productionproduct0)."sellstartdate"::text,(productionproduct0)."sellenddate"::text,(productionproduct0)."discontinueddate"::text,(productionproduct0)."rowguid",(productionproduct0)."modifieddate"::text,(productionunitmeasure0)."unitmeasurecode",(productionunitmeasure0)."name",(productionunitmeasure0)."modifieddate"::text,(productionproductmodel0)."productmodelid",(productionproductmodel0)."name",(productionproductmodel0)."catalogdescription",(productionproductmodel0)."instructions",(productionproductmodel0)."rowguid",(productionproductmodel0)."modifieddate"::text from left_join_cte0 \ No newline at end of file diff --git a/snapshot-tests/anorm-sql/ProductTest/query0.sql b/snapshot-tests/anorm-sql/ProductTest/query0.sql index 5d3c308e1..489cfe0f1 100644 --- a/snapshot-tests/anorm-sql/ProductTest/query0.sql +++ b/snapshot-tests/anorm-sql/ProductTest/query0.sql @@ -9,7 +9,7 @@ join_cte2 as ( select productionproduct0, productionproductmodel0 from productionproduct0 join productionproductmodel0 - on ((productionproduct0).productmodelid = (productionproductmodel0).productmodelid) + on ((productionproduct0).productmodelid = (productionproductmodel0).productmodelid ) ), productionproductsubcategory0 as ( @@ -19,7 +19,7 @@ join_cte1 as ( select productionproduct0, productionproductmodel0, productionproductsubcategory0 from join_cte2 join productionproductsubcategory0 - on ((productionproduct0).productsubcategoryid = (productionproductsubcategory0).productsubcategoryid) + on ((productionproduct0).productsubcategoryid = (productionproductsubcategory0).productsubcategoryid ) ), productionproductcategory0 as ( @@ -29,7 +29,7 @@ join_cte0 as ( select productionproduct0, productionproductmodel0, productionproductsubcategory0, productionproductcategory0 from join_cte1 join productionproductcategory0 - on ((productionproductsubcategory0).productcategoryid = (productionproductcategory0).productcategoryid) + on ((productionproductsubcategory0).productcategoryid = (productionproductcategory0).productcategoryid ) ) select (productionproduct0)."productid",(productionproduct0)."name",(productionproduct0)."productnumber",(productionproduct0)."makeflag",(productionproduct0)."finishedgoodsflag",(productionproduct0)."color",(productionproduct0)."safetystocklevel",(productionproduct0)."reorderpoint",(productionproduct0)."standardcost",(productionproduct0)."listprice",(productionproduct0)."size",(productionproduct0)."sizeunitmeasurecode",(productionproduct0)."weightunitmeasurecode",(productionproduct0)."weight",(productionproduct0)."daystomanufacture",(productionproduct0)."productline",(productionproduct0)."class",(productionproduct0)."style",(productionproduct0)."productsubcategoryid",(productionproduct0)."productmodelid",(productionproduct0)."sellstartdate"::text,(productionproduct0)."sellenddate"::text,(productionproduct0)."discontinueddate"::text,(productionproduct0)."rowguid",(productionproduct0)."modifieddate"::text,(productionproductmodel0)."productmodelid",(productionproductmodel0)."name",(productionproductmodel0)."catalogdescription",(productionproductmodel0)."instructions",(productionproductmodel0)."rowguid",(productionproductmodel0)."modifieddate"::text,(productionproductsubcategory0)."productsubcategoryid",(productionproductsubcategory0)."productcategoryid",(productionproductsubcategory0)."name",(productionproductsubcategory0)."rowguid",(productionproductsubcategory0)."modifieddate"::text,(productionproductcategory0)."productcategoryid",(productionproductcategory0)."name",(productionproductcategory0)."rowguid",(productionproductcategory0)."modifieddate"::text from join_cte0 \ No newline at end of file diff --git a/snapshot-tests/anorm-sql/ProductTest/updateReturning.sql b/snapshot-tests/anorm-sql/ProductTest/updateReturning.sql index 3cd169e27..de7e2062d 100644 --- a/snapshot-tests/anorm-sql/ProductTest/updateReturning.sql +++ b/snapshot-tests/anorm-sql/ProductTest/updateReturning.sql @@ -1 +1 @@ -update "production"."product" set name = substring((upper(reverse(name)) || ?::"public"."Name"), ?::INTEGER, ?::INTEGER)::varchar, listprice = ?::DECIMAL::numeric, reorderpoint = (reorderpoint + ?::int2)::int2, sizeunitmeasurecode = ?::VARCHAR::bpchar, sellstartdate = ?::timestamp::timestamp where coalesce((productid = ?::INTEGER), ?::BOOLEAN) returning "productid","name","productnumber","makeflag","finishedgoodsflag","color","safetystocklevel","reorderpoint","standardcost","listprice","size","sizeunitmeasurecode","weightunitmeasurecode","weight","daystomanufacture","productline","class","style","productsubcategoryid","productmodelid","sellstartdate"::text,"sellenddate"::text,"discontinueddate"::text,"rowguid","modifieddate"::text \ No newline at end of file +update "production"."product" set name = substring((upper(reverse(name )) || ?::"public"."Name"), ?::INTEGER, ?::INTEGER)::varchar, listprice = ?::DECIMAL::numeric, reorderpoint = (reorderpoint + ?::int2)::int2, sizeunitmeasurecode = ?::VARCHAR::bpchar, sellstartdate = ?::timestamp::timestamp where coalesce((productid = ?::INTEGER), ?::BOOLEAN) returning "productid","name","productnumber","makeflag","finishedgoodsflag","color","safetystocklevel","reorderpoint","standardcost","listprice","size","sizeunitmeasurecode","weightunitmeasurecode","weight","daystomanufacture","productline","class","style","productsubcategoryid","productmodelid","sellstartdate"::text,"sellenddate"::text,"discontinueddate"::text,"rowguid","modifieddate"::text \ No newline at end of file diff --git a/snapshot-tests/anorm-sql/SeekTest/complex.sql b/snapshot-tests/anorm-sql/SeekTest/complex.sql index 1a322502d..60a2639ce 100644 --- a/snapshot-tests/anorm-sql/SeekTest/complex.sql +++ b/snapshot-tests/anorm-sql/SeekTest/complex.sql @@ -1,5 +1,5 @@ with productionproduct0 as ( - (select productionproduct0 from "production"."product" productionproduct0 where ((((productionproduct0).name > ?::"public"."Name") OR (((productionproduct0).name = ?::"public"."Name") AND ((productionproduct0).weight < ?::DECIMAL))) OR ((((productionproduct0).name = ?::"public"."Name") AND ((productionproduct0).weight = ?::DECIMAL)) AND ((productionproduct0).listprice < ?::DECIMAL))) order by (productionproduct0).name ASC , (productionproduct0).weight DESC , (productionproduct0).listprice DESC ) + (select productionproduct0 from "production"."product" productionproduct0 where ((((productionproduct0).name > ?::"public"."Name") OR (((productionproduct0).name = ?::"public"."Name") AND ((productionproduct0).weight < ?::DECIMAL))) OR ((((productionproduct0).name = ?::"public"."Name") AND ((productionproduct0).weight = ?::DECIMAL)) AND ((productionproduct0).listprice < ?::DECIMAL))) order by (productionproduct0).name ASC , (productionproduct0).weight DESC , (productionproduct0).listprice DESC ) ) select (productionproduct0)."productid",(productionproduct0)."name",(productionproduct0)."productnumber",(productionproduct0)."makeflag",(productionproduct0)."finishedgoodsflag",(productionproduct0)."color",(productionproduct0)."safetystocklevel",(productionproduct0)."reorderpoint",(productionproduct0)."standardcost",(productionproduct0)."listprice",(productionproduct0)."size",(productionproduct0)."sizeunitmeasurecode",(productionproduct0)."weightunitmeasurecode",(productionproduct0)."weight",(productionproduct0)."daystomanufacture",(productionproduct0)."productline",(productionproduct0)."class",(productionproduct0)."style",(productionproduct0)."productsubcategoryid",(productionproduct0)."productmodelid",(productionproduct0)."sellstartdate"::text,(productionproduct0)."sellenddate"::text,(productionproduct0)."discontinueddate"::text,(productionproduct0)."rowguid",(productionproduct0)."modifieddate"::text from productionproduct0 \ No newline at end of file diff --git a/snapshot-tests/anorm-sql/SeekTest/uniform-ascending.sql b/snapshot-tests/anorm-sql/SeekTest/uniform-ascending.sql index e07d5567f..62794a7ed 100644 --- a/snapshot-tests/anorm-sql/SeekTest/uniform-ascending.sql +++ b/snapshot-tests/anorm-sql/SeekTest/uniform-ascending.sql @@ -1,5 +1,5 @@ with productionproduct0 as ( - (select productionproduct0 from "production"."product" productionproduct0 where (((productionproduct0).name,(productionproduct0).weight,(productionproduct0).listprice) > (?::"public"."Name",?::DECIMAL,?::DECIMAL)) order by (productionproduct0).name ASC , (productionproduct0).weight ASC , (productionproduct0).listprice ASC ) + (select productionproduct0 from "production"."product" productionproduct0 where (((productionproduct0).name ,(productionproduct0).weight ,(productionproduct0).listprice ) > (?::"public"."Name",?::DECIMAL,?::DECIMAL)) order by (productionproduct0).name ASC , (productionproduct0).weight ASC , (productionproduct0).listprice ASC ) ) select (productionproduct0)."productid",(productionproduct0)."name",(productionproduct0)."productnumber",(productionproduct0)."makeflag",(productionproduct0)."finishedgoodsflag",(productionproduct0)."color",(productionproduct0)."safetystocklevel",(productionproduct0)."reorderpoint",(productionproduct0)."standardcost",(productionproduct0)."listprice",(productionproduct0)."size",(productionproduct0)."sizeunitmeasurecode",(productionproduct0)."weightunitmeasurecode",(productionproduct0)."weight",(productionproduct0)."daystomanufacture",(productionproduct0)."productline",(productionproduct0)."class",(productionproduct0)."style",(productionproduct0)."productsubcategoryid",(productionproduct0)."productmodelid",(productionproduct0)."sellstartdate"::text,(productionproduct0)."sellenddate"::text,(productionproduct0)."discontinueddate"::text,(productionproduct0)."rowguid",(productionproduct0)."modifieddate"::text from productionproduct0 \ No newline at end of file diff --git a/snapshot-tests/anorm-sql/SeekTest/uniform-descending.sql b/snapshot-tests/anorm-sql/SeekTest/uniform-descending.sql index c3cc010c8..d6bd64fb5 100644 --- a/snapshot-tests/anorm-sql/SeekTest/uniform-descending.sql +++ b/snapshot-tests/anorm-sql/SeekTest/uniform-descending.sql @@ -1,5 +1,5 @@ with productionproduct0 as ( - (select productionproduct0 from "production"."product" productionproduct0 where (((productionproduct0).name,(productionproduct0).weight,(productionproduct0).listprice) < (?::"public"."Name",?::DECIMAL,?::DECIMAL)) order by (productionproduct0).name DESC , (productionproduct0).weight DESC , (productionproduct0).listprice DESC ) + (select productionproduct0 from "production"."product" productionproduct0 where (((productionproduct0).name ,(productionproduct0).weight ,(productionproduct0).listprice ) < (?::"public"."Name",?::DECIMAL,?::DECIMAL)) order by (productionproduct0).name DESC , (productionproduct0).weight DESC , (productionproduct0).listprice DESC ) ) select (productionproduct0)."productid",(productionproduct0)."name",(productionproduct0)."productnumber",(productionproduct0)."makeflag",(productionproduct0)."finishedgoodsflag",(productionproduct0)."color",(productionproduct0)."safetystocklevel",(productionproduct0)."reorderpoint",(productionproduct0)."standardcost",(productionproduct0)."listprice",(productionproduct0)."size",(productionproduct0)."sizeunitmeasurecode",(productionproduct0)."weightunitmeasurecode",(productionproduct0)."weight",(productionproduct0)."daystomanufacture",(productionproduct0)."productline",(productionproduct0)."class",(productionproduct0)."style",(productionproduct0)."productsubcategoryid",(productionproduct0)."productmodelid",(productionproduct0)."sellstartdate"::text,(productionproduct0)."sellenddate"::text,(productionproduct0)."discontinueddate"::text,(productionproduct0)."rowguid",(productionproduct0)."modifieddate"::text from productionproduct0 \ No newline at end of file diff --git a/snapshot-tests/dooble-sql/CompositeIdsTest/query2.sql b/snapshot-tests/dooble-sql/CompositeIdsTest/query2.sql index c8847bc34..4838cdfde 100644 --- a/snapshot-tests/dooble-sql/CompositeIdsTest/query2.sql +++ b/snapshot-tests/dooble-sql/CompositeIdsTest/query2.sql @@ -1,5 +1,5 @@ with personemailaddress0 as ( - (select personemailaddress0 from "person"."emailaddress" personemailaddress0 WHERE ((personemailaddress0).businessentityid , (personemailaddress0).emailaddressid ) in (select unnest(?::_int4 ), unnest(?::_int4 ))) + (select personemailaddress0 from "person"."emailaddress" personemailaddress0 WHERE ((personemailaddress0).businessentityid , (personemailaddress0).emailaddressid ) in (select unnest(?::_int4 ), unnest(?::_int4 ))) ) select (personemailaddress0)."businessentityid",(personemailaddress0)."emailaddressid",(personemailaddress0)."emailaddress",(personemailaddress0)."rowguid",(personemailaddress0)."modifieddate"::text from personemailaddress0 \ No newline at end of file diff --git a/snapshot-tests/dooble-sql/DSLTest/doubled.sql b/snapshot-tests/dooble-sql/DSLTest/doubled.sql index 5745b9217..0cfdb75e3 100644 --- a/snapshot-tests/dooble-sql/DSLTest/doubled.sql +++ b/snapshot-tests/dooble-sql/DSLTest/doubled.sql @@ -1,6 +1,6 @@ with salessalesperson0 as ( - (select salessalesperson0 from "sales"."salesperson" salessalesperson0 WHERE ((salessalesperson0).rowguid = ?::uuid ) ) + (select salessalesperson0 from "sales"."salesperson" salessalesperson0 WHERE ((salessalesperson0).rowguid = ?::uuid ) ) ) , humanresourcesemployee0 as ( (select humanresourcesemployee0 from "humanresources"."employee" humanresourcesemployee0 ) @@ -9,7 +9,7 @@ join_cte5 as ( select salessalesperson0, humanresourcesemployee0 from salessalesperson0 join humanresourcesemployee0 - on ((salessalesperson0).businessentityid = (humanresourcesemployee0).businessentityid) + on ((salessalesperson0).businessentityid = (humanresourcesemployee0).businessentityid ) ) , personperson0 as ( @@ -19,7 +19,7 @@ join_cte4 as ( select salessalesperson0, humanresourcesemployee0, personperson0 from join_cte5 join personperson0 - on ((humanresourcesemployee0).businessentityid = (personperson0).businessentityid) + on ((humanresourcesemployee0).businessentityid = (personperson0).businessentityid ) ) , personbusinessentity0 as ( @@ -29,17 +29,17 @@ join_cte3 as ( select salessalesperson0, humanresourcesemployee0, personperson0, personbusinessentity0 from join_cte4 join personbusinessentity0 - on ((personperson0).businessentityid = (personbusinessentity0).businessentityid) + on ((personperson0).businessentityid = (personbusinessentity0).businessentityid ) ) , personemailaddress0 as ( - (select personemailaddress0 from "person"."emailaddress" personemailaddress0 ORDER BY (personemailaddress0).rowguid ASC ) + (select personemailaddress0 from "person"."emailaddress" personemailaddress0 ORDER BY (personemailaddress0).rowguid ASC ) ) , join_cte2 as ( select salessalesperson0, humanresourcesemployee0, personperson0, personbusinessentity0, personemailaddress0 from join_cte3 join personemailaddress0 - on ((personemailaddress0).businessentityid = (personbusinessentity0).businessentityid) + on ((personemailaddress0).businessentityid = (personbusinessentity0).businessentityid ) ) , salessalesperson1 as ( @@ -49,11 +49,11 @@ join_cte1 as ( select salessalesperson0, humanresourcesemployee0, personperson0, personbusinessentity0, personemailaddress0, salessalesperson1 from join_cte2 join salessalesperson1 - on ((personemailaddress0).businessentityid = (salessalesperson1).businessentityid) + on ((personemailaddress0).businessentityid = (salessalesperson1).businessentityid ) ) , salessalesperson2 as ( - (select salessalesperson2 from "sales"."salesperson" salessalesperson2 WHERE ((salessalesperson2).rowguid = ?::uuid ) ) + (select salessalesperson2 from "sales"."salesperson" salessalesperson2 WHERE ((salessalesperson2).rowguid = ?::uuid ) ) ) , humanresourcesemployee1 as ( (select humanresourcesemployee1 from "humanresources"."employee" humanresourcesemployee1 ) @@ -62,7 +62,7 @@ join_cte10 as ( select salessalesperson2, humanresourcesemployee1 from salessalesperson2 join humanresourcesemployee1 - on ((salessalesperson2).businessentityid = (humanresourcesemployee1).businessentityid) + on ((salessalesperson2).businessentityid = (humanresourcesemployee1).businessentityid ) ) , personperson1 as ( @@ -72,7 +72,7 @@ join_cte9 as ( select salessalesperson2, humanresourcesemployee1, personperson1 from join_cte10 join personperson1 - on ((humanresourcesemployee1).businessentityid = (personperson1).businessentityid) + on ((humanresourcesemployee1).businessentityid = (personperson1).businessentityid ) ) , personbusinessentity1 as ( @@ -82,17 +82,17 @@ join_cte8 as ( select salessalesperson2, humanresourcesemployee1, personperson1, personbusinessentity1 from join_cte9 join personbusinessentity1 - on ((personperson1).businessentityid = (personbusinessentity1).businessentityid) + on ((personperson1).businessentityid = (personbusinessentity1).businessentityid ) ) , personemailaddress1 as ( - (select personemailaddress1 from "person"."emailaddress" personemailaddress1 ORDER BY (personemailaddress1).rowguid ASC ) + (select personemailaddress1 from "person"."emailaddress" personemailaddress1 ORDER BY (personemailaddress1).rowguid ASC ) ) , join_cte7 as ( select salessalesperson2, humanresourcesemployee1, personperson1, personbusinessentity1, personemailaddress1 from join_cte8 join personemailaddress1 - on ((personemailaddress1).businessentityid = (personbusinessentity1).businessentityid) + on ((personemailaddress1).businessentityid = (personbusinessentity1).businessentityid ) ) , salessalesperson3 as ( @@ -102,14 +102,14 @@ join_cte6 as ( select salessalesperson2, humanresourcesemployee1, personperson1, personbusinessentity1, personemailaddress1, salessalesperson3 from join_cte7 join salessalesperson3 - on ((personemailaddress1).businessentityid = (salessalesperson3).businessentityid) + on ((personemailaddress1).businessentityid = (salessalesperson3).businessentityid ) ) , join_cte0 as ( select salessalesperson0, humanresourcesemployee0, personperson0, personbusinessentity0, personemailaddress0, salessalesperson1, salessalesperson2, humanresourcesemployee1, personperson1, personbusinessentity1, personemailaddress1, salessalesperson3 from join_cte1 join join_cte6 - on ((personemailaddress0).businessentityid = (personemailaddress1).businessentityid) + on ((personemailaddress0).businessentityid = (personemailaddress1).businessentityid ) ) select (salessalesperson0)."businessentityid",(salessalesperson0)."territoryid",(salessalesperson0)."salesquota",(salessalesperson0)."bonus",(salessalesperson0)."commissionpct",(salessalesperson0)."salesytd",(salessalesperson0)."saleslastyear",(salessalesperson0)."rowguid",(salessalesperson0)."modifieddate"::text,(humanresourcesemployee0)."businessentityid",(humanresourcesemployee0)."nationalidnumber",(humanresourcesemployee0)."loginid",(humanresourcesemployee0)."jobtitle",(humanresourcesemployee0)."birthdate"::text,(humanresourcesemployee0)."maritalstatus",(humanresourcesemployee0)."gender",(humanresourcesemployee0)."hiredate"::text,(humanresourcesemployee0)."salariedflag",(humanresourcesemployee0)."vacationhours",(humanresourcesemployee0)."sickleavehours",(humanresourcesemployee0)."currentflag",(humanresourcesemployee0)."rowguid",(humanresourcesemployee0)."modifieddate"::text,(humanresourcesemployee0)."organizationnode",(personperson0)."businessentityid",(personperson0)."persontype",(personperson0)."namestyle",(personperson0)."title",(personperson0)."firstname",(personperson0)."middlename",(personperson0)."lastname",(personperson0)."suffix",(personperson0)."emailpromotion",(personperson0)."additionalcontactinfo",(personperson0)."demographics",(personperson0)."rowguid",(personperson0)."modifieddate"::text,(personbusinessentity0)."businessentityid",(personbusinessentity0)."rowguid",(personbusinessentity0)."modifieddate"::text,(personemailaddress0)."businessentityid",(personemailaddress0)."emailaddressid",(personemailaddress0)."emailaddress",(personemailaddress0)."rowguid",(personemailaddress0)."modifieddate"::text,(salessalesperson1)."businessentityid",(salessalesperson1)."territoryid",(salessalesperson1)."salesquota",(salessalesperson1)."bonus",(salessalesperson1)."commissionpct",(salessalesperson1)."salesytd",(salessalesperson1)."saleslastyear",(salessalesperson1)."rowguid",(salessalesperson1)."modifieddate"::text,(salessalesperson2)."businessentityid",(salessalesperson2)."territoryid",(salessalesperson2)."salesquota",(salessalesperson2)."bonus",(salessalesperson2)."commissionpct",(salessalesperson2)."salesytd",(salessalesperson2)."saleslastyear",(salessalesperson2)."rowguid",(salessalesperson2)."modifieddate"::text,(humanresourcesemployee1)."businessentityid",(humanresourcesemployee1)."nationalidnumber",(humanresourcesemployee1)."loginid",(humanresourcesemployee1)."jobtitle",(humanresourcesemployee1)."birthdate"::text,(humanresourcesemployee1)."maritalstatus",(humanresourcesemployee1)."gender",(humanresourcesemployee1)."hiredate"::text,(humanresourcesemployee1)."salariedflag",(humanresourcesemployee1)."vacationhours",(humanresourcesemployee1)."sickleavehours",(humanresourcesemployee1)."currentflag",(humanresourcesemployee1)."rowguid",(humanresourcesemployee1)."modifieddate"::text,(humanresourcesemployee1)."organizationnode",(personperson1)."businessentityid",(personperson1)."persontype",(personperson1)."namestyle",(personperson1)."title",(personperson1)."firstname",(personperson1)."middlename",(personperson1)."lastname",(personperson1)."suffix",(personperson1)."emailpromotion",(personperson1)."additionalcontactinfo",(personperson1)."demographics",(personperson1)."rowguid",(personperson1)."modifieddate"::text,(personbusinessentity1)."businessentityid",(personbusinessentity1)."rowguid",(personbusinessentity1)."modifieddate"::text,(personemailaddress1)."businessentityid",(personemailaddress1)."emailaddressid",(personemailaddress1)."emailaddress",(personemailaddress1)."rowguid",(personemailaddress1)."modifieddate"::text,(salessalesperson3)."businessentityid",(salessalesperson3)."territoryid",(salessalesperson3)."salesquota",(salessalesperson3)."bonus",(salessalesperson3)."commissionpct",(salessalesperson3)."salesytd",(salessalesperson3)."saleslastyear",(salessalesperson3)."rowguid",(salessalesperson3)."modifieddate"::text from join_cte0 \ No newline at end of file diff --git a/snapshot-tests/dooble-sql/ProductTest/delete.sql b/snapshot-tests/dooble-sql/ProductTest/delete.sql index 00c95b8b4..7f473d622 100644 --- a/snapshot-tests/dooble-sql/ProductTest/delete.sql +++ b/snapshot-tests/dooble-sql/ProductTest/delete.sql @@ -1 +1 @@ -delete from "production"."product" where coalesce((productid = ? ) , ? ) \ No newline at end of file +delete from "production"."product" where coalesce((productid = ? ) , ? ) \ No newline at end of file diff --git a/snapshot-tests/dooble-sql/ProductTest/leftJoined.sql b/snapshot-tests/dooble-sql/ProductTest/leftJoined.sql index 334168562..e08c91d0d 100644 --- a/snapshot-tests/dooble-sql/ProductTest/leftJoined.sql +++ b/snapshot-tests/dooble-sql/ProductTest/leftJoined.sql @@ -9,7 +9,7 @@ left_join_cte0 as ( select productionproduct0, productionproductmodel0 from productionproduct0 left join productionproductmodel0 - on ((productionproduct0).productmodelid = (productionproductmodel0).productmodelid) + on ((productionproduct0).productmodelid = (productionproductmodel0).productmodelid ) ) select (productionproduct0)."productid",(productionproduct0)."name",(productionproduct0)."productnumber",(productionproduct0)."makeflag",(productionproduct0)."finishedgoodsflag",(productionproduct0)."color",(productionproduct0)."safetystocklevel",(productionproduct0)."reorderpoint",(productionproduct0)."standardcost",(productionproduct0)."listprice",(productionproduct0)."size",(productionproduct0)."sizeunitmeasurecode",(productionproduct0)."weightunitmeasurecode",(productionproduct0)."weight",(productionproduct0)."daystomanufacture",(productionproduct0)."productline",(productionproduct0)."class",(productionproduct0)."style",(productionproduct0)."productsubcategoryid",(productionproduct0)."productmodelid",(productionproduct0)."sellstartdate"::text,(productionproduct0)."sellenddate"::text,(productionproduct0)."discontinueddate"::text,(productionproduct0)."rowguid",(productionproduct0)."modifieddate"::text,(productionproductmodel0)."productmodelid",(productionproductmodel0)."name",(productionproductmodel0)."catalogdescription",(productionproductmodel0)."instructions",(productionproductmodel0)."rowguid",(productionproductmodel0)."modifieddate"::text from left_join_cte0 \ No newline at end of file diff --git a/snapshot-tests/dooble-sql/ProductTest/q.sql b/snapshot-tests/dooble-sql/ProductTest/q.sql index 1672ef60e..511ebee5a 100644 --- a/snapshot-tests/dooble-sql/ProductTest/q.sql +++ b/snapshot-tests/dooble-sql/ProductTest/q.sql @@ -1,15 +1,15 @@ with productionproduct0 as ( - (select productionproduct0 from "production"."product" productionproduct0 WHERE NOT ((productionproduct0).name LIKE ? ) AND NOT (((productionproduct0).name || (productionproduct0).color) LIKE ? ) AND ((productionproduct0).daystomanufacture > ? ) AND ((productionproduct0).modifieddate < ?::timestamp ) ) + (select productionproduct0 from "production"."product" productionproduct0 WHERE NOT ((productionproduct0).name LIKE ? ) AND NOT (((productionproduct0).name || (productionproduct0).color ) LIKE ? ) AND ((productionproduct0).daystomanufacture > ? ) AND ((productionproduct0).modifieddate < ?::timestamp ) ) ) , productionproductmodel0 as ( - (select productionproductmodel0 from "production"."productmodel" productionproductmodel0 WHERE ((productionproductmodel0).modifieddate < ?::timestamp ) ) + (select productionproductmodel0 from "production"."productmodel" productionproductmodel0 WHERE ((productionproductmodel0).modifieddate < ?::timestamp ) ) ) , join_cte0 as ( select productionproduct0, productionproductmodel0 from productionproduct0 join productionproductmodel0 - on ((productionproduct0).productmodelid = (productionproductmodel0).productmodelid) - WHERE NOT (productionproductmodel0).instructions IS NULL + on ((productionproduct0).productmodelid = (productionproductmodel0).productmodelid ) + WHERE NOT (productionproductmodel0).instructions IS NULL ) select (productionproduct0)."productid",(productionproduct0)."name",(productionproduct0)."productnumber",(productionproduct0)."makeflag",(productionproduct0)."finishedgoodsflag",(productionproduct0)."color",(productionproduct0)."safetystocklevel",(productionproduct0)."reorderpoint",(productionproduct0)."standardcost",(productionproduct0)."listprice",(productionproduct0)."size",(productionproduct0)."sizeunitmeasurecode",(productionproduct0)."weightunitmeasurecode",(productionproduct0)."weight",(productionproduct0)."daystomanufacture",(productionproduct0)."productline",(productionproduct0)."class",(productionproduct0)."style",(productionproduct0)."productsubcategoryid",(productionproduct0)."productmodelid",(productionproduct0)."sellstartdate"::text,(productionproduct0)."sellenddate"::text,(productionproduct0)."discontinueddate"::text,(productionproduct0)."rowguid",(productionproduct0)."modifieddate"::text,(productionproductmodel0)."productmodelid",(productionproductmodel0)."name",(productionproductmodel0)."catalogdescription",(productionproductmodel0)."instructions",(productionproductmodel0)."rowguid",(productionproductmodel0)."modifieddate"::text from join_cte0 \ No newline at end of file diff --git a/snapshot-tests/dooble-sql/ProductTest/q2.sql b/snapshot-tests/dooble-sql/ProductTest/q2.sql index 657e54923..5d1f7139e 100644 --- a/snapshot-tests/dooble-sql/ProductTest/q2.sql +++ b/snapshot-tests/dooble-sql/ProductTest/q2.sql @@ -1,25 +1,25 @@ with productionproduct0 as ( - (select productionproduct0 from "production"."product" productionproduct0 WHERE (productionproduct0).productid = ANY(?) AND (length((productionproduct0).name) > ? ) AND NOT (((productionproduct0).name || (productionproduct0).color) LIKE ? ) AND (coalesce(length((productionproduct0).color) , ? ) > ? ) AND ((productionproduct0).modifieddate < ?::timestamp ) ) + (select productionproduct0 from "production"."product" productionproduct0 WHERE (productionproduct0).productid = ANY(?) AND (length((productionproduct0).name ) > ? ) AND NOT (((productionproduct0).name || (productionproduct0).color ) LIKE ? ) AND (coalesce(length((productionproduct0).color ) , ? ) > ? ) AND ((productionproduct0).modifieddate < ?::timestamp ) ) ) , productionproductmodel0 as ( - (select productionproductmodel0 from "production"."productmodel" productionproductmodel0 WHERE NOT ((productionproductmodel0).name LIKE ? ) ) + (select productionproductmodel0 from "production"."productmodel" productionproductmodel0 WHERE NOT ((productionproductmodel0).name LIKE ? ) ) ) , join_cte0 as ( select productionproduct0, productionproductmodel0 from productionproduct0 join productionproductmodel0 - on ((productionproduct0).productmodelid = (productionproductmodel0).productmodelid) - WHERE ((productionproductmodel0).productmodelid > ? ) + on ((productionproduct0).productmodelid = (productionproductmodel0).productmodelid ) + WHERE ((productionproductmodel0).productmodelid > ? ) ) , productionproductmodel1 as ( - (select productionproductmodel1 from "production"."productmodel" productionproductmodel1 WHERE NOT ((productionproductmodel1).name LIKE ? ) ) + (select productionproductmodel1 from "production"."productmodel" productionproductmodel1 WHERE NOT ((productionproductmodel1).name LIKE ? ) ) ) , left_join_cte0 as ( select productionproduct0, productionproductmodel0, productionproductmodel1 from join_cte0 left join productionproductmodel1 - on (((productionproduct0).productmodelid = (productionproductmodel1).productmodelid) AND ? ) - ORDER BY (productionproduct0).name ASC , (productionproductmodel0).rowguid DESC NULLS FIRST , (productionproductmodel1).rowguid ASC + on (((productionproduct0).productmodelid = (productionproductmodel1).productmodelid ) AND ? ) + ORDER BY (productionproduct0).name ASC , (productionproductmodel0).rowguid DESC NULLS FIRST , (productionproductmodel1).rowguid ASC ) select (productionproduct0)."productid",(productionproduct0)."name",(productionproduct0)."productnumber",(productionproduct0)."makeflag",(productionproduct0)."finishedgoodsflag",(productionproduct0)."color",(productionproduct0)."safetystocklevel",(productionproduct0)."reorderpoint",(productionproduct0)."standardcost",(productionproduct0)."listprice",(productionproduct0)."size",(productionproduct0)."sizeunitmeasurecode",(productionproduct0)."weightunitmeasurecode",(productionproduct0)."weight",(productionproduct0)."daystomanufacture",(productionproduct0)."productline",(productionproduct0)."class",(productionproduct0)."style",(productionproduct0)."productsubcategoryid",(productionproduct0)."productmodelid",(productionproduct0)."sellstartdate"::text,(productionproduct0)."sellenddate"::text,(productionproduct0)."discontinueddate"::text,(productionproduct0)."rowguid",(productionproduct0)."modifieddate"::text,(productionproductmodel0)."productmodelid",(productionproductmodel0)."name",(productionproductmodel0)."catalogdescription",(productionproductmodel0)."instructions",(productionproductmodel0)."rowguid",(productionproductmodel0)."modifieddate"::text,(productionproductmodel1)."productmodelid",(productionproductmodel1)."name",(productionproductmodel1)."catalogdescription",(productionproductmodel1)."instructions",(productionproductmodel1)."rowguid",(productionproductmodel1)."modifieddate"::text from left_join_cte0 \ No newline at end of file diff --git a/snapshot-tests/dooble-sql/ProductTest/query.sql b/snapshot-tests/dooble-sql/ProductTest/query.sql index c92100454..ab782c3ba 100644 --- a/snapshot-tests/dooble-sql/ProductTest/query.sql +++ b/snapshot-tests/dooble-sql/ProductTest/query.sql @@ -1,15 +1,15 @@ with productionproduct0 as ( - (select productionproduct0 from "production"."product" productionproduct0 WHERE ((productionproduct0).class = ? ) AND (((productionproduct0).daystomanufacture > ? ) OR ((productionproduct0).daystomanufacture <= ? ) ) AND ((productionproduct0).productline = ? ) ) + (select productionproduct0 from "production"."product" productionproduct0 WHERE ((productionproduct0).class = ? ) AND (((productionproduct0).daystomanufacture > ? ) OR ((productionproduct0).daystomanufacture <= ? ) ) AND ((productionproduct0).productline = ? ) ) ) , productionunitmeasure0 as ( - (select productionunitmeasure0 from "production"."unitmeasure" productionunitmeasure0 WHERE ((productionunitmeasure0).name LIKE ? ) ) + (select productionunitmeasure0 from "production"."unitmeasure" productionunitmeasure0 WHERE ((productionunitmeasure0).name LIKE ? ) ) ) , join_cte0 as ( select productionproduct0, productionunitmeasure0 from productionproduct0 join productionunitmeasure0 - on ((productionproduct0).sizeunitmeasurecode = (productionunitmeasure0).unitmeasurecode) + on ((productionproduct0).sizeunitmeasurecode = (productionunitmeasure0).unitmeasurecode ) ) , productionproductmodel0 as ( @@ -19,7 +19,7 @@ left_join_cte0 as ( select productionproduct0, productionunitmeasure0, productionproductmodel0 from join_cte0 left join productionproductmodel0 - on ((productionproduct0).productmodelid = (productionproductmodel0).productmodelid) - WHERE ((productionproduct0).productmodelid = (productionproductmodel0).productmodelid) ORDER BY (productionproduct0).productmodelid ASC , (productionproductmodel0).name DESC NULLS FIRST + on ((productionproduct0).productmodelid = (productionproductmodel0).productmodelid ) + WHERE ((productionproduct0).productmodelid = (productionproductmodel0).productmodelid ) ORDER BY (productionproduct0).productmodelid ASC , (productionproductmodel0).name DESC NULLS FIRST ) select (productionproduct0)."productid",(productionproduct0)."name",(productionproduct0)."productnumber",(productionproduct0)."makeflag",(productionproduct0)."finishedgoodsflag",(productionproduct0)."color",(productionproduct0)."safetystocklevel",(productionproduct0)."reorderpoint",(productionproduct0)."standardcost",(productionproduct0)."listprice",(productionproduct0)."size",(productionproduct0)."sizeunitmeasurecode",(productionproduct0)."weightunitmeasurecode",(productionproduct0)."weight",(productionproduct0)."daystomanufacture",(productionproduct0)."productline",(productionproduct0)."class",(productionproduct0)."style",(productionproduct0)."productsubcategoryid",(productionproduct0)."productmodelid",(productionproduct0)."sellstartdate"::text,(productionproduct0)."sellenddate"::text,(productionproduct0)."discontinueddate"::text,(productionproduct0)."rowguid",(productionproduct0)."modifieddate"::text,(productionunitmeasure0)."unitmeasurecode",(productionunitmeasure0)."name",(productionunitmeasure0)."modifieddate"::text,(productionproductmodel0)."productmodelid",(productionproductmodel0)."name",(productionproductmodel0)."catalogdescription",(productionproductmodel0)."instructions",(productionproductmodel0)."rowguid",(productionproductmodel0)."modifieddate"::text from left_join_cte0 \ No newline at end of file diff --git a/snapshot-tests/dooble-sql/ProductTest/query0.sql b/snapshot-tests/dooble-sql/ProductTest/query0.sql index 327fee012..c0e08a0d8 100644 --- a/snapshot-tests/dooble-sql/ProductTest/query0.sql +++ b/snapshot-tests/dooble-sql/ProductTest/query0.sql @@ -9,7 +9,7 @@ join_cte2 as ( select productionproduct0, productionproductmodel0 from productionproduct0 join productionproductmodel0 - on ((productionproduct0).productmodelid = (productionproductmodel0).productmodelid) + on ((productionproduct0).productmodelid = (productionproductmodel0).productmodelid ) ) , productionproductsubcategory0 as ( @@ -19,7 +19,7 @@ join_cte1 as ( select productionproduct0, productionproductmodel0, productionproductsubcategory0 from join_cte2 join productionproductsubcategory0 - on ((productionproduct0).productsubcategoryid = (productionproductsubcategory0).productsubcategoryid) + on ((productionproduct0).productsubcategoryid = (productionproductsubcategory0).productsubcategoryid ) ) , productionproductcategory0 as ( @@ -29,7 +29,7 @@ join_cte0 as ( select productionproduct0, productionproductmodel0, productionproductsubcategory0, productionproductcategory0 from join_cte1 join productionproductcategory0 - on ((productionproductsubcategory0).productcategoryid = (productionproductcategory0).productcategoryid) + on ((productionproductsubcategory0).productcategoryid = (productionproductcategory0).productcategoryid ) ) select (productionproduct0)."productid",(productionproduct0)."name",(productionproduct0)."productnumber",(productionproduct0)."makeflag",(productionproduct0)."finishedgoodsflag",(productionproduct0)."color",(productionproduct0)."safetystocklevel",(productionproduct0)."reorderpoint",(productionproduct0)."standardcost",(productionproduct0)."listprice",(productionproduct0)."size",(productionproduct0)."sizeunitmeasurecode",(productionproduct0)."weightunitmeasurecode",(productionproduct0)."weight",(productionproduct0)."daystomanufacture",(productionproduct0)."productline",(productionproduct0)."class",(productionproduct0)."style",(productionproduct0)."productsubcategoryid",(productionproduct0)."productmodelid",(productionproduct0)."sellstartdate"::text,(productionproduct0)."sellenddate"::text,(productionproduct0)."discontinueddate"::text,(productionproduct0)."rowguid",(productionproduct0)."modifieddate"::text,(productionproductmodel0)."productmodelid",(productionproductmodel0)."name",(productionproductmodel0)."catalogdescription",(productionproductmodel0)."instructions",(productionproductmodel0)."rowguid",(productionproductmodel0)."modifieddate"::text,(productionproductsubcategory0)."productsubcategoryid",(productionproductsubcategory0)."productcategoryid",(productionproductsubcategory0)."name",(productionproductsubcategory0)."rowguid",(productionproductsubcategory0)."modifieddate"::text,(productionproductcategory0)."productcategoryid",(productionproductcategory0)."name",(productionproductcategory0)."rowguid",(productionproductcategory0)."modifieddate"::text from join_cte0 \ No newline at end of file diff --git a/snapshot-tests/dooble-sql/ProductTest/updateReturning.sql b/snapshot-tests/dooble-sql/ProductTest/updateReturning.sql index 548c11f4f..b54732080 100644 --- a/snapshot-tests/dooble-sql/ProductTest/updateReturning.sql +++ b/snapshot-tests/dooble-sql/ProductTest/updateReturning.sql @@ -1 +1 @@ -update "production"."product" SET name = substring((upper(reverse(name) ) || ? ) , ? , ? ) ::varchar , listprice = ? ::numeric , reorderpoint = (reorderpoint + ?::int2 ) ::int2 WHERE coalesce((productid = ? ) , ? ) returning "productid", "name", "productnumber", "makeflag", "finishedgoodsflag", "color", "safetystocklevel", "reorderpoint", "standardcost", "listprice", "size", "sizeunitmeasurecode", "weightunitmeasurecode", "weight", "daystomanufacture", "productline", "class", "style", "productsubcategoryid", "productmodelid", "sellstartdate"::text, "sellenddate"::text, "discontinueddate"::text, "rowguid", "modifieddate"::text \ No newline at end of file +update "production"."product" SET name = substring((upper(reverse(name ) ) || ? ) , ? , ? ) ::varchar , listprice = ? ::numeric , reorderpoint = (reorderpoint + ?::int2 ) ::int2 WHERE coalesce((productid = ? ) , ? ) returning "productid", "name", "productnumber", "makeflag", "finishedgoodsflag", "color", "safetystocklevel", "reorderpoint", "standardcost", "listprice", "size", "sizeunitmeasurecode", "weightunitmeasurecode", "weight", "daystomanufacture", "productline", "class", "style", "productsubcategoryid", "productmodelid", "sellstartdate"::text, "sellenddate"::text, "discontinueddate"::text, "rowguid", "modifieddate"::text \ No newline at end of file diff --git a/snapshot-tests/dooble-sql/SeekTest/complex.sql b/snapshot-tests/dooble-sql/SeekTest/complex.sql index 7d0655aea..1e939cbb3 100644 --- a/snapshot-tests/dooble-sql/SeekTest/complex.sql +++ b/snapshot-tests/dooble-sql/SeekTest/complex.sql @@ -1,5 +1,5 @@ with productionproduct0 as ( - (select productionproduct0 from "production"."product" productionproduct0 WHERE ((((productionproduct0).name > ? ) OR (((productionproduct0).name = ? ) AND ((productionproduct0).weight < ? ) ) ) OR ((((productionproduct0).name = ? ) AND ((productionproduct0).weight = ? ) ) AND ((productionproduct0).listprice < ? ) ) ) ORDER BY (productionproduct0).name ASC , (productionproduct0).weight DESC , (productionproduct0).listprice DESC ) + (select productionproduct0 from "production"."product" productionproduct0 WHERE ((((productionproduct0).name > ? ) OR (((productionproduct0).name = ? ) AND ((productionproduct0).weight < ? ) ) ) OR ((((productionproduct0).name = ? ) AND ((productionproduct0).weight = ? ) ) AND ((productionproduct0).listprice < ? ) ) ) ORDER BY (productionproduct0).name ASC , (productionproduct0).weight DESC , (productionproduct0).listprice DESC ) ) select (productionproduct0)."productid",(productionproduct0)."name",(productionproduct0)."productnumber",(productionproduct0)."makeflag",(productionproduct0)."finishedgoodsflag",(productionproduct0)."color",(productionproduct0)."safetystocklevel",(productionproduct0)."reorderpoint",(productionproduct0)."standardcost",(productionproduct0)."listprice",(productionproduct0)."size",(productionproduct0)."sizeunitmeasurecode",(productionproduct0)."weightunitmeasurecode",(productionproduct0)."weight",(productionproduct0)."daystomanufacture",(productionproduct0)."productline",(productionproduct0)."class",(productionproduct0)."style",(productionproduct0)."productsubcategoryid",(productionproduct0)."productmodelid",(productionproduct0)."sellstartdate"::text,(productionproduct0)."sellenddate"::text,(productionproduct0)."discontinueddate"::text,(productionproduct0)."rowguid",(productionproduct0)."modifieddate"::text from productionproduct0 \ No newline at end of file diff --git a/snapshot-tests/dooble-sql/SeekTest/uniform-ascending.sql b/snapshot-tests/dooble-sql/SeekTest/uniform-ascending.sql index 73d59fd78..fe823cd3d 100644 --- a/snapshot-tests/dooble-sql/SeekTest/uniform-ascending.sql +++ b/snapshot-tests/dooble-sql/SeekTest/uniform-ascending.sql @@ -1,5 +1,5 @@ with productionproduct0 as ( - (select productionproduct0 from "production"."product" productionproduct0 WHERE (((productionproduct0).name, (productionproduct0).weight, (productionproduct0).listprice) > (? , ? , ? ) ) ORDER BY (productionproduct0).name ASC , (productionproduct0).weight ASC , (productionproduct0).listprice ASC ) + (select productionproduct0 from "production"."product" productionproduct0 WHERE (((productionproduct0).name , (productionproduct0).weight , (productionproduct0).listprice ) > (? , ? , ? ) ) ORDER BY (productionproduct0).name ASC , (productionproduct0).weight ASC , (productionproduct0).listprice ASC ) ) select (productionproduct0)."productid",(productionproduct0)."name",(productionproduct0)."productnumber",(productionproduct0)."makeflag",(productionproduct0)."finishedgoodsflag",(productionproduct0)."color",(productionproduct0)."safetystocklevel",(productionproduct0)."reorderpoint",(productionproduct0)."standardcost",(productionproduct0)."listprice",(productionproduct0)."size",(productionproduct0)."sizeunitmeasurecode",(productionproduct0)."weightunitmeasurecode",(productionproduct0)."weight",(productionproduct0)."daystomanufacture",(productionproduct0)."productline",(productionproduct0)."class",(productionproduct0)."style",(productionproduct0)."productsubcategoryid",(productionproduct0)."productmodelid",(productionproduct0)."sellstartdate"::text,(productionproduct0)."sellenddate"::text,(productionproduct0)."discontinueddate"::text,(productionproduct0)."rowguid",(productionproduct0)."modifieddate"::text from productionproduct0 \ No newline at end of file diff --git a/snapshot-tests/dooble-sql/SeekTest/uniform-descending.sql b/snapshot-tests/dooble-sql/SeekTest/uniform-descending.sql index 5d996197e..d9eabe3c1 100644 --- a/snapshot-tests/dooble-sql/SeekTest/uniform-descending.sql +++ b/snapshot-tests/dooble-sql/SeekTest/uniform-descending.sql @@ -1,5 +1,5 @@ with productionproduct0 as ( - (select productionproduct0 from "production"."product" productionproduct0 WHERE (((productionproduct0).name, (productionproduct0).weight, (productionproduct0).listprice) < (? , ? , ? ) ) ORDER BY (productionproduct0).name DESC , (productionproduct0).weight DESC , (productionproduct0).listprice DESC ) + (select productionproduct0 from "production"."product" productionproduct0 WHERE (((productionproduct0).name , (productionproduct0).weight , (productionproduct0).listprice ) < (? , ? , ? ) ) ORDER BY (productionproduct0).name DESC , (productionproduct0).weight DESC , (productionproduct0).listprice DESC ) ) select (productionproduct0)."productid",(productionproduct0)."name",(productionproduct0)."productnumber",(productionproduct0)."makeflag",(productionproduct0)."finishedgoodsflag",(productionproduct0)."color",(productionproduct0)."safetystocklevel",(productionproduct0)."reorderpoint",(productionproduct0)."standardcost",(productionproduct0)."listprice",(productionproduct0)."size",(productionproduct0)."sizeunitmeasurecode",(productionproduct0)."weightunitmeasurecode",(productionproduct0)."weight",(productionproduct0)."daystomanufacture",(productionproduct0)."productline",(productionproduct0)."class",(productionproduct0)."style",(productionproduct0)."productsubcategoryid",(productionproduct0)."productmodelid",(productionproduct0)."sellstartdate"::text,(productionproduct0)."sellenddate"::text,(productionproduct0)."discontinueddate"::text,(productionproduct0)."rowguid",(productionproduct0)."modifieddate"::text from productionproduct0 \ No newline at end of file diff --git a/snapshot-tests/zio-jdbc-sql/CompositeIdsTest/query2.sql b/snapshot-tests/zio-jdbc-sql/CompositeIdsTest/query2.sql index 6ecb9643d..b8ed03ce9 100644 --- a/snapshot-tests/zio-jdbc-sql/CompositeIdsTest/query2.sql +++ b/snapshot-tests/zio-jdbc-sql/CompositeIdsTest/query2.sql @@ -1,5 +1,5 @@ with personemailaddress0 as ( - (select personemailaddress0 from "person"."emailaddress" personemailaddress0 WHERE ((personemailaddress0).businessentityid, (personemailaddress0).emailaddressid) in (select unnest(?::int4[]), unnest(?::int4[]))) + (select personemailaddress0 from "person"."emailaddress" personemailaddress0 WHERE ((personemailaddress0).businessentityid , (personemailaddress0).emailaddressid ) in (select unnest(?::int4[]), unnest(?::int4[]))) ) select (personemailaddress0)."businessentityid",(personemailaddress0)."emailaddressid",(personemailaddress0)."emailaddress",(personemailaddress0)."rowguid",(personemailaddress0)."modifieddate"::text from personemailaddress0 \ No newline at end of file diff --git a/snapshot-tests/zio-jdbc-sql/DSLTest/doubled.sql b/snapshot-tests/zio-jdbc-sql/DSLTest/doubled.sql index 4cd386ab2..35640939c 100644 --- a/snapshot-tests/zio-jdbc-sql/DSLTest/doubled.sql +++ b/snapshot-tests/zio-jdbc-sql/DSLTest/doubled.sql @@ -1,6 +1,6 @@ with salessalesperson0 as ( - (select salessalesperson0 from "sales"."salesperson" salessalesperson0 WHERE ((salessalesperson0).rowguid = ?::uuid)) + (select salessalesperson0 from "sales"."salesperson" salessalesperson0 WHERE ((salessalesperson0).rowguid = ?::uuid)) ), humanresourcesemployee0 as ( (select humanresourcesemployee0 from "humanresources"."employee" humanresourcesemployee0 ) @@ -9,7 +9,7 @@ join_cte5 as ( select salessalesperson0, humanresourcesemployee0 from salessalesperson0 join humanresourcesemployee0 - on ((salessalesperson0).businessentityid = (humanresourcesemployee0).businessentityid) + on ((salessalesperson0).businessentityid = (humanresourcesemployee0).businessentityid ) ), personperson0 as ( @@ -19,7 +19,7 @@ join_cte4 as ( select salessalesperson0, humanresourcesemployee0, personperson0 from join_cte5 join personperson0 - on ((humanresourcesemployee0).businessentityid = (personperson0).businessentityid) + on ((humanresourcesemployee0).businessentityid = (personperson0).businessentityid ) ), personbusinessentity0 as ( @@ -29,17 +29,17 @@ join_cte3 as ( select salessalesperson0, humanresourcesemployee0, personperson0, personbusinessentity0 from join_cte4 join personbusinessentity0 - on ((personperson0).businessentityid = (personbusinessentity0).businessentityid) + on ((personperson0).businessentityid = (personbusinessentity0).businessentityid ) ), personemailaddress0 as ( - (select personemailaddress0 from "person"."emailaddress" personemailaddress0 ORDER BY (personemailaddress0).rowguid ASC ) + (select personemailaddress0 from "person"."emailaddress" personemailaddress0 ORDER BY (personemailaddress0).rowguid ASC ) ), join_cte2 as ( select salessalesperson0, humanresourcesemployee0, personperson0, personbusinessentity0, personemailaddress0 from join_cte3 join personemailaddress0 - on ((personemailaddress0).businessentityid = (personbusinessentity0).businessentityid) + on ((personemailaddress0).businessentityid = (personbusinessentity0).businessentityid ) ), salessalesperson1 as ( @@ -49,11 +49,11 @@ join_cte1 as ( select salessalesperson0, humanresourcesemployee0, personperson0, personbusinessentity0, personemailaddress0, salessalesperson1 from join_cte2 join salessalesperson1 - on ((personemailaddress0).businessentityid = (salessalesperson1).businessentityid) + on ((personemailaddress0).businessentityid = (salessalesperson1).businessentityid ) ), salessalesperson2 as ( - (select salessalesperson2 from "sales"."salesperson" salessalesperson2 WHERE ((salessalesperson2).rowguid = ?::uuid)) + (select salessalesperson2 from "sales"."salesperson" salessalesperson2 WHERE ((salessalesperson2).rowguid = ?::uuid)) ), humanresourcesemployee1 as ( (select humanresourcesemployee1 from "humanresources"."employee" humanresourcesemployee1 ) @@ -62,7 +62,7 @@ join_cte10 as ( select salessalesperson2, humanresourcesemployee1 from salessalesperson2 join humanresourcesemployee1 - on ((salessalesperson2).businessentityid = (humanresourcesemployee1).businessentityid) + on ((salessalesperson2).businessentityid = (humanresourcesemployee1).businessentityid ) ), personperson1 as ( @@ -72,7 +72,7 @@ join_cte9 as ( select salessalesperson2, humanresourcesemployee1, personperson1 from join_cte10 join personperson1 - on ((humanresourcesemployee1).businessentityid = (personperson1).businessentityid) + on ((humanresourcesemployee1).businessentityid = (personperson1).businessentityid ) ), personbusinessentity1 as ( @@ -82,17 +82,17 @@ join_cte8 as ( select salessalesperson2, humanresourcesemployee1, personperson1, personbusinessentity1 from join_cte9 join personbusinessentity1 - on ((personperson1).businessentityid = (personbusinessentity1).businessentityid) + on ((personperson1).businessentityid = (personbusinessentity1).businessentityid ) ), personemailaddress1 as ( - (select personemailaddress1 from "person"."emailaddress" personemailaddress1 ORDER BY (personemailaddress1).rowguid ASC ) + (select personemailaddress1 from "person"."emailaddress" personemailaddress1 ORDER BY (personemailaddress1).rowguid ASC ) ), join_cte7 as ( select salessalesperson2, humanresourcesemployee1, personperson1, personbusinessentity1, personemailaddress1 from join_cte8 join personemailaddress1 - on ((personemailaddress1).businessentityid = (personbusinessentity1).businessentityid) + on ((personemailaddress1).businessentityid = (personbusinessentity1).businessentityid ) ), salessalesperson3 as ( @@ -102,14 +102,14 @@ join_cte6 as ( select salessalesperson2, humanresourcesemployee1, personperson1, personbusinessentity1, personemailaddress1, salessalesperson3 from join_cte7 join salessalesperson3 - on ((personemailaddress1).businessentityid = (salessalesperson3).businessentityid) + on ((personemailaddress1).businessentityid = (salessalesperson3).businessentityid ) ), join_cte0 as ( select salessalesperson0, humanresourcesemployee0, personperson0, personbusinessentity0, personemailaddress0, salessalesperson1, salessalesperson2, humanresourcesemployee1, personperson1, personbusinessentity1, personemailaddress1, salessalesperson3 from join_cte1 join join_cte6 - on ((personemailaddress0).businessentityid = (personemailaddress1).businessentityid) + on ((personemailaddress0).businessentityid = (personemailaddress1).businessentityid ) ) select (salessalesperson0)."businessentityid",(salessalesperson0)."territoryid",(salessalesperson0)."salesquota",(salessalesperson0)."bonus",(salessalesperson0)."commissionpct",(salessalesperson0)."salesytd",(salessalesperson0)."saleslastyear",(salessalesperson0)."rowguid",(salessalesperson0)."modifieddate"::text,(humanresourcesemployee0)."businessentityid",(humanresourcesemployee0)."nationalidnumber",(humanresourcesemployee0)."loginid",(humanresourcesemployee0)."jobtitle",(humanresourcesemployee0)."birthdate"::text,(humanresourcesemployee0)."maritalstatus",(humanresourcesemployee0)."gender",(humanresourcesemployee0)."hiredate"::text,(humanresourcesemployee0)."salariedflag",(humanresourcesemployee0)."vacationhours",(humanresourcesemployee0)."sickleavehours",(humanresourcesemployee0)."currentflag",(humanresourcesemployee0)."rowguid",(humanresourcesemployee0)."modifieddate"::text,(humanresourcesemployee0)."organizationnode",(personperson0)."businessentityid",(personperson0)."persontype",(personperson0)."namestyle",(personperson0)."title",(personperson0)."firstname",(personperson0)."middlename",(personperson0)."lastname",(personperson0)."suffix",(personperson0)."emailpromotion",(personperson0)."additionalcontactinfo",(personperson0)."demographics",(personperson0)."rowguid",(personperson0)."modifieddate"::text,(personbusinessentity0)."businessentityid",(personbusinessentity0)."rowguid",(personbusinessentity0)."modifieddate"::text,(personemailaddress0)."businessentityid",(personemailaddress0)."emailaddressid",(personemailaddress0)."emailaddress",(personemailaddress0)."rowguid",(personemailaddress0)."modifieddate"::text,(salessalesperson1)."businessentityid",(salessalesperson1)."territoryid",(salessalesperson1)."salesquota",(salessalesperson1)."bonus",(salessalesperson1)."commissionpct",(salessalesperson1)."salesytd",(salessalesperson1)."saleslastyear",(salessalesperson1)."rowguid",(salessalesperson1)."modifieddate"::text,(salessalesperson2)."businessentityid",(salessalesperson2)."territoryid",(salessalesperson2)."salesquota",(salessalesperson2)."bonus",(salessalesperson2)."commissionpct",(salessalesperson2)."salesytd",(salessalesperson2)."saleslastyear",(salessalesperson2)."rowguid",(salessalesperson2)."modifieddate"::text,(humanresourcesemployee1)."businessentityid",(humanresourcesemployee1)."nationalidnumber",(humanresourcesemployee1)."loginid",(humanresourcesemployee1)."jobtitle",(humanresourcesemployee1)."birthdate"::text,(humanresourcesemployee1)."maritalstatus",(humanresourcesemployee1)."gender",(humanresourcesemployee1)."hiredate"::text,(humanresourcesemployee1)."salariedflag",(humanresourcesemployee1)."vacationhours",(humanresourcesemployee1)."sickleavehours",(humanresourcesemployee1)."currentflag",(humanresourcesemployee1)."rowguid",(humanresourcesemployee1)."modifieddate"::text,(humanresourcesemployee1)."organizationnode",(personperson1)."businessentityid",(personperson1)."persontype",(personperson1)."namestyle",(personperson1)."title",(personperson1)."firstname",(personperson1)."middlename",(personperson1)."lastname",(personperson1)."suffix",(personperson1)."emailpromotion",(personperson1)."additionalcontactinfo",(personperson1)."demographics",(personperson1)."rowguid",(personperson1)."modifieddate"::text,(personbusinessentity1)."businessentityid",(personbusinessentity1)."rowguid",(personbusinessentity1)."modifieddate"::text,(personemailaddress1)."businessentityid",(personemailaddress1)."emailaddressid",(personemailaddress1)."emailaddress",(personemailaddress1)."rowguid",(personemailaddress1)."modifieddate"::text,(salessalesperson3)."businessentityid",(salessalesperson3)."territoryid",(salessalesperson3)."salesquota",(salessalesperson3)."bonus",(salessalesperson3)."commissionpct",(salessalesperson3)."salesytd",(salessalesperson3)."saleslastyear",(salessalesperson3)."rowguid",(salessalesperson3)."modifieddate"::text from join_cte0 \ No newline at end of file diff --git a/snapshot-tests/zio-jdbc-sql/ProductTest/delete.sql b/snapshot-tests/zio-jdbc-sql/ProductTest/delete.sql index b3f0e09aa..159700b9a 100644 --- a/snapshot-tests/zio-jdbc-sql/ProductTest/delete.sql +++ b/snapshot-tests/zio-jdbc-sql/ProductTest/delete.sql @@ -1 +1 @@ -DELETE FROM "production"."product" where coalesce((productid = ?::int4), ?::boolean) \ No newline at end of file +DELETE FROM "production"."product" where coalesce((productid = ?::int4), ?::boolean) \ No newline at end of file diff --git a/snapshot-tests/zio-jdbc-sql/ProductTest/leftJoined.sql b/snapshot-tests/zio-jdbc-sql/ProductTest/leftJoined.sql index 231d63335..e555ad947 100644 --- a/snapshot-tests/zio-jdbc-sql/ProductTest/leftJoined.sql +++ b/snapshot-tests/zio-jdbc-sql/ProductTest/leftJoined.sql @@ -9,7 +9,7 @@ left_join_cte0 as ( select productionproduct0, productionproductmodel0 from productionproduct0 left join productionproductmodel0 - on ((productionproduct0).productmodelid = (productionproductmodel0).productmodelid) + on ((productionproduct0).productmodelid = (productionproductmodel0).productmodelid ) ) select (productionproduct0)."productid",(productionproduct0)."name",(productionproduct0)."productnumber",(productionproduct0)."makeflag",(productionproduct0)."finishedgoodsflag",(productionproduct0)."color",(productionproduct0)."safetystocklevel",(productionproduct0)."reorderpoint",(productionproduct0)."standardcost",(productionproduct0)."listprice",(productionproduct0)."size",(productionproduct0)."sizeunitmeasurecode",(productionproduct0)."weightunitmeasurecode",(productionproduct0)."weight",(productionproduct0)."daystomanufacture",(productionproduct0)."productline",(productionproduct0)."class",(productionproduct0)."style",(productionproduct0)."productsubcategoryid",(productionproduct0)."productmodelid",(productionproduct0)."sellstartdate"::text,(productionproduct0)."sellenddate"::text,(productionproduct0)."discontinueddate"::text,(productionproduct0)."rowguid",(productionproduct0)."modifieddate"::text,(productionproductmodel0)."productmodelid",(productionproductmodel0)."name",(productionproductmodel0)."catalogdescription",(productionproductmodel0)."instructions",(productionproductmodel0)."rowguid",(productionproductmodel0)."modifieddate"::text from left_join_cte0 \ No newline at end of file diff --git a/snapshot-tests/zio-jdbc-sql/ProductTest/q.sql b/snapshot-tests/zio-jdbc-sql/ProductTest/q.sql index e04b450f8..25f150c31 100644 --- a/snapshot-tests/zio-jdbc-sql/ProductTest/q.sql +++ b/snapshot-tests/zio-jdbc-sql/ProductTest/q.sql @@ -1,15 +1,15 @@ with productionproduct0 as ( - (select productionproduct0 from "production"."product" productionproduct0 WHERE NOT ((productionproduct0).name LIKE ?::text) AND NOT (((productionproduct0).name || (productionproduct0).color) LIKE ?::text) AND ((productionproduct0).daystomanufacture > ?::int4) AND ((productionproduct0).modifieddate < ?::timestamp)) + (select productionproduct0 from "production"."product" productionproduct0 WHERE NOT ((productionproduct0).name LIKE ?::text) AND NOT (((productionproduct0).name || (productionproduct0).color ) LIKE ?::text) AND ((productionproduct0).daystomanufacture > ?::int4) AND ((productionproduct0).modifieddate < ?::timestamp)) ), productionproductmodel0 as ( - (select productionproductmodel0 from "production"."productmodel" productionproductmodel0 WHERE ((productionproductmodel0).modifieddate < ?::timestamp)) + (select productionproductmodel0 from "production"."productmodel" productionproductmodel0 WHERE ((productionproductmodel0).modifieddate < ?::timestamp)) ), join_cte0 as ( select productionproduct0, productionproductmodel0 from productionproduct0 join productionproductmodel0 - on ((productionproduct0).productmodelid = (productionproductmodel0).productmodelid) - WHERE NOT (productionproductmodel0).instructions IS NULL + on ((productionproduct0).productmodelid = (productionproductmodel0).productmodelid ) + WHERE NOT (productionproductmodel0).instructions IS NULL ) select (productionproduct0)."productid",(productionproduct0)."name",(productionproduct0)."productnumber",(productionproduct0)."makeflag",(productionproduct0)."finishedgoodsflag",(productionproduct0)."color",(productionproduct0)."safetystocklevel",(productionproduct0)."reorderpoint",(productionproduct0)."standardcost",(productionproduct0)."listprice",(productionproduct0)."size",(productionproduct0)."sizeunitmeasurecode",(productionproduct0)."weightunitmeasurecode",(productionproduct0)."weight",(productionproduct0)."daystomanufacture",(productionproduct0)."productline",(productionproduct0)."class",(productionproduct0)."style",(productionproduct0)."productsubcategoryid",(productionproduct0)."productmodelid",(productionproduct0)."sellstartdate"::text,(productionproduct0)."sellenddate"::text,(productionproduct0)."discontinueddate"::text,(productionproduct0)."rowguid",(productionproduct0)."modifieddate"::text,(productionproductmodel0)."productmodelid",(productionproductmodel0)."name",(productionproductmodel0)."catalogdescription",(productionproductmodel0)."instructions",(productionproductmodel0)."rowguid",(productionproductmodel0)."modifieddate"::text from join_cte0 \ No newline at end of file diff --git a/snapshot-tests/zio-jdbc-sql/ProductTest/q2.sql b/snapshot-tests/zio-jdbc-sql/ProductTest/q2.sql index deb3a503b..e6bb2323e 100644 --- a/snapshot-tests/zio-jdbc-sql/ProductTest/q2.sql +++ b/snapshot-tests/zio-jdbc-sql/ProductTest/q2.sql @@ -1,25 +1,25 @@ with productionproduct0 as ( - (select productionproduct0 from "production"."product" productionproduct0 WHERE (productionproduct0).productid = ANY(?) AND (length((productionproduct0).name) > ?::int4) AND NOT (((productionproduct0).name || (productionproduct0).color) LIKE ?::text) AND (coalesce(length((productionproduct0).color), ?::int4) > ?::int4) AND ((productionproduct0).modifieddate < ?::timestamp)) + (select productionproduct0 from "production"."product" productionproduct0 WHERE (productionproduct0).productid = ANY(?) AND (length((productionproduct0).name ) > ?::int4) AND NOT (((productionproduct0).name || (productionproduct0).color ) LIKE ?::text) AND (coalesce(length((productionproduct0).color ), ?::int4) > ?::int4) AND ((productionproduct0).modifieddate < ?::timestamp)) ), productionproductmodel0 as ( - (select productionproductmodel0 from "production"."productmodel" productionproductmodel0 WHERE NOT ((productionproductmodel0).name LIKE ?::text)) + (select productionproductmodel0 from "production"."productmodel" productionproductmodel0 WHERE NOT ((productionproductmodel0).name LIKE ?::text)) ), join_cte0 as ( select productionproduct0, productionproductmodel0 from productionproduct0 join productionproductmodel0 - on ((productionproduct0).productmodelid = (productionproductmodel0).productmodelid) - WHERE ((productionproductmodel0).productmodelid > ?::int4) + on ((productionproduct0).productmodelid = (productionproductmodel0).productmodelid ) + WHERE ((productionproductmodel0).productmodelid > ?::int4) ), productionproductmodel1 as ( - (select productionproductmodel1 from "production"."productmodel" productionproductmodel1 WHERE NOT ((productionproductmodel1).name LIKE ?::text)) + (select productionproductmodel1 from "production"."productmodel" productionproductmodel1 WHERE NOT ((productionproductmodel1).name LIKE ?::text)) ), left_join_cte0 as ( select productionproduct0, productionproductmodel0, productionproductmodel1 from join_cte0 left join productionproductmodel1 - on (((productionproduct0).productmodelid = (productionproductmodel1).productmodelid) AND ?::boolean) - ORDER BY (productionproduct0).name ASC , (productionproductmodel0).rowguid DESC NULLS FIRST, (productionproductmodel1).rowguid ASC + on (((productionproduct0).productmodelid = (productionproductmodel1).productmodelid ) AND ?::boolean) + ORDER BY (productionproduct0).name ASC , (productionproductmodel0).rowguid DESC NULLS FIRST, (productionproductmodel1).rowguid ASC ) select (productionproduct0)."productid",(productionproduct0)."name",(productionproduct0)."productnumber",(productionproduct0)."makeflag",(productionproduct0)."finishedgoodsflag",(productionproduct0)."color",(productionproduct0)."safetystocklevel",(productionproduct0)."reorderpoint",(productionproduct0)."standardcost",(productionproduct0)."listprice",(productionproduct0)."size",(productionproduct0)."sizeunitmeasurecode",(productionproduct0)."weightunitmeasurecode",(productionproduct0)."weight",(productionproduct0)."daystomanufacture",(productionproduct0)."productline",(productionproduct0)."class",(productionproduct0)."style",(productionproduct0)."productsubcategoryid",(productionproduct0)."productmodelid",(productionproduct0)."sellstartdate"::text,(productionproduct0)."sellenddate"::text,(productionproduct0)."discontinueddate"::text,(productionproduct0)."rowguid",(productionproduct0)."modifieddate"::text,(productionproductmodel0)."productmodelid",(productionproductmodel0)."name",(productionproductmodel0)."catalogdescription",(productionproductmodel0)."instructions",(productionproductmodel0)."rowguid",(productionproductmodel0)."modifieddate"::text,(productionproductmodel1)."productmodelid",(productionproductmodel1)."name",(productionproductmodel1)."catalogdescription",(productionproductmodel1)."instructions",(productionproductmodel1)."rowguid",(productionproductmodel1)."modifieddate"::text from left_join_cte0 \ No newline at end of file diff --git a/snapshot-tests/zio-jdbc-sql/ProductTest/query.sql b/snapshot-tests/zio-jdbc-sql/ProductTest/query.sql index 6da7c806a..8279df9dc 100644 --- a/snapshot-tests/zio-jdbc-sql/ProductTest/query.sql +++ b/snapshot-tests/zio-jdbc-sql/ProductTest/query.sql @@ -1,15 +1,15 @@ with productionproduct0 as ( - (select productionproduct0 from "production"."product" productionproduct0 WHERE ((productionproduct0).class = ?::text) AND (((productionproduct0).daystomanufacture > ?::int4) OR ((productionproduct0).daystomanufacture <= ?::int4)) AND ((productionproduct0).productline = ?::text)) + (select productionproduct0 from "production"."product" productionproduct0 WHERE ((productionproduct0).class = ?::text) AND (((productionproduct0).daystomanufacture > ?::int4) OR ((productionproduct0).daystomanufacture <= ?::int4)) AND ((productionproduct0).productline = ?::text)) ), productionunitmeasure0 as ( - (select productionunitmeasure0 from "production"."unitmeasure" productionunitmeasure0 WHERE ((productionunitmeasure0).name LIKE ?::text)) + (select productionunitmeasure0 from "production"."unitmeasure" productionunitmeasure0 WHERE ((productionunitmeasure0).name LIKE ?::text)) ), join_cte0 as ( select productionproduct0, productionunitmeasure0 from productionproduct0 join productionunitmeasure0 - on ((productionproduct0).sizeunitmeasurecode = (productionunitmeasure0).unitmeasurecode) + on ((productionproduct0).sizeunitmeasurecode = (productionunitmeasure0).unitmeasurecode ) ), productionproductmodel0 as ( @@ -19,7 +19,7 @@ left_join_cte0 as ( select productionproduct0, productionunitmeasure0, productionproductmodel0 from join_cte0 left join productionproductmodel0 - on ((productionproduct0).productmodelid = (productionproductmodel0).productmodelid) - WHERE ((productionproduct0).productmodelid = (productionproductmodel0).productmodelid) ORDER BY (productionproduct0).productmodelid ASC , (productionproductmodel0).name DESC NULLS FIRST + on ((productionproduct0).productmodelid = (productionproductmodel0).productmodelid ) + WHERE ((productionproduct0).productmodelid = (productionproductmodel0).productmodelid ) ORDER BY (productionproduct0).productmodelid ASC , (productionproductmodel0).name DESC NULLS FIRST ) select (productionproduct0)."productid",(productionproduct0)."name",(productionproduct0)."productnumber",(productionproduct0)."makeflag",(productionproduct0)."finishedgoodsflag",(productionproduct0)."color",(productionproduct0)."safetystocklevel",(productionproduct0)."reorderpoint",(productionproduct0)."standardcost",(productionproduct0)."listprice",(productionproduct0)."size",(productionproduct0)."sizeunitmeasurecode",(productionproduct0)."weightunitmeasurecode",(productionproduct0)."weight",(productionproduct0)."daystomanufacture",(productionproduct0)."productline",(productionproduct0)."class",(productionproduct0)."style",(productionproduct0)."productsubcategoryid",(productionproduct0)."productmodelid",(productionproduct0)."sellstartdate"::text,(productionproduct0)."sellenddate"::text,(productionproduct0)."discontinueddate"::text,(productionproduct0)."rowguid",(productionproduct0)."modifieddate"::text,(productionunitmeasure0)."unitmeasurecode",(productionunitmeasure0)."name",(productionunitmeasure0)."modifieddate"::text,(productionproductmodel0)."productmodelid",(productionproductmodel0)."name",(productionproductmodel0)."catalogdescription",(productionproductmodel0)."instructions",(productionproductmodel0)."rowguid",(productionproductmodel0)."modifieddate"::text from left_join_cte0 \ No newline at end of file diff --git a/snapshot-tests/zio-jdbc-sql/ProductTest/query0.sql b/snapshot-tests/zio-jdbc-sql/ProductTest/query0.sql index 80e6ea712..917501327 100644 --- a/snapshot-tests/zio-jdbc-sql/ProductTest/query0.sql +++ b/snapshot-tests/zio-jdbc-sql/ProductTest/query0.sql @@ -9,7 +9,7 @@ join_cte2 as ( select productionproduct0, productionproductmodel0 from productionproduct0 join productionproductmodel0 - on ((productionproduct0).productmodelid = (productionproductmodel0).productmodelid) + on ((productionproduct0).productmodelid = (productionproductmodel0).productmodelid ) ), productionproductsubcategory0 as ( @@ -19,7 +19,7 @@ join_cte1 as ( select productionproduct0, productionproductmodel0, productionproductsubcategory0 from join_cte2 join productionproductsubcategory0 - on ((productionproduct0).productsubcategoryid = (productionproductsubcategory0).productsubcategoryid) + on ((productionproduct0).productsubcategoryid = (productionproductsubcategory0).productsubcategoryid ) ), productionproductcategory0 as ( @@ -29,7 +29,7 @@ join_cte0 as ( select productionproduct0, productionproductmodel0, productionproductsubcategory0, productionproductcategory0 from join_cte1 join productionproductcategory0 - on ((productionproductsubcategory0).productcategoryid = (productionproductcategory0).productcategoryid) + on ((productionproductsubcategory0).productcategoryid = (productionproductcategory0).productcategoryid ) ) select (productionproduct0)."productid",(productionproduct0)."name",(productionproduct0)."productnumber",(productionproduct0)."makeflag",(productionproduct0)."finishedgoodsflag",(productionproduct0)."color",(productionproduct0)."safetystocklevel",(productionproduct0)."reorderpoint",(productionproduct0)."standardcost",(productionproduct0)."listprice",(productionproduct0)."size",(productionproduct0)."sizeunitmeasurecode",(productionproduct0)."weightunitmeasurecode",(productionproduct0)."weight",(productionproduct0)."daystomanufacture",(productionproduct0)."productline",(productionproduct0)."class",(productionproduct0)."style",(productionproduct0)."productsubcategoryid",(productionproduct0)."productmodelid",(productionproduct0)."sellstartdate"::text,(productionproduct0)."sellenddate"::text,(productionproduct0)."discontinueddate"::text,(productionproduct0)."rowguid",(productionproduct0)."modifieddate"::text,(productionproductmodel0)."productmodelid",(productionproductmodel0)."name",(productionproductmodel0)."catalogdescription",(productionproductmodel0)."instructions",(productionproductmodel0)."rowguid",(productionproductmodel0)."modifieddate"::text,(productionproductsubcategory0)."productsubcategoryid",(productionproductsubcategory0)."productcategoryid",(productionproductsubcategory0)."name",(productionproductsubcategory0)."rowguid",(productionproductsubcategory0)."modifieddate"::text,(productionproductcategory0)."productcategoryid",(productionproductcategory0)."name",(productionproductcategory0)."rowguid",(productionproductcategory0)."modifieddate"::text from join_cte0 \ No newline at end of file diff --git a/snapshot-tests/zio-jdbc-sql/ProductTest/updateReturning.sql b/snapshot-tests/zio-jdbc-sql/ProductTest/updateReturning.sql index a659be50b..7d96f6b67 100644 --- a/snapshot-tests/zio-jdbc-sql/ProductTest/updateReturning.sql +++ b/snapshot-tests/zio-jdbc-sql/ProductTest/updateReturning.sql @@ -1 +1 @@ -UPDATE "production"."product" SET name = substring((upper(reverse(name)) || ?::"public"."Name"), ?::int4, ?::int4)::varchar, listprice = ?::numeric::numeric, reorderpoint = (reorderpoint + ?::int2)::int2 WHERE coalesce((productid = ?::int4), ?::boolean) returning "productid", "name", "productnumber", "makeflag", "finishedgoodsflag", "color", "safetystocklevel", "reorderpoint", "standardcost", "listprice", "size", "sizeunitmeasurecode", "weightunitmeasurecode", "weight", "daystomanufacture", "productline", "class", "style", "productsubcategoryid", "productmodelid", "sellstartdate"::text, "sellenddate"::text, "discontinueddate"::text, "rowguid", "modifieddate"::text \ No newline at end of file +UPDATE "production"."product" SET name = substring((upper(reverse(name )) || ?::"public"."Name"), ?::int4, ?::int4)::varchar, listprice = ?::numeric::numeric, reorderpoint = (reorderpoint + ?::int2)::int2 WHERE coalesce((productid = ?::int4), ?::boolean) returning "productid", "name", "productnumber", "makeflag", "finishedgoodsflag", "color", "safetystocklevel", "reorderpoint", "standardcost", "listprice", "size", "sizeunitmeasurecode", "weightunitmeasurecode", "weight", "daystomanufacture", "productline", "class", "style", "productsubcategoryid", "productmodelid", "sellstartdate"::text, "sellenddate"::text, "discontinueddate"::text, "rowguid", "modifieddate"::text \ No newline at end of file diff --git a/snapshot-tests/zio-jdbc-sql/SeekTest/complex.sql b/snapshot-tests/zio-jdbc-sql/SeekTest/complex.sql index e64179f49..4b937529b 100644 --- a/snapshot-tests/zio-jdbc-sql/SeekTest/complex.sql +++ b/snapshot-tests/zio-jdbc-sql/SeekTest/complex.sql @@ -1,5 +1,5 @@ with productionproduct0 as ( - (select productionproduct0 from "production"."product" productionproduct0 WHERE ((((productionproduct0).name > ?::"public"."Name") OR (((productionproduct0).name = ?::"public"."Name") AND ((productionproduct0).weight < ?::numeric))) OR ((((productionproduct0).name = ?::"public"."Name") AND ((productionproduct0).weight = ?::numeric)) AND ((productionproduct0).listprice < ?::numeric))) ORDER BY (productionproduct0).name ASC , (productionproduct0).weight DESC , (productionproduct0).listprice DESC ) + (select productionproduct0 from "production"."product" productionproduct0 WHERE ((((productionproduct0).name > ?::"public"."Name") OR (((productionproduct0).name = ?::"public"."Name") AND ((productionproduct0).weight < ?::numeric))) OR ((((productionproduct0).name = ?::"public"."Name") AND ((productionproduct0).weight = ?::numeric)) AND ((productionproduct0).listprice < ?::numeric))) ORDER BY (productionproduct0).name ASC , (productionproduct0).weight DESC , (productionproduct0).listprice DESC ) ) select (productionproduct0)."productid",(productionproduct0)."name",(productionproduct0)."productnumber",(productionproduct0)."makeflag",(productionproduct0)."finishedgoodsflag",(productionproduct0)."color",(productionproduct0)."safetystocklevel",(productionproduct0)."reorderpoint",(productionproduct0)."standardcost",(productionproduct0)."listprice",(productionproduct0)."size",(productionproduct0)."sizeunitmeasurecode",(productionproduct0)."weightunitmeasurecode",(productionproduct0)."weight",(productionproduct0)."daystomanufacture",(productionproduct0)."productline",(productionproduct0)."class",(productionproduct0)."style",(productionproduct0)."productsubcategoryid",(productionproduct0)."productmodelid",(productionproduct0)."sellstartdate"::text,(productionproduct0)."sellenddate"::text,(productionproduct0)."discontinueddate"::text,(productionproduct0)."rowguid",(productionproduct0)."modifieddate"::text from productionproduct0 \ No newline at end of file diff --git a/snapshot-tests/zio-jdbc-sql/SeekTest/uniform-ascending.sql b/snapshot-tests/zio-jdbc-sql/SeekTest/uniform-ascending.sql index 2941af242..83b5faba4 100644 --- a/snapshot-tests/zio-jdbc-sql/SeekTest/uniform-ascending.sql +++ b/snapshot-tests/zio-jdbc-sql/SeekTest/uniform-ascending.sql @@ -1,5 +1,5 @@ with productionproduct0 as ( - (select productionproduct0 from "production"."product" productionproduct0 WHERE (((productionproduct0).name,(productionproduct0).weight,(productionproduct0).listprice) > (?::"public"."Name",?::numeric,?::numeric)) ORDER BY (productionproduct0).name ASC , (productionproduct0).weight ASC , (productionproduct0).listprice ASC ) + (select productionproduct0 from "production"."product" productionproduct0 WHERE (((productionproduct0).name ,(productionproduct0).weight ,(productionproduct0).listprice ) > (?::"public"."Name",?::numeric,?::numeric)) ORDER BY (productionproduct0).name ASC , (productionproduct0).weight ASC , (productionproduct0).listprice ASC ) ) select (productionproduct0)."productid",(productionproduct0)."name",(productionproduct0)."productnumber",(productionproduct0)."makeflag",(productionproduct0)."finishedgoodsflag",(productionproduct0)."color",(productionproduct0)."safetystocklevel",(productionproduct0)."reorderpoint",(productionproduct0)."standardcost",(productionproduct0)."listprice",(productionproduct0)."size",(productionproduct0)."sizeunitmeasurecode",(productionproduct0)."weightunitmeasurecode",(productionproduct0)."weight",(productionproduct0)."daystomanufacture",(productionproduct0)."productline",(productionproduct0)."class",(productionproduct0)."style",(productionproduct0)."productsubcategoryid",(productionproduct0)."productmodelid",(productionproduct0)."sellstartdate"::text,(productionproduct0)."sellenddate"::text,(productionproduct0)."discontinueddate"::text,(productionproduct0)."rowguid",(productionproduct0)."modifieddate"::text from productionproduct0 \ No newline at end of file diff --git a/snapshot-tests/zio-jdbc-sql/SeekTest/uniform-descending.sql b/snapshot-tests/zio-jdbc-sql/SeekTest/uniform-descending.sql index 2a8b29a75..7e5fb1588 100644 --- a/snapshot-tests/zio-jdbc-sql/SeekTest/uniform-descending.sql +++ b/snapshot-tests/zio-jdbc-sql/SeekTest/uniform-descending.sql @@ -1,5 +1,5 @@ with productionproduct0 as ( - (select productionproduct0 from "production"."product" productionproduct0 WHERE (((productionproduct0).name,(productionproduct0).weight,(productionproduct0).listprice) < (?::"public"."Name",?::numeric,?::numeric)) ORDER BY (productionproduct0).name DESC , (productionproduct0).weight DESC , (productionproduct0).listprice DESC ) + (select productionproduct0 from "production"."product" productionproduct0 WHERE (((productionproduct0).name ,(productionproduct0).weight ,(productionproduct0).listprice ) < (?::"public"."Name",?::numeric,?::numeric)) ORDER BY (productionproduct0).name DESC , (productionproduct0).weight DESC , (productionproduct0).listprice DESC ) ) select (productionproduct0)."productid",(productionproduct0)."name",(productionproduct0)."productnumber",(productionproduct0)."makeflag",(productionproduct0)."finishedgoodsflag",(productionproduct0)."color",(productionproduct0)."safetystocklevel",(productionproduct0)."reorderpoint",(productionproduct0)."standardcost",(productionproduct0)."listprice",(productionproduct0)."size",(productionproduct0)."sizeunitmeasurecode",(productionproduct0)."weightunitmeasurecode",(productionproduct0)."weight",(productionproduct0)."daystomanufacture",(productionproduct0)."productline",(productionproduct0)."class",(productionproduct0)."style",(productionproduct0)."productsubcategoryid",(productionproduct0)."productmodelid",(productionproduct0)."sellstartdate"::text,(productionproduct0)."sellenddate"::text,(productionproduct0)."discontinueddate"::text,(productionproduct0)."rowguid",(productionproduct0)."modifieddate"::text from productionproduct0 \ No newline at end of file diff --git a/typo-dsl-anorm/src/scala/typo/dsl/SqlExpr.scala b/typo-dsl-anorm/src/scala/typo/dsl/SqlExpr.scala index afbd0581d..890f9a080 100644 --- a/typo-dsl-anorm/src/scala/typo/dsl/SqlExpr.scala +++ b/typo-dsl-anorm/src/scala/typo/dsl/SqlExpr.scala @@ -111,7 +111,7 @@ object SqlExpr { val sqlWriteCast: Option[String] final def value(ctx: RenderCtx): String = ctx.alias.get(path).fold("")(alias => s"($alias).") + name - final def render(ctx: RenderCtx, counter: AtomicInteger): Fragment = Fragment(value(ctx)) + final def render(ctx: RenderCtx, counter: AtomicInteger): Fragment = Fragment(value(ctx)) ++ Fragment(" ") } sealed trait FieldLikeNotIdNoHkt[NT, R] extends FieldLikeNoHkt[NT, R] diff --git a/typo-dsl-doobie/src/scala/typo/dsl/SqlExpr.scala b/typo-dsl-doobie/src/scala/typo/dsl/SqlExpr.scala index 6b487b18b..c973e9ed9 100644 --- a/typo-dsl-doobie/src/scala/typo/dsl/SqlExpr.scala +++ b/typo-dsl-doobie/src/scala/typo/dsl/SqlExpr.scala @@ -112,7 +112,7 @@ object SqlExpr { val sqlReadCast: Option[String] val sqlWriteCast: Option[String] final def value(ctx: RenderCtx): String = ctx.alias.get(path).fold("")(alias => s"($alias).") + name - final def render(ctx: RenderCtx): Fragment = Fragment.const0(value(ctx)) + final def render(ctx: RenderCtx): Fragment = Fragment.const0(value(ctx)) ++ Fragment.const("") } sealed trait FieldLikeNotIdNoHkt[NT, R] extends FieldLikeNoHkt[NT, R] diff --git a/typo-dsl-zio-jdbc/src/scala/typo/dsl/SqlExpr.scala b/typo-dsl-zio-jdbc/src/scala/typo/dsl/SqlExpr.scala index c8fc4ac61..f6a2096c3 100644 --- a/typo-dsl-zio-jdbc/src/scala/typo/dsl/SqlExpr.scala +++ b/typo-dsl-zio-jdbc/src/scala/typo/dsl/SqlExpr.scala @@ -108,7 +108,7 @@ object SqlExpr { val sqlReadCast: Option[String] val sqlWriteCast: Option[String] final def value(ctx: RenderCtx): String = ctx.alias.get(path).fold("")(alias => s"($alias).") + name - final def render(ctx: RenderCtx): SqlFragment = SqlFragment(value(ctx)) + final def render(ctx: RenderCtx): SqlFragment = SqlFragment(value(ctx)) ++ SqlFragment(" ") } sealed trait FieldLikeNotIdNoHkt[NT, R] extends FieldLikeNoHkt[NT, R] diff --git a/typo-tester-anorm/src/scala/adventureworks/PaginationTest.scala b/typo-tester-anorm/src/scala/adventureworks/PaginationTest.scala index 5f0a8489c..2810e5815 100644 --- a/typo-tester-anorm/src/scala/adventureworks/PaginationTest.scala +++ b/typo-tester-anorm/src/scala/adventureworks/PaginationTest.scala @@ -75,7 +75,7 @@ class PaginationTest extends AnyFunSuite with TypeCheckedTripleEquals { ClientCursor( Map( SortOrderRepr("(personbusinessentity0).modifieddate") -> JsString("2020-12-29T00:00:00"), - SortOrderRepr("((personbusinessentity0).businessentityid - {param1}::INTEGER):2") -> JsNumber(BigDecimal(1)) + SortOrderRepr("((personbusinessentity0).businessentityid - {param1}::INTEGER):2") -> JsNumber(BigDecimal(1)) ) ) ) @@ -91,7 +91,7 @@ class PaginationTest extends AnyFunSuite with TypeCheckedTripleEquals { ClientCursor( Map( SortOrderRepr("(personbusinessentity0).modifieddate") -> JsString("2020-12-25T00:00:00"), - SortOrderRepr("((personbusinessentity0).businessentityid - {param1}::INTEGER):2") -> JsNumber(BigDecimal(15)) + SortOrderRepr("((personbusinessentity0).businessentityid - {param1}::INTEGER):2") -> JsNumber(BigDecimal(15)) ) ) ) diff --git a/typo-tester-doobie/src/scala/adventureworks/DSLTest.scala b/typo-tester-doobie/src/scala/adventureworks/DSLTest.scala index 5dff07fb5..255080d29 100644 --- a/typo-tester-doobie/src/scala/adventureworks/DSLTest.scala +++ b/typo-tester-doobie/src/scala/adventureworks/DSLTest.scala @@ -5,6 +5,7 @@ import adventureworks.humanresources.employee.EmployeeRepoImpl import adventureworks.person.businessentity.BusinessentityRepoImpl import adventureworks.person.emailaddress.EmailaddressRepoImpl import adventureworks.person.person.PersonRepoImpl +import adventureworks.public.pgtest.PgtestRepoImpl import adventureworks.sales.salesperson.SalespersonRepoImpl import adventureworks.userdefined.FirstName import doobie.free.connection.delay @@ -45,4 +46,11 @@ class DSLTest extends SnapshotTest { } yield () } } + + test("fix #129") { + withConnection { + val repo = new PgtestRepoImpl + repo.select.where(_.bool).orderBy(_.bool.asc).toList.map(res => assert(res.length === 0)) + } + } } diff --git a/typo-tester-doobie/src/scala/adventureworks/PaginationTest.scala b/typo-tester-doobie/src/scala/adventureworks/PaginationTest.scala index 9b44ea1e5..ee16fe72d 100644 --- a/typo-tester-doobie/src/scala/adventureworks/PaginationTest.scala +++ b/typo-tester-doobie/src/scala/adventureworks/PaginationTest.scala @@ -78,7 +78,7 @@ class PaginationTest extends AnyFunSuite with TypeCheckedTripleEquals { ClientCursor( Map( SortOrderRepr("(personbusinessentity0).modifieddate") -> Json.fromString("2020-12-29T00:00:00"), - SortOrderRepr("((personbusinessentity0).businessentityid - ? ) :2") -> Json.fromInt(1) + SortOrderRepr("((personbusinessentity0).businessentityid - ? ) :2") -> Json.fromInt(1) ) ) ) @@ -97,7 +97,7 @@ class PaginationTest extends AnyFunSuite with TypeCheckedTripleEquals { ClientCursor( Map( SortOrderRepr("(personbusinessentity0).modifieddate") -> Json.fromString("2020-12-25T00:00:00"), - SortOrderRepr("((personbusinessentity0).businessentityid - ? ) :2") -> Json.fromInt(15) + SortOrderRepr("((personbusinessentity0).businessentityid - ? ) :2") -> Json.fromInt(15) ) ) ) diff --git a/typo-tester-zio-jdbc/src/scala/adventureworks/PaginationTest.scala b/typo-tester-zio-jdbc/src/scala/adventureworks/PaginationTest.scala index f38da71e9..e8fd195f9 100644 --- a/typo-tester-zio-jdbc/src/scala/adventureworks/PaginationTest.scala +++ b/typo-tester-zio-jdbc/src/scala/adventureworks/PaginationTest.scala @@ -66,7 +66,7 @@ class PaginationTest extends AnyFunSuite with TypeCheckedTripleEquals { ClientCursor( Map( SortOrderRepr("(personbusinessentity0).modifieddate") -> new Json.Str("2020-12-29T00:00:00"), - SortOrderRepr("((personbusinessentity0).businessentityid - 2::int4)") -> new Json.Num(java.math.BigDecimal.valueOf(1)) + SortOrderRepr("((personbusinessentity0).businessentityid - 2::int4)") -> new Json.Num(java.math.BigDecimal.valueOf(1)) ) ) ) @@ -84,7 +84,7 @@ class PaginationTest extends AnyFunSuite with TypeCheckedTripleEquals { ClientCursor( Map( SortOrderRepr("(personbusinessentity0).modifieddate") -> new Json.Str("2020-12-25T00:00:00"), - SortOrderRepr("((personbusinessentity0).businessentityid - 2::int4)") -> new Json.Num(java.math.BigDecimal.valueOf(15)) + SortOrderRepr("((personbusinessentity0).businessentityid - 2::int4)") -> new Json.Num(java.math.BigDecimal.valueOf(15)) ) ) )