 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Overview ¶
Package sgorm is a library encapsulated on gorm.io/gorm
Index ¶
Constants ¶
      View Source
      
  
const ( // DBDriverMysql mysql driver DBDriverMysql = "mysql" // DBDriverPostgresql postgresql driver DBDriverPostgresql = "postgresql" // DBDriverTidb tidb driver DBDriverTidb = "tidb" // DBDriverSqlite sqlite driver DBDriverSqlite = "sqlite" )
Variables ¶
      View Source
      
  
var ErrRecordNotFound = gorm.ErrRecordNotFound
    Functions ¶
Types ¶
type Bool ¶ added in v1.12.2
type Bool bool
Bool is a custom type for bit fields in MySQL.
func NewBool ¶ added in v1.12.2
func NewBool(b interface{}) *Bool
    NewBool creates a new *Bool from a bool or *bool.
type Model ¶
type Model struct {
	ID        uint64         `gorm:"column:id;AUTO_INCREMENT;primary_key" json:"id"`
	CreatedAt time.Time      `gorm:"column:created_at" json:"createdAt"`
	UpdatedAt time.Time      `gorm:"column:updated_at" json:"updatedAt"`
	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;index" json:"-"`
}
    Model embedded structs, add `gorm: "embedded"` when defining table structs
type Model2 ¶
type Model2 struct {
	ID        uint64         `gorm:"column:id;AUTO_INCREMENT;primary_key" json:"id"`
	CreatedAt time.Time      `gorm:"column:created_at" json:"created_at"`
	UpdatedAt time.Time      `gorm:"column:updated_at" json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;index" json:"-"`
}
    Model2 embedded structs, json tag named is snake case
       Directories
      ¶
      Directories
      ¶
    
    | Path | Synopsis | 
|---|---|
| Package dbclose provides a function to close gorm db. | Package dbclose provides a function to close gorm db. | 
| Package glog provides a gorm logger implementation based on zap. | Package glog provides a gorm logger implementation based on zap. | 
| Package mysql provides a gorm driver for mysql. | Package mysql provides a gorm driver for mysql. | 
| Package postgresql provides a gorm driver for postgresql. | Package postgresql provides a gorm driver for postgresql. | 
| Package query is a library of custom condition queries, support for complex conditional paging queries. | Package query is a library of custom condition queries, support for complex conditional paging queries. | 
| Package sqlite provides a gorm driver for sqlite. | Package sqlite provides a gorm driver for sqlite. | 
 Click to show internal directories. 
   Click to hide internal directories.