gorm/db.go

21 lines
423 B
Go
Raw Normal View History

2013-11-11 09:16:08 +04:00
package gorm
import "database/sql"
type sql_common interface {
Exec(query string, args ...interface{}) (sql.Result, error)
Prepare(query string) (*sql.Stmt, error)
Query(query string, args ...interface{}) (*sql.Rows, error)
QueryRow(query string, args ...interface{}) *sql.Row
}
type sql_db interface {
Begin() (*sql.Tx, error)
SetMaxIdleConns(n int)
}
type sql_tx interface {
Commit() error
Rollback() error
}