On Wednesday, May 21, 2014 1:05:17 PM UTC-7, Patrick Kuykendall wrote:
>
> 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!
>

Sequel does not support eager_graph between models associated to different 
Database objects. In order for this to work, you need to make sure that the 
models use the same Database object.  For example:

class Person < Sequel::Model(DATABASEA.from(Sequel.qualify(:databaseb, 
Sequel.qualify(Sequel.lit(''), :people)))

I'm not sure if that's the correct syntax to do a cross-database table 
reference in MSSQL, but that or something similar should work.

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.

Reply via email to