I have a table that is distributed across multiple (0..n) databases. I
would like to create one model to be used for all these databases.
I order to do that I have created the model with a connection to the first
database. After that, I have duplicated the model class and then changed
it's connection:
db1 = Sequel.connect(%{postgres://server1.example.com/db})
class Message < Sequel::Model(db[:messages])
def my_method
end
end
db2 = Sequel.connect(%{postgres://server2.example.com/db})
Message2 = Message.dup
Message2.db = db2
But this approach does not work since I need at least one connection to
create the first model.
Is it possible to create a model without a db connection? If not, does
someone have a solution for my problem ?
--
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/groups/opt_out.