Permalink
Switch branches/tags
Nothing to show
Find file Copy path
45f1a95 Mar 15, 2017
2 contributors

Users who have contributed to this file

@jinzhu @ansel1
21 lines (16 sloc) 498 Bytes
package gorm
import "database/sql"
// SQLCommon is the minimal database connection functionality gorm requires. Implemented by *sql.DB.
type SQLCommon 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 sqlDb interface {
Begin() (*sql.Tx, error)
}
type sqlTx interface {
Commit() error
Rollback() error
}