Hey, Jeremy!
It looks like I'm running 4.10.0. Here's a cut-down example of what I've
got going on:
module DatabaseA
class Member < Sequel::Model(DATABASEA[:members])
many_to_one :person, key: :entityid, class: "DatabaseB::Person",
reciprocal: true
end
end
module DatabaseB
class Person < Sequel::Model(DATABASEB[:people])
one_to_many :accounts, key: :entityid, class: "DatabaseA::Member" do
|ds|
ds.where archived: false
end
end
end
If I try something like:
member_dataset.eager_graph(:person).all
I get "Sequel::DatabaseError: TinyTds::Error: Invalid object name 'PEOPLE'."
Hopefully that helps explain the issue I'm having.
Thanks for the prompt response!
-Patrick
On Wednesday, May 21, 2014 3:01:09 PM UTC-4, Jeremy Evans wrote:
>
> On Wednesday, May 21, 2014 11:51:57 AM UTC-7, Patrick Kuykendall wrote:
>>
>> Hey guys,
>>
>> I'm having a little bit of trouble eager_graphing associations between
>> models that are on separate database connections (MS SQL Server, using
>> tiny_tds, for what it's worth). The eager_graph isn't able to properly join
>> associations that exist on different databases since the tables aren't
>> qualified with the database name in the generated query.
>>
>> I didn't see too much in the documentation directed at this, so I may be
>> missing something. I'm just looking for a way to avoid recreating the join
>> clause each time I need to join the tables.
>>
>> Thanks, in advance, for any input you can provide!
>>
>
> First, what version of Sequel are you running? There were a few
> eager_graph corner cases fixed in 4.9.0, including fixes for qualified
> identifiers, so if you are using <4.9.0, try upgrading.
>
> If upgrading doesn't fix it or you are already on the latest version,
> please post a self-contained example showing the problem.
>
> Thanks,
> Jeremy
>
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.