예제 #1
0
func Open(driver, source string) (DB, error) {
	var err error
	db := DB{dialect: dialect.New(driver), tagIdentifier: "sql", logger: defaultLogger, callback: DefaultCallback}
	db.db, err = sql.Open(driver, source)
	db.parent = &db
	return db, err
}
예제 #2
0
파일: main.go 프로젝트: klobucar/gorm
func Open(driver, source string) (db DB, err error) {
	db.db, err = sql.Open(driver, source)
	db.dialect = dialect.New(driver)
	db.tagIdentifier = "sql"
	db.parent = &db
	return
}