mothership-ec / cog

Cog
Other
2 stars 3 forks source link

Maintain join order in query builder, plus unit tests #462

Closed thomasjthomasj closed 9 years ago

thomasjthomasj commented 9 years ago

This PR maintains the order in which joins are added to the query builder, as before the inner joins were being output before the left joins, which could lead to errors if an inner join relied on a left join.

This PR groups all joins in an array together and marks them with a type. A switch is then used when building the query string

kuiche commented 9 years ago

Can you remove this variable? https://github.com/mothership-ec/cog/pull/462/files#diff-e326b6c49b5d296e0cbda93f48e541ebR37