That is right, we don't know what is the database will be operated (import DB, export DB, etc)at what is the time. So, we need to controll how to use and create the database connect in action. I really don't think a good way to do that.
2011/10/9 Jeremy Evans <[email protected]>: > On Oct 9, 5:16 am, Jason Rogers <[email protected]> wrote: >> There's still do not need to create the database objects in your >> routes. Use a configure block like the following, then reference the >> database constants in your routes: >> >> configure do >> BLOG_DB = Sequel.connect("sqlite://db/blog/data.db") >> PICTURES_DB = Sequel.connect("sqlite://db/pictures/data.db") >> RECORDS_DB = Sequel.connect("sqlite://db/records/data.db") >> end >> >> get '/' do >> #do something with BLOG_DB >> #do something with PICTURES_DB >> #do something RECORDS_DB >> end > > This is the recommended way if you want to use multiple databases. > The only reason you would need to create Database objects inside an > action is if the database connection parameters are derived from the > action's parameters. > > 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. > > -- 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.
