A Golang ORM that supports MySQL, PostgreSQL, SQLite, SQL Server.
Connect to DB
Use
PostgreSQL
as an example below.// https://github.com/go-gorm/postgres
db, err := gorm.Open(postgres.New(postgres.Config{
DSN: "user=gorm password=gorm dbname=gorm port=9920 sslmode=disable TimeZone=Asia/Shanghai",
PreferSimpleProtocol: true, // disables implicit prepared statement usage
}), &gorm.Config{})
CRUDIgnore fields