2013-11-11 09:16:08 +04:00
|
|
|
package gorm
|
|
|
|
|
|
|
|
import "database/sql"
|
|
|
|
|
2013-11-16 04:15:21 +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
|
|
|
|
}
|
|
|
|
|
2013-11-16 04:15:21 +04:00
|
|
|
type sqlDb interface {
|
2013-11-11 09:16:08 +04:00
|
|
|
Begin() (*sql.Tx, error)
|
|
|
|
}
|
|
|
|
|
2013-11-16 04:15:21 +04:00
|
|
|
type sqlTx interface {
|
2013-11-11 09:16:08 +04:00
|
|
|
Commit() error
|
|
|
|
Rollback() error
|
|
|
|
}
|