package
module
Version:
v0.1.0
Opens a new window with list of versions in this module.
Published: Jun 28, 2021
License: MIT
Opens a new window with license information.
Imports: 7
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
godb
USE
package database
import (
"gorm.io/gorm"
"ruan.co/godb"
)
func init() {
dialects := "mysql"
dsn := "root:123456@tcp(127.0.0.1:3306)/godb?charset=utf8mb4&parseTime=True&loc=Local"
// dialects := "sqlite"
// dsn := "godb.db"
// dialects := "postgres"
// dsn := "host=localhost user=root password=123456 dbname=gorm port=9920 sslmode=disable TimeZone=Asia/Shanghai"
// dialects := "sqlserver"
// dsn := "sqlserver://root:123456@localhost:9930?database=godb"
// dialects := "clickhouse"
// dsn := "tcp://localhost:9000?database=godb&username=root&password=123456&read_timeout=10&write_timeout=20"
db, err := godb.NewConnection(dialects, dsn, &gorm.Config{PrepareStmt: true}).InitDB()
// TODO DIY USE
}
Documentation
¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.