Jaguar-dart / jaguar_orm

Source-generated ORM with relations (one-to-one, one-to-many, many-to-many), preloading, cascading, polymorphic relations, etc
https://jaguar-dart.github.io
BSD 3-Clause "New" or "Revised" License
217 stars 54 forks source link

v4 sqflite, no migration possible #167

Open jaumard opened 4 years ago

jaumard commented 4 years ago

With the migration to sqflite to v4, it's now no more possible to use sqflite capabilities like migration stuff (but more than migration, the lifecycle of the database is now hidden and not accessible).

I think we should still pass the sqflite database to the adapter like we did before, it allow users to do stuff before setting up jaguar.

devjeff commented 4 years ago

Concerning database migration: Which solution of the following would be better?

  1. Provide a possibility to handle the migration via the SqfliteAdapter, e. g. by passing an 'onUpgrade' and 'onDowngrade' function.
  2. Create a DB migration solution directly within the Jaguar ORM library that is independent of the underlying DB adapter and thus would work with every database.