Error when attempting to join relations across different databases
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 25/100
Direzione di ricerca
Start by reproducing the ROM.container setup with the two MySQL gateways and the cross-relation join shown in the issue. Trace the join entry point and SQL generation until you can identify where gateway or database qualification is lost; done means the generated SQL qualifies users with default and other_users with legacy as shown.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Ruby
- Stelle
- 220
- Fork
- 97
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di rom-rb/rom-sql
-
bug help wanted
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
-
bug help wanted
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
-
bug help wanted
Difficoltà 3/5 1-2 giorni Idoneità per principianti 42/100
-
bug help wanted
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
-
bug help wanted
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
Tutte le issue di rom-rb/rom-sql
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 10 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
I maintainer di solito rispondono entro 2 giorni