package
0.0.0-20190602082457-5479be76c42e
Repository: https://github.com/robinbraemer/cockroach-go.git
Documentation: pkg.go.dev

# README

CRDB

crdb is a wrapper around the logic for issuing SQL transactions which performs retries (as required by CockroachDB).

Note that unfortunately there is no generic way of extracting a pg error code; the library has to recognize driver-dependent error types. We currently support github.com/lib/pq and github.com/jackc/pgx.

# Functions

ExecuteInTx runs fn inside tx which should already have begun.
ExecuteTx runs fn inside a transaction and retries it as needed.

# Structs

AmbiguousCommitError represents an error that left a transaction in an ambiguous state: unclear if it committed or not.
TxnRestartError represents an error when restarting a transaction.

# Interfaces

ErrorCauser is the type implemented by an error that remembers its cause.
Tx is used to permit clients to implement custom transaction logic.