Documentation ¶
Index ¶
- func FmtParamList(length int, or ...string) string
- func ParseEntities[T any](scan func(Scanner) (T, error), rows *sql.Rows, err error) ([]T, error)
- type Connector
- type DataManager
- type DataSql
- func (d *DataSql) Begin() (TransactionManager, error)
- func (d *DataSql) Close() (err error)
- func (d *DataSql) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
- func (d *DataSql) PingContext(ctx context.Context) error
- func (d *DataSql) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
- func (d *DataSql) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row
- type Scanner
- type TransactionManager
- type TransactionSql
- func (t *TransactionSql) Commit() error
- func (t *TransactionSql) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
- func (t *TransactionSql) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
- func (t *TransactionSql) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row
- func (t *TransactionSql) Rollback() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FmtParamList ¶
Types ¶
type DataManager ¶
type DataManager interface { Connector Begin() (TransactionManager, error) Close() error PingContext(ctx context.Context) error }
func NewDataSql ¶
func NewDataSql(db *sql.DB) DataManager
func NewDataSqlWithConfig ¶
func NewDataSqlWithConfig(config configs.ConfigDatabase) DataManager
func ProviderSet ¶
func ProviderSet( config configs.Config, ) DataManager
type DataSql ¶
type DataSql struct {
// contains filtered or unexported fields
}
func (*DataSql) Begin ¶
func (d *DataSql) Begin() (TransactionManager, error)
func (*DataSql) ExecContext ¶
func (*DataSql) QueryContext ¶
type TransactionManager ¶
type TransactionSql ¶
type TransactionSql struct {
// contains filtered or unexported fields
}
func (*TransactionSql) Commit ¶
func (t *TransactionSql) Commit() error
func (*TransactionSql) ExecContext ¶
func (*TransactionSql) QueryContext ¶
func (*TransactionSql) QueryRowContext ¶
func (*TransactionSql) Rollback ¶
func (t *TransactionSql) Rollback() error
Click to show internal directories.
Click to hide internal directories.