-
-
Notifications
You must be signed in to change notification settings - Fork 399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide ability to read inner structCache #95
Comments
I am building model too and it has everything you mentioned :) But it is not ready yet. #96 is what I already have and it can already do simple queries - https://github.com/go-pg/pg/blob/feature/pg-v4/db_test.go#L176-L191. Any help is appreciated but code is not documented (but it should be clean and readable). |
Great! Hope your model layer will fit my requirements, but now I'm bound to existing codebase. Anyway, what do you think about opening in terms of layers? I've inspected code changes on master and found that index became unexported. It's great to know field depth as I need only top level fields. To achieve this we can define:
With this func we can iterate through
|
If you are bound to existing codebase then it is easier to just fork the lib and export whatever you need since it is very unlikely that v3 will receive big updates.
In v4 I plan to export those API in a subpackage so it does not clatter main API, e.g.:
|
This info is now exported in v4. You can start from reading Table definition https://godoc.org/gopkg.in/pg.v4/orm#Table |
I'm building model layer on top of this wonderful library. And it would be great to have read access to
structs
(structCache).I've monkey-patched my fork with
and used it to access
name
from map,pgValue.Source
andpgValue.Index
.I think it's good to form low level library interface which allows upper levels on top of it.
What do you think about it?
The text was updated successfully, but these errors were encountered: