On Saturday, April 28, 2012 10:38:53 AM UTC-7, John wrote: > > Hi Jeremy, > > Thank you for the fast reply, will try this out later today. > > I want to load the models before opening the database connection for my > Address Book importer script. The idea is to allow people to upload their > Address Book archives through an upload form. This means the database > doesn't exist yet when the code is loaded, it's an SQLite database > contained in the archive that is uploaded. The schema is known but the > database itself isn't available yet. > > For something like this, there are a few possibilities that come to mind:
1) Connect to an empty database with the same schema before loading the models, then call db= on the related models later to change the database. 2) Use the sharding support, with add_servers and Database#disconnect to change the actual database. 3) Create separate model subclasses for each database connection. 4) Don't use models at all, use plain datasets. Jeremy -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/sequel-talk/-/SaKLdBOt_bQJ. 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.
