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
How do you feel about adding a hook that runs after loading an entity? I use this feature (in Gorp) presently for two things:
Eagerly loading relations
Setting Go properties that do not map directly to a SQL data type -- for example, time.Time does not work with sqlite3 -- to work around that, in BeforeSave I set a TimeStr string field on the model, and in AfterGet I parse that property back into the time.Time field.
Although, it looks like there is no way to issue queries from the hook, so use case (1) would not apply anyway.
The text was updated successfully, but these errors were encountered:
ad 2) you can map Go to DB specific types with the dialect interface, no hooks required
PS: there's actually a sqlite dialect implementation, it's just not on the main branch since some methods are missing, and need to be implemented with workarounds (sqlite doesn't support all sql commands).
How do you feel about adding a hook that runs after loading an entity? I use this feature (in Gorp) presently for two things:
Although, it looks like there is no way to issue queries from the hook, so use case (1) would not apply anyway.
The text was updated successfully, but these errors were encountered: