Comments (1)
Hello Piotr,
Glad to hear upper/db
is useful for you! Thanks for trying, even with our docs are not so good.
If you're using a serial
field with name id
, try to omit the id
value from being sent using the omitempty
tag, like this:
type User struct {
Id int `field:"id" omitempty:"true"`
Name string `field:"name"`
}
The omitempty
tag skips fields with zero value from being used in a query. That should work with PostgreSQL and serial, let me know how it went.
(I should put that in our docs too).
Regards,
from db.
Related Issues (20)
- Nested struct without db tag not omitted on insert or update
- Feature request: New tag to ignore identity columns on update
- [support] Is there a way to use `not` operator in SQL builder HOT 2
- Build a bigquery adapter HOT 1
- V3 documentation is down HOT 3
- Documentation v4 typo in sql builder example
- Slow query seems too ugly and not fancy. HOT 5
- Project abandoned? HOT 5
- packages need to be upgraded or changed HOT 1
- Slow query HOT 1
- It can't parse cockroachdb DSN HOT 2
- mysql error on scanning binary() field into []byte
- loading module retractions HOT 1
- Data race in template writer when running concurrent tests with go test -race
- help db.v3
- no data in mongodb
- Unhandled error in select.go causes a nil pointer dereference
- Goroutinue leak
- [Bug] TableExists for mssql adapter uses database name as table schema when checking for existence
- pgx v5 support HOT 4
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 db.