You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't want to put IDs into my datatypes. I'd prefer to have a WithID wrapper type similar to the following:
dataWithIDa=WithIDRowIDa
and then do something like
instanceSqlRowa=>SqlRow (WithIDa)
which would roughly mean "expand the a into a row and prepend the RowID from WithID. However, it seems to me that a here has to be an SqlType. Is there any way to do what I want?
Context: Let's say I have a type Comment. When the user makes a new Comment, I receive a Comment from the frontend. I store this Comment in the database, and only now it is given an ID. Now, whenever the user views all of his comments, I send WithID Comment to the frontend. As I'd like to avoid having two different datatypes (CommentWithoutID for frontend->db, and CommentWithID for db->frontend), I'm trying to do it with the wrapper instead.
The text was updated successfully, but these errors were encountered:
Great to hear it’s going to be included! Is it impossible to do even with some of the internal types? It’d be nice if I could use some solution before 0.5.2, even if it’s not so nice.
I don't want to put IDs into my datatypes. I'd prefer to have a
WithID
wrapper type similar to the following:and then do something like
which would roughly mean "expand the
a
into a row and prepend the RowID from WithID. However, it seems to me thata
here has to be anSqlType
. Is there any way to do what I want?Context: Let's say I have a type Comment. When the user makes a new Comment, I receive a
Comment
from the frontend. I store thisComment
in the database, and only now it is given an ID. Now, whenever the user views all of his comments, I sendWithID Comment
to the frontend. As I'd like to avoid having two different datatypes (CommentWithoutID
for frontend->db, andCommentWithID
for db->frontend), I'm trying to do it with the wrapper instead.The text was updated successfully, but these errors were encountered: