-
Notifications
You must be signed in to change notification settings - Fork 0
JOIN
Alex edited this page Jul 29, 2018
·
2 revisions
Possible structures:
-
String
- just passed in toJOIN #{structure}
-
Array
with values(same order):- table representation
-
Hash
-
:on
- conditions -
:option
- optional - containsSymbol
orString
of join type... rename to type?
-
-
Array
with combination of possible structures.
join: 'users u ON u.id = m.user_id'
join: ['users u ON u.id = m.user_id',
'skills s ON u.id = s.user_id']
join: [[:user, :u], { on: 'rgl = 123' }]
# => 'JOIN users u ON rgl = 123'
join: [[[:user, :u], { option: :full, on: [:or, 'mrgl = 2', 'rgl = 22'] }],
[:master, { on: ['z = 12', 'mrgl = 12'] }]]
# => 'FULL JOIN user u ON mrgl = 2 OR rgl = 22 JOIN master ON z = 12 AND mrgl = 12'
Need some meditations over it structure...