Comments (2)
Hi Erkan,
Sorry for the delay, but I was contaminated. I hope you're fine.
Godb is not designed to work this way, because it does not allocate nested structures, only the root one if needed (it depends on the target, slice of object, or slice of pointers to objects). This kind of job is closer to what will do a more featured tools like an ORM.
The way to cope with this is using only SQL.NullXXXX for fields on the optional part of the DB response.
I have to admit that it could be a problem with JSON serialisation. But using the same structure for both DB access and HTTP response is not a good practice for real products (expect simple ones).
Changing the way it works will not be a trivial thing.
Sam.
from godb.
Thank you for response and I wish you get well soon.
About me, I'm fine thanks, we're locked in.
You are right about using same structure for DB and HTTP response but otherwise code gets lots of overhead. I'll check a way around. Closing this issue for now.
from godb.
Related Issues (20)
- Context support HOT 2
- Null* times MarshalJSON and UnmarshalJSON HOT 3
- Need better UUID/GUID support HOT 5
- White/Black list support for struct Update/Insert HOT 3
- Upsert support HOT 4
- Standardization of common errors for db backends HOT 2
- Added Int64Slice,StrSlice,Float64Slice and BoolSlice HOT 3
- Supporting Column Alias HOT 1
- Map type
- Run `staticcheck` with the CI HOT 1
- While trying to go get godb, unknown revision errors on golang.org/x/net HOT 2
- Module moved: git.apache.org/thrift.git v0.12.0 go.mod
- Create new release with module changes HOT 4
- Local cache, remote DB HOT 2
- postgresql schema HOT 3
- Using one connection in several goroutines HOT 2
- Request Feature - ToSQL on struct_insert.go HOT 3
- Mapping pointer values HOT 2
- question: how exec join query HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from godb.