Documentation ¶
Index ¶
- func NewMapSqlHandler(log logger.Logger, sqlconfigs map[string]config.SQL) map[string]database.SqlHandler
- func NewSqlHandler(log logger.Logger, config Config) database.SqlHandler
- type Config
- type SqlHandler
- func (handler *SqlHandler) Close() error
- func (handler *SqlHandler) Exec(statement string, args ...interface{}) (database.Result, error)
- func (handler *SqlHandler) MultiExec(multiStatements string) (err error)
- func (handler *SqlHandler) Query(statement string, args ...interface{}) (database.Row, error)
- func (handler *SqlHandler) Transaction(f func() (interface{}, error)) (interface{}, error)
- type SqlResult
- type SqlRow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMapSqlHandler ¶
func NewSqlHandler ¶
func NewSqlHandler(log logger.Logger, config Config) database.SqlHandler
Types ¶
type SqlHandler ¶
SqlHandler has a connection with DB
func (*SqlHandler) Close ¶
func (handler *SqlHandler) Close() error
func (*SqlHandler) Exec ¶
func (handler *SqlHandler) Exec(statement string, args ...interface{}) (database.Result, error)
Exec executes the SQL that manipulates the data of the table
func (*SqlHandler) MultiExec ¶
func (handler *SqlHandler) MultiExec(multiStatements string) (err error)
Use it for database initialization only
func (*SqlHandler) Query ¶
func (handler *SqlHandler) Query(statement string, args ...interface{}) (database.Row, error)
Query gets data from the database
func (*SqlHandler) Transaction ¶
func (handler *SqlHandler) Transaction(f func() (interface{}, error)) (interface{}, error)
Transaction ...
Click to show internal directories.
Click to hide internal directories.