Generator cleanup.

This commit is contained in:
go-jet 2019-06-23 18:55:57 +02:00
parent ee5d526d26
commit a44bd85d32
22 changed files with 97 additions and 92 deletions

View file

@ -14,11 +14,11 @@ type Statement interface {
DebugSql() (query string, err error)
Query(db execution.Db, destination interface{}) error
QueryContext(db execution.Db, context context.Context, destination interface{}) error
Query(db execution.DB, destination interface{}) error
QueryContext(db execution.DB, context context.Context, destination interface{}) error
Exec(db execution.Db) (sql.Result, error)
ExecContext(db execution.Db, context context.Context) (sql.Result, error)
Exec(db execution.DB) (sql.Result, error)
ExecContext(db execution.DB, context context.Context) (sql.Result, error)
}
func DebugSql(statement Statement) (string, error) {
@ -38,7 +38,7 @@ func DebugSql(statement Statement) (string, error) {
return debugSqlQuery, nil
}
func Query(statement Statement, db execution.Db, destination interface{}) error {
func Query(statement Statement, db execution.DB, destination interface{}) error {
query, args, err := statement.Sql()
if err != nil {
@ -48,7 +48,7 @@ func Query(statement Statement, db execution.Db, destination interface{}) error
return execution.Query(db, context.Background(), query, args, destination)
}
func QueryContext(statement Statement, db execution.Db, context context.Context, destination interface{}) error {
func QueryContext(statement Statement, db execution.DB, context context.Context, destination interface{}) error {
query, args, err := statement.Sql()
if err != nil {
@ -58,7 +58,7 @@ func QueryContext(statement Statement, db execution.Db, context context.Context,
return execution.Query(db, context, query, args, destination)
}
func Exec(statement Statement, db execution.Db) (res sql.Result, err error) {
func Exec(statement Statement, db execution.DB) (res sql.Result, err error) {
query, args, err := statement.Sql()
if err != nil {
@ -68,7 +68,7 @@ func Exec(statement Statement, db execution.Db) (res sql.Result, err error) {
return db.Exec(query, args...)
}
func ExecContext(statement Statement, db execution.Db, context context.Context) (res sql.Result, err error) {
func ExecContext(statement Statement, db execution.DB, context context.Context) (res sql.Result, err error) {
query, args, err := statement.Sql()
if err != nil {