Documentation ¶
Index ¶
- Constants
- Variables
- func NewDbConnection(config structure.DBConfiguration) (*pg.DB, error)
- func NewLogQueryHook(level logrus.Level) pg.QueryHook
- func ResolveMigrationsDirectory() string
- func RunInTransactionV2(pdb *pg.DB, f interface{}) error
- type ErrorEvent
- type JsoniterProvider
- type Option
- type RxDbClient
Constants ¶
View Source
const (
SchemaParam = "db_schema"
)
Variables ¶
View Source
var (
ErrNotConnected = errors.New("db: not connected")
)
Functions ¶
func NewDbConnection ¶
func NewDbConnection(config structure.DBConfiguration) (*pg.DB, error)
func NewLogQueryHook ¶
func ResolveMigrationsDirectory ¶
func ResolveMigrationsDirectory() string
func RunInTransactionV2 ¶
func RunInTransactionV2(pdb *pg.DB, f interface{}) error
Types ¶
type ErrorEvent ¶
type ErrorEvent struct {
// contains filtered or unexported fields
}
func (ErrorEvent) Error ¶
func (er ErrorEvent) Error() string
type JsoniterProvider ¶ added in v2.3.1
type JsoniterProvider struct { }
func (JsoniterProvider) Marshal ¶ added in v2.3.1
func (s JsoniterProvider) Marshal(v interface{}) ([]byte, error)
func (JsoniterProvider) NewDecoder ¶ added in v2.3.1
func (s JsoniterProvider) NewDecoder(r io.Reader) pgjson.Decoder
func (JsoniterProvider) NewEncoder ¶ added in v2.3.1
func (s JsoniterProvider) NewEncoder(w io.Writer) pgjson.Encoder
func (JsoniterProvider) Unmarshal ¶ added in v2.3.1
func (s JsoniterProvider) Unmarshal(data []byte, v interface{}) error
type Option ¶
type Option func(rdc *RxDbClient)
func WithInitializingErrorHandler ¶
func WithInitializingErrorHandler(eh errorHandler) Option
func WithInitializingHandler ¶
func WithInitializingHandler(handler initHandler) Option
func WithMigrationsEnsuring ¶
func WithMigrationsEnsuring() Option
func WithQueryHooks ¶
func WithQueryHooks(qhs ...pg.QueryHook) Option
func WithSchemaAutoInjecting ¶
func WithSchemaAutoInjecting() Option
func WithSchemaEnsuring ¶
func WithSchemaEnsuring() Option
type RxDbClient ¶
type RxDbClient struct {
// contains filtered or unexported fields
}
func NewRxDbClient ¶
func NewRxDbClient(opts ...Option) *RxDbClient
func (*RxDbClient) Close ¶
func (rc *RxDbClient) Close() error
func (*RxDbClient) ReceiveConfiguration ¶
func (rc *RxDbClient) ReceiveConfiguration(config structure.DBConfiguration)
func (*RxDbClient) RunInTransaction ¶
func (rc *RxDbClient) RunInTransaction(f interface{}) error
func (*RxDbClient) Unsafe ¶
func (rc *RxDbClient) Unsafe() *pg.DB
func (*RxDbClient) Visit ¶
func (rc *RxDbClient) Visit(v visitor) error
Click to show internal directories.
Click to hide internal directories.