On Dec 9, 6:43 pm, Christer Nilsson <[email protected]>
wrote:
> With MySql I can do this:
>
> class Customer < Sequel::Model(:samm__tblorganisation)
> end
>
> "samm" being the database.
>
> When I do this with SQL Server
>
> class Company < Sequel::Model(:LX__SYS_Company)
> end
>
> "LX" being the database,

With :LX__SYS_Company as a table name symbol, you are actually
specifying a table qualified by a schema.  With MySQL, that's the same
as another table in the same database (because MySQL has no schema
support).  With SQL Server (which has schema support), it's something
quite different.

With 25 databases on each of four servers, are the tables the same/
replicated on each server?  Are they sharded?  Are you trying to use a
single Sequel::Database object to access all 100 databases?

My guess is you are going to want 25 separate Sequel::Database objects
(at least, possibly 100).  This is done:

  LXDB = Sequel.connect(...)
  EXDB = Sequel.connect(...)
  DXDB = Sequel.connect(...)

And using them like:

  class Company < Sequel::Model(LXDB[:SYS_Company])
  end

> company = Company[2468]
>
> gives the sql:
> SELECT * FROM [LX].[SYS_COMPANY] WHERE [COMPANYID] = 2468
>
> but I would like to see:
> SELECT * FROM [LX].dbo.[SYS_COMPANY] WHERE [COMPANYID] = 2468
> or
> SELECT * FROM [LX]..[SYS_COMPANY] WHERE [COMPANYID] = 2468
>
> Is there a solution to this?

That syntax is quite foreign to me, but this may work (if you don't
want to use the separate database objects as I recommended above):

  class Company < Sequel::Model(:dbo__SYS_COMPANY.qualify(:LX))
  end

Jeremy

--

You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.


Reply via email to