diesel/migrations/mysql
Sean Griffin 675ad32659 Allow one form of multi-table joins, generate correct SQL
This enables one half of the two forms of multi-table joins. This commit
enables joins in the form parent -> child -> grandchild. It does not
allow parent -> child -> sibling. More concretely this means that tables
implement `JoinTo<Join<...>>`, but `Join<...>` does not implement
`JoinTo` for anything yet. I don't expect that any additional work will
be required for the other half, just one blanket impl and a lot of
tests.

This also introduces the `enable_multi_table_joins!` macro. This macro
will need to be invoked for any two tables that appear in a join
together that do not have an association. This need will hopefully go
away in the future, but will probably require specialization to be
stable (and support projections on default types which it doesn't
currently).

The SQL here is slightly different than what you'd expect, but matches
how we semantically treat this type of join. We will generate `SELECT *
FROM (users INNER JOIN (posts INNER JOIN comments ON ...) ON ...)` rather
than `SELECT * FROM users INNER JOIN posts ON ... INNER JOIN comments ON
...`. The query plan for these two queries is identical across all
backends.
2017-06-05 12:53:46 -04:00
..
20170207193805_initial_schema Add support for MySQL to diesel_codegen 2017-02-07 16:47:36 -05:00
20170209180355_add_one_off_tables_from_integration_tests Change a bunch of tests to not mutate schema in the test 2017-02-09 15:22:33 -05:00
20170211150830_index_columns_used_in_benchmarks Index columns used in migrations 2017-02-11 11:15:17 -05:00
20170215170122_create_trees Don't generate join impls on self referencing associations 2017-02-15 16:23:25 -05:00
20170219200159_add_foreign_key Adds ForeignKeyViolation for DatabaseErrorKind (#740) 2017-02-25 06:51:59 -05:00
20170407152306_add_nullable_table Allow numeric operations on nullable columns. 2017-04-07 19:24:42 +02:00
20170603131224_add_likes Allow one form of multi-table joins, generate correct SQL 2017-06-05 12:53:46 -04:00