go-ozzo / ozzo-dbx

A Go (golang) package that enhances the standard database/sql package by providing powerful data retrieval methods as well as DB-agnostic query building capabilities.
MIT License
638 stars 91 forks source link

How to exclude field with embedded struct? #91

Closed kolkov closed 4 years ago

kolkov commented 4 years ago

Hi! I try to exclude field with embedded struct from inserting to DB, is it possible? For example:

type Contact struct{
    Email string
    Phone string
}

type Person struct{
    Name string
    Age int
    ContactInfo Contact `db:"-"` //not working
}

or r.db.With(ctx).Model(&person).Exclude("ContactInfo").Insert() //not working

kolkov commented 4 years ago

Extra comma instead space in my struct tag definition.