Using an object-relational mapper to convert between databases

B

Ben Sizer

Hello,

I'd like to be able to do the following:

- open a connection to a MySQL or PostgreSQL database
- read the schema and contents for one or more tables
- create a new sqlite database file and open a connection to it
- write out the previously-read tables and their contents to this new
database

I get the impression that the various object-relational mappers such
as SQLAlchemy and SQLObject can make this easier, especially if using
something like SQLAlchemy's autoloading capability to query the schema
from the DB rather than me having to explicitly specify it. But then
how easy is it to make a corresponding sqlite table and write the same
objects to it? I don't know how practical this is with SQLAlchemy, or
if a different ORM library would be more useful for this. And since
objects tend to be closely related to the database they are mapped to,
I don't know how easy it is to reflect them onto a second database.

I'd just like some advice and pointers from anybody who's tried
something similar to this or who knows the packages well enough to
point me in the right direction.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top