mirror of https://github.com/go-gorm/gorm.git
Hidden unnecessary public fields
This commit is contained in:
parent
5de6416354
commit
2388dacfe3
12
main.go
12
main.go
|
@ -3,22 +3,22 @@ package gorm
|
||||||
import "database/sql"
|
import "database/sql"
|
||||||
|
|
||||||
type DB struct {
|
type DB struct {
|
||||||
Db *sql.DB
|
db *sql.DB
|
||||||
Driver string
|
driver string
|
||||||
}
|
}
|
||||||
|
|
||||||
func Open(driver, source string) (db DB, err error) {
|
func Open(driver, source string) (db DB, err error) {
|
||||||
db.Db, err = sql.Open(driver, source)
|
db.db, err = sql.Open(driver, source)
|
||||||
db.Driver = driver
|
db.driver = driver
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DB) SetPool(n int) {
|
func (s *DB) SetPool(n int) {
|
||||||
s.Db.SetMaxIdleConns(n)
|
s.db.SetMaxIdleConns(n)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DB) buildORM() *Chain {
|
func (s *DB) buildORM() *Chain {
|
||||||
return &Chain{db: s.Db, driver: s.Driver}
|
return &Chain{db: s.db, driver: s.driver}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DB) Where(querystring interface{}, args ...interface{}) *Chain {
|
func (s *DB) Where(querystring interface{}, args ...interface{}) *Chain {
|
||||||
|
|
Loading…
Reference in New Issue