Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Initializer ¶
Initializer is a PG initializer.
func NewConfigSingletonInjector ¶
NewConfigSingletonInjector always inject the given *Config.
Types ¶
type Config ¶ added in v1.1.0
type Config struct { PostgresURL string `json:"postgresUrl" validate:"required,url"` EnableProxyMode bool `json:"proxyMode"` ConnectTimeoutSeconds uint32 `json:"connectTimeoutSeconds"` }
Config describes the configuration for PG.
type ContextPG ¶
type ContextPG interface { Exec(query string, args ...interface{}) (sql.Result, error) Query(query string, args ...interface{}) (*sql.Rows, error) QueryRow(query string, args ...interface{}) *sql.Row }
ContextPG describes a PG with a cached context.
type PG ¶
type PG interface { ContextPG ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row }
PG describes the pg module (a subset of *sql.DB).
type Tx ¶
type Tx struct {
// contains filtered or unexported fields
}
Tx describes a transaction.
func (*Tx) SetAllowReentrant ¶
SetAllowReentrant sets the "allow reentrant" flag.
func (*Tx) SetIsolationLevel ¶
func (t *Tx) SetIsolationLevel(isolationLevel sql.IsolationLevel) *Tx
SetIsolationLevel sets the isolation level.
func (*Tx) SetReadOnly ¶
SetReadOnly sets the read only flag.
Click to show internal directories.
Click to hide internal directories.