Error when attempting to join relations across different databases
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 25/100
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- Ruby
- スター
- 220
- フォーク
- 97
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rom-rb/rom-sql のほかの issue
-
bug help wanted
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
-
bug help wanted
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
-
bug help wanted
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
-
bug help wanted
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
-
bug help wanted
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
account: profile
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
bug good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
ysb3996-blip/oops#24 ·
メンテナーはふだん 1 日以内に返信