-
Notifications
You must be signed in to change notification settings - Fork 315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add_synonym with database link #2051
Comments
I use "dblink" for many databases and I'm trying to find a workaround. |
We build a view that returned the information from the database link and used that view as our active record source. The downside is we have to maintain the link and the view outside of active record migrations, but it does work. ActiveRecord's multiple database support looks promising as well, but we did not have time to bring that into our project on our last sprint. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Thanks for opening an issue. I understand dropping database link support causes unexpected issues in your environment. It would be appreciated to implement workarounds to create views on synonyms pointing to database links. |
Thanks for your comment on this issue. Once we figured out what was going on, we did the work around you suggested. We stopped creating the synonyms and switched to views that returned data from the dblink tables. That has worked well for us, so thanks again for documenting those workarounds here and in #1668. The main challenge was figuring out what was happening. My hope with this issue was to see if there was a way to save some debugging time for other developers. One thought was that if Thanks again for all your work on this project. |
First, thank you for all your work on this gem. Our institution has a large investment in oracle and this gem allows us to work in our preferred framework while taking advantage of the oracle resources and expertise of the institution.
While testing our upgrade to rails 6, we started getting errors like
"DESC OTHER_USER.TABLE" failed; does it exist?
After some time we traced the issue to models that were using a synonym that had a database link. With the removal of database link support in #1668 the synonyms were still getting built, but without the link, so the synonym was pointing to a non-existent object.We've worked around the issue, but I wonder if there is a way to save other developers the debugging time.
Steps to reproduce
add_synonym "new_synonym" "other_user.table@dblink", force: true
Expected behavior
Not sure. Perhaps it should raise a error.
It looks like
add_synonym
usesquote_table_name
, which is silently ignoring the link. Couldquote_table_name
instead raise likeConnection#describe
? That could also flag other legacy uses of db links as well.Actual behavior
System configuration
Rails version: 6.0.3.2
Oracle enhanced adapter version: 6.0.4
Ruby version: ruby 2.6.5
Oracle Database version: Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
The text was updated successfully, but these errors were encountered: