I have quite the task ahead of me, and I am hoping Alembic and SQLAlchemy 
can do what I need.


I want to develop a desktop application that helps migrate data from one 
SQLite database to a completely different model and back again. So 
migrations right? That’s all well and good, but I need to ensure if I 
haven’t modeled a specific column/table, that it’s ported properly to a 
holding table so that on a round trip to DB1, we can reconstruct the data 
properly.


Example:


DB 1:
> Table *names*
>
ID

First Name

Last Name

Table *address*
>
Street 1

Street 2

City

State

 

> DB2:
> Table *givenName*
>
ID

name

Table *Surname*
>
ID

Name



Say with Alembic I have mapped the following:

> DB1 names.firstname => DB2 givenName.name
> DB1 names.lastname => DB2 surname.name


But say I want to migrate everything from DB1 -> DB2, store the unknown 
data (address table) somewhere, and then reconstruct it properly when I go 
from DB2 -> DB1.


So how I’d envision this is a joiner table of sorts.

> DB2
> Table *joiner*
>
table_name

column_name

data


The thing is I want this to be completely dynamic.


Add an extra complexity, and I want to construct a generator of sorts so I 
can simply pass down new XML/JSON declaration for update file formats. This 
would define the mappings, and any calls to translators already based in 
the code (date conversions, etc).


My question is if this is even possible or conceivable with SQLAlchemy and 
Alembic. How feasible is it?


For a full example of two database formats that need to be migrated from 
one to the other see https://cloudup.com/cYzP2lCQjbo

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to