Documentation
¶
Index ¶
- Constants
- type Database
- type MySQL
- type NullString
- type NullTime
- type SQL
- func (ds SQL) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
- func (ds SQL) GetContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error
- func (ds SQL) NamedExecContext(ctx context.Context, query string, arg interface{}) (sql.Result, error)
- func (ds SQL) PrepareContext(ctx context.Context, query string) (*sql.Stmt, error)
- func (ds SQL) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
- func (ds SQL) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row
- func (ds SQL) SelectContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error
- func (ds SQL) WithinTransaction(ctx context.Context, txFunc func(ctx context.Context) error) error
- type SQLRepository
- type SqlQueryable
- type SqlTx
- func (q SqlTx) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
- func (q SqlTx) GetContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error
- func (q SqlTx) NamedExecContext(ctx context.Context, query string, arg interface{}) (sql.Result, error)
- func (q SqlTx) PrepareContext(ctx context.Context, query string) (*sql.Stmt, error)
- func (q SqlTx) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
- func (q SqlTx) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row
- func (q SqlTx) SelectContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error
Constants ¶
View Source
const (
TypeMySQL = "mysql"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MySQL ¶
type MySQL struct {
SQL
Config config.MySQLConfig
}
func NewMySQL ¶
func NewMySQL(config config.MySQLConfig) *MySQL
type NullString ¶
type NullString struct {
sql.NullString
}
NullString type representing a nullable string
func StringToNullString ¶
func StringToNullString(str *string) NullString
func (NullString) MarshalJSON ¶
func (s NullString) MarshalJSON() ([]byte, error)
MarshalJSON returns the marshaled json string
func (*NullString) UnmarshalJSON ¶
func (s *NullString) UnmarshalJSON(data []byte) error
UnmarshalJSON returns the unmarshaled struct
type NullTime ¶
NullTime type representing a nullable string
func (NullTime) MarshalJSON ¶
MarshalJSON returns the marshaled json string
type SQL ¶
func (SQL) ExecContext ¶
func (SQL) GetContext ¶
func (SQL) NamedExecContext ¶
func (SQL) PrepareContext ¶
func (SQL) QueryContext ¶
func (SQL) QueryRowContext ¶
func (SQL) SelectContext ¶
type SQLRepository ¶
type SQLRepository struct {
DB *SQL
}
SQLRepository type
func NewSQLRepository ¶
func NewSQLRepository(db *SQL) SQLRepository
NewSQLRepository returns an instance of SQLRepository
type SqlQueryable ¶
type SqlQueryable interface {
ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
GetContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error
NamedExecContext(ctx context.Context, query string, arg interface{}) (sql.Result, error)
PrepareContext(ctx context.Context, query string) (*sql.Stmt, error)
QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row
SelectContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error
}
type SqlTx ¶
func (SqlTx) ExecContext ¶
func (SqlTx) GetContext ¶
func (SqlTx) NamedExecContext ¶
func (SqlTx) PrepareContext ¶
func (SqlTx) QueryContext ¶
func (SqlTx) QueryRowContext ¶
Click to show internal directories.
Click to hide internal directories.