2013-11-11 09:16:08 +04:00
|
|
|
package gorm
|
|
|
|
|
|
|
|
import "database/sql"
|
|
|
|
|
2013-11-15 18:29:42 +04:00
|
|
|
type sqlcommon interface {
|
2013-11-11 09:16:08 +04:00
|
|
|
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
|
|
|
|
}
|