surrealdb_flutter icon indicating copy to clipboard operation
surrealdb_flutter copied to clipboard

Type safety

Open appinteractive opened this issue 11 months ago • 1 comments
trafficstars

Hey thanks for your surreal package 📦

I'm currently trying to get my repositories around the package to be type safe. Looking at the other language clients I realize that they always provide a type as interfaces.

It would be awesome to provide a type for serialization/deserialization on the query method. Something like following:

db.query<UserModel>("select * users");

The data model would need to contain a factory fromJson and a toJson method implemented.

What do you think? 💭

appinteractive avatar Nov 23 '24 14:11 appinteractive

Just by writing that, I realized that it might be way more complex that it seems in the first leave due to the nature of the query command. 🫣

appinteractive avatar Nov 23 '24 14:11 appinteractive