Code generation for Drift tables and DAOs for an imported package from a separate repository #3331
Replies: 1 comment 2 replies
-
It's not possible with
To be fair, it's not terrible IMO. If you have things like json serialization with I have an example here that uses multiple packages with shared code. I don't get the warning about transitive digests there, and the build setup is not that special. Are you using the modular builder from drift? |
Beta Was this translation helpful? Give feedback.
-
Hi, I was trying to implement a modular structure for an application that I am building for my internship assignment and I want to achieve reusable modules, so the modules can be imported in other future applications as packages and added to their persistence layer.
Currently, each module has it's own pubspec.yaml and build.yaml to generate the necessary code for the tables and DAOs of a module. However, when I import a module within an app that needs to use that module I get a warning regarding "build_resolvers"
I am in a bit of doubt if it's possible to generate the code for the imported modules that have drift tables and daos within the working app, I tried to configure the build.yaml but no result. I would just push the generated code from the module itself but as I know pushing generated code to remote repository isn't really a good practice.
Does anyone know a workaround this?
in order to make modules reusable I have defined an abstract class that needs to be implemented by each module. The abstractions are located in a separate package to prevent circular dependency.
When a future app needs a module like a Timesheet, it will just import that one as a package and add it to their Drift Database to have all the tables before building the database schema.
Beta Was this translation helpful? Give feedback.
All reactions