init - add project files
This commit is contained in:
25
tools/jet-2.12.0/qrm/db.go
Normal file
25
tools/jet-2.12.0/qrm/db.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package qrm
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
)
|
||||
|
||||
// DB is common database interface used by query result mapping
|
||||
// Both *sql.DB and *sql.Tx implements DB interface
|
||||
type DB interface {
|
||||
Exec(query string, args ...interface{}) (sql.Result, error)
|
||||
ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
|
||||
Query(query string, args ...interface{}) (*sql.Rows, error)
|
||||
QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
|
||||
}
|
||||
|
||||
// Queryable interface for sql QueryContext method
|
||||
type Queryable interface {
|
||||
QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
|
||||
}
|
||||
|
||||
// Executable interface for sql ExecContext method
|
||||
type Executable interface {
|
||||
ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
|
||||
}
|
||||
Reference in New Issue
Block a user