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.

Reply via email to