I´m using a local DB (SQLite with Drift) to persist state. A Repository reads and writes Data to the database and should provide an according Model via it´s API.
So the Database returns a DataClass object and I need to map this data to my ModelClass. Doing that mapping manually in the Repository in each method is anoying and error prone and adding some kind of "fromDataClass" and "toDataClass" to the model itself feels wrong cause the model should be abstracted from the concrete database implementation (and so doesn´t need to know anything about where it´s stored).
However Drift offers support for TypeConverters (https://drift.simonbinder.eu/docs/advanced-features/type_converters/) and I´m not sure if this is the way to go? What is the best way to deal with data mapping when the data comes from a local database?