Hey I was wondering if somebody could by chance ex...
# squarelibraries
t
Hey I was wondering if somebody could by chance explain or link me to an article explaining how to properly convert my objects from database to mutable objects that I can then pipe back into the database. I'm looking to hold these database objects in memory mutate them then eventually put the data back into the database but I just wanted to get some advice or read an article before I did anything, thank you.
h
Sqldelight does not use data access objects (DAO) fetching the whole row as an object with automatic saving or relationship fetching. This often results into an overhead because you don’t need the whole row. Instead, you fetch the data you actually need, and create an insert/update statement to save the relevant changes yourself.
t
I made a reply without fully understanding what you meant, my apologies. I did my research to understand your reply and I get what you mean. It’s just for my use case I need to persist for example, a User object with all its fields in memory for some time until the client disconnects. I want to have some mutable fields on this object and the only decent way I’ve seen to be able to do this is to create a UserModel class to parity the data I need.