Import database from external package #2851
Replies: 1 comment 1 reply
-
As you've seen, drift generates all of its code in a single This should work with separate packages as well if both packages are using modular code generation. It doesn't even have to define a drift database, just DAOs responsible for managing notification functionality. You'd then have a drift database class in your main app importing the notifications schema. Again, I haven't tried this but I see no reason for it to not work. If you run into issues with modular code generation across packages I can also construct an example for that. |
Beta Was this translation helpful? Give feedback.
-
Hey, I have a question that maybe some one on this community can help me with.
I have an external package that takes care of notifications on my app. This external package accesses the database using drift and has some functions that interact with the table and database.
On the main app package I also have a database model specific to the app. How can I "merge" these two databases models so I have only one drift instance on the app?
Importing the notification.drift file on the app.drift file doesn't work cause it creates duplicated classes that the functions on the Notification don't recognise.
Hope the explanation was clear enough for some one to help me out.
Beta Was this translation helpful? Give feedback.
All reactions