Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

korm

Simple ORM For Go

quick start:

type Score struct {
	Id   uint64 `korm:"PRIMARY KEY"`
	Name string `korm:"not null"`
	Age  int8   `korm:"not null default 1"`
}

func main(){
	engine, _ := NewEngine("mysql", "root:123456@/User?charset=utf8")
	defer engine.Close()
	s := engine.NewSession().Model(&Score{})
	_ = s.DropTable()
	_ = s.CreateTable()
	_,_ = s.Insert(&Score{1, "tom", 3})
	score := &Score{}
	_ = s.First(score)
	
	scoreList := []Score{}
	_ = s.Find(&scoreList)
}

About

Simple Orm For Go

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages