Documentation
¶
Index ¶
- Variables
- type ConnectionOptions
- type Options
- type PostgresSQL
- func (db *PostgresSQL) Close() error
- func (db *PostgresSQL) Connect() error
- func (db *PostgresSQL) Connection() *sqlx.DB
- func (db *PostgresSQL) EventTx(ctx context.Context, etxFn db.EventTxFn) (eventId *events.EventID, err error)
- func (db *PostgresSQL) EventsTx(ctx context.Context, etxFn db.EventsTxFn) (eventIds []events.EventID, err error)
- func (db *PostgresSQL) Migrate(ctx context.Context, options *db.MigrationOptions) (*db.MigrationResult, error)
- func (db *PostgresSQL) Tx(ctx context.Context, txFn db.TxFn) (err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoDSN = errors.New("no dsn provided") ErrNoMigrator = errors.New("no migrator provided") )
View Source
var DefaultConnectionOptions = ConnectionOptions{ MaxOpenCons: 100, MaxIdleCons: 10, ConnMaxLifetime: 1 * time.Minute, ConnMaxIdleTime: 30 * time.Second, }
View Source
var (
ErrNoOutboxConfigured = errors.New("no event outbox configured")
)
Functions ¶
This section is empty.
Types ¶
type ConnectionOptions ¶ added in v0.15.0
type PostgresSQL ¶
type PostgresSQL struct {
// contains filtered or unexported fields
}
func New ¶
func New(options Options) (*PostgresSQL, error)
func (*PostgresSQL) Close ¶
func (db *PostgresSQL) Close() error
func (*PostgresSQL) Connect ¶
func (db *PostgresSQL) Connect() error
func (*PostgresSQL) Connection ¶
func (db *PostgresSQL) Connection() *sqlx.DB
func (*PostgresSQL) EventTx ¶
func (db *PostgresSQL) EventTx(ctx context.Context, etxFn db.EventTxFn) (eventId *events.EventID, err error)
EventTx is a convenience method for emitting a single event in a single transaction.
func (*PostgresSQL) EventsTx ¶
func (db *PostgresSQL) EventsTx(ctx context.Context, etxFn db.EventsTxFn) (eventIds []events.EventID, err error)
EventsTx is a convenience method for emitting multiple events in a single transaction.
func (*PostgresSQL) Migrate ¶
func (db *PostgresSQL) Migrate(ctx context.Context, options *db.MigrationOptions) (*db.MigrationResult, error)
Click to show internal directories.
Click to hide internal directories.