Documentation ¶
Index ¶
- Constants
- func NewDB(ctx context.Context, dsn string, waitForDB, statementTimeout time.Duration) (*sql.DB, error)
- func NewNamespacedDB(ctx context.Context, dsn string, namespace string, ...) (*sql.DB, error)
- func NullInt32(v int32) sql.NullInt32
- func NullInt64(v int64) sql.NullInt64
- func RunInTx(ctx context.Context, db *sql.DB, opts *sql.TxOptions, ...) error
- func SetVectorClock(q *queries.SelectGatewayEnvelopesParams, vc VectorClock) *queries.SelectGatewayEnvelopesParams
- type DBSubscription
- type PollableDBQuery
- type PollingOptions
- type Topic
- type VectorClock
Constants ¶
View Source
const MAX_NAMESPACE_LENGTH = 32
Variables ¶
This section is empty.
Functions ¶
func NewNamespacedDB ¶ added in v0.1.2
func NewNamespacedDB( ctx context.Context, dsn string, namespace string, waitForDB, statementTimeout time.Duration, ) (*sql.DB, error)
Creates a new database with the given namespace if it doesn't exist and returns the full DSN for the new database.
func SetVectorClock ¶
func SetVectorClock( q *queries.SelectGatewayEnvelopesParams, vc VectorClock, ) *queries.SelectGatewayEnvelopesParams
Types ¶
type DBSubscription ¶
type DBSubscription[ValueType any, CursorType any] struct { // contains filtered or unexported fields }
A subscription that polls a DB for updates Assumes there is only one listener (updates block on a single unbuffered channel)
func NewDBSubscription ¶
func NewDBSubscription[ValueType any, CursorType any]( ctx context.Context, log *zap.Logger, query PollableDBQuery[ValueType, CursorType], lastSeen CursorType, options PollingOptions, ) *DBSubscription[ValueType, CursorType]
func (*DBSubscription[ValueType, CursorType]) Start ¶
func (s *DBSubscription[ValueType, CursorType]) Start() (<-chan []ValueType, error)
type PollableDBQuery ¶
type PollingOptions ¶
Poll whenever notified, or at an interval if not notified
type VectorClock ¶
func ToVectorClock ¶
func ToVectorClock(rows []queries.SelectVectorClockRow) VectorClock
Click to show internal directories.
Click to hide internal directories.