-
-
Notifications
You must be signed in to change notification settings - Fork 94
Open
Labels
Description
Describe the bug
We can't make the code for joining relations across different databases.
To Reproduce
Provide detailed steps to reproduce, an executable script would be best.
- setup the following code.
ROM.container(
default: [:sql, 'mysql2://localhost/defalut'], # gateway 1 and has users table
legacy: [:sql, 'mysql2://localhost/legacy'] # gateway 2 and has other_users table
)
default_relation = rom.relations[:users]
other_relation = container.relations[:other_users]
p default_relation.join(other_relation, container.gateways[:default][:users][:id] => container.gateways[:legacy][:other_users][:default_id])
- Run the script
SELECT * FROM `users` INNER JOIN `other_users` on (`users`.`id` = `other_users`.`default_id`)
Expected behavior
We want to see the output
SELECT * FROM `default`.`users` INNER JOIN `legacy`.`other_users` on (`default`.`users`.`id` = `legacy`.`other_users`.`default_id`)
My environment
- Affects my production application: YES
- Ruby version: ...2.7.7
- OS: Mac