Tuesday, 20 September 2022

Migrate from `ndb` to SQLalchemy?

How do I migrate a codebase from ndb to SQLalchemy?

Tempted to write a parser/emitter, taking in the 40+ ndb.Model of my codebase and generate sqlalchemy.schema.Table or Base inheriting classes. But that doesn't:

  1. solve the data migration problem;
  2. doesn't enable a middle-road, where I can access data before migrating;
  3. requires manual work in migrating all the query syntax over

Happy to do the work, but asking here in case there's a better way (e.g., I saw this 10-year old question Can SQLAlchemy be used with Google Cloud SQL? ; or maybe some way of dumping the schema directly from ndb to SQL then from SQL directly to SQLalchemy).



from Migrate from `ndb` to SQLalchemy?

No comments:

Post a Comment