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
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'd like to be able to use a protobuf generated struct as the database model. An example model can be:
In this case,
timestamppb
is not supported by bun. This does have aAsTime() time.Time
function but Bun does not know that either.I've investigated using bun scanner to tell Bun how to use it but from my understanding,
timestamppb
would need a method calledScan
.The current solution we're using is just to use a composite struct
It works but is extra code and
Date
needs to be manually set and read from for each db query.Does anyone know of a way to get this to work so bun can correctly marshal/unmarshal to/from a timestamppb?
One other option might be to write a plugin for protoc that will make the dates into a composite struct that has a Scan method.
Beta Was this translation helpful? Give feedback.
All reactions