Documentation ¶
Index ¶
- Constants
- type DBDriver
- type DBconnector
- func (d *DBconnector) Close(ctx context.Context) error
- func (d *DBconnector) Connect(ctx context.Context) error
- func (d *DBconnector) Exec(ctx context.Context, q string, args ...any) error
- func (d *DBconnector) ExecTx(ctx context.Context, queryList []Query, namedQuery []NamedQuery, ...) error
- func (d *DBconnector) Get(ctx context.Context, dest any, quer string, args ...any) error
- func (d *DBconnector) MapperFunc(tagName string, f func(string) string)
- func (d *DBconnector) NamedExec(ctx context.Context, q NamedQuery, disableArg ...any) error
- func (d *DBconnector) NamedQuery(ctx context.Context, q NamedQuery, disableArg ...any) (*sqlx.Rows, error)
- func (d *DBconnector) Query(ctx context.Context, q string, args ...any) (*sqlx.Rows, error)
- func (d *DBconnector) Select(ctx context.Context, dest any, quer string, args ...any) error
- type NamedQuery
- type PostgresSSLMode
- type Query
Constants ¶
View Source
const ( DisableLogger disableLoggerType = 1 EnableLogger disableLoggerType = 0 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBconnector ¶
type DBconnector struct {
// contains filtered or unexported fields
}
func NewDBConnector ¶
func NewDBConnector(connString string, dbDriver DBDriver, logger logr.Logger) *DBconnector
func (*DBconnector) Exec ¶
func (d *DBconnector) Exec(ctx context.Context, q string, args ...any) error
func (*DBconnector) ExecTx ¶
func (d *DBconnector) ExecTx(ctx context.Context, queryList []Query, namedQuery []NamedQuery, disableArg ...any) error
func (*DBconnector) Get ¶
func (d *DBconnector) Get(ctx context.Context, dest any, quer string, args ...any) error
func (*DBconnector) MapperFunc ¶
func (d *DBconnector) MapperFunc(tagName string, f func(string) string)
func (*DBconnector) NamedExec ¶
func (d *DBconnector) NamedExec(ctx context.Context, q NamedQuery, disableArg ...any) error
func (*DBconnector) NamedQuery ¶
func (d *DBconnector) NamedQuery(ctx context.Context, q NamedQuery, disableArg ...any) (*sqlx.Rows, error)
type NamedQuery ¶
type NamedQuery struct { Query string Arg any }
type PostgresSSLMode ¶
type PostgresSSLMode string
const ( SSLModeDISABLE PostgresSSLMode = "disable" SSLModeALLOW PostgresSSLMode = "allow" SSLModePREFER PostgresSSLMode = "prefer" SSLModeREQUIRE PostgresSSLMode = "require" SSLModeVERIFYCA PostgresSSLMode = "verify-ca" SSLModeVERIFYFULL PostgresSSLMode = "verify-full" )
Click to show internal directories.
Click to hide internal directories.