wangjp01 f3bc7427be protocbuffer file: XXX_NoUnkeyedLiteral struct{} json:"-"
db.Find(&Srt) raise error:
     field XXX_NoUnkeyedLiteral: define a valid foreign key for relations or implement the Valuer/Scanner interface
HOW:add filter: field.Tag.Get("json") != "-"
WHY:unsupported parsing type: struct{}    set guessLevel to guessEmbeddedHas
     have been commented:schema/relationship.go:381
     as follows:
     reguessOrErr := func() {
     		switch cgl {
     		case guessGuess:
     			schema.guessRelation(relation, field, guessBelongs)
     		case guessBelongs:
     			schema.guessRelation(relation, field, guessEmbeddedBelongs)
     		case guessEmbeddedBelongs:
     			schema.guessRelation(relation, field, guessHas)
     		case guessHas:
     			schema.guessRelation(relation, field, guessEmbeddedHas)
     		// case guessEmbeddedHas:
     		default:
     			schema.err = fmt.Errorf("invalid field found for struct %v's field %s: define a valid foreign key for relations or implement the Valuer/Scanner interface", schema, field.Name)
     		}
     	}
2021-10-11 19:12:00 +08:00
2021-10-08 10:51:53 +08:00
2021-06-10 10:21:28 +08:00
2021-09-28 22:37:15 +08:00
2021-03-24 14:22:36 +08:00
2021-03-24 14:22:36 +08:00
2021-03-19 15:55:38 +08:00
2015-01-05 08:59:18 +08:00
2020-06-09 12:00:43 +08:00
2021-01-28 10:21:58 +08:00
2021-09-17 18:35:14 +08:00
2021-06-01 18:34:38 +08:00

GORM

The fantastic ORM library for Golang, aims to be developer friendly.

go report card test status Join the chat at https://gitter.im/jinzhu/gorm Open Collective Backer Open Collective Sponsor MIT license Go.Dev reference

Overview

  • Full-Featured ORM
  • Associations (Has One, Has Many, Belongs To, Many To Many, Polymorphism, Single-table inheritance)
  • Hooks (Before/After Create/Save/Update/Delete/Find)
  • Eager loading with Preload, Joins
  • Transactions, Nested Transactions, Save Point, RollbackTo to Saved Point
  • Context, Prepared Statement Mode, DryRun Mode
  • Batch Insert, FindInBatches, Find To Map
  • SQL Builder, Upsert, Locking, Optimizer/Index/Comment Hints, NamedArg, Search/Update/Create with SQL Expr
  • Composite Primary Key
  • Auto Migrations
  • Logger
  • Extendable, flexible plugin API: Database Resolver (Multiple Databases, Read/Write Splitting) / Prometheus…
  • Every feature comes with tests
  • Developer Friendly

Getting Started

Contributing

You can help to deliver a better GORM, check out things you can do

License

© Jinzhu, 2013~time.Now

Released under the MIT License

Description
The fantastic ORM library for Golang, aims to be developer friendly
Readme
Languages
Go 99.9%
Shell 0.1%