Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrAlreadyUsed = errors.New("query already used")
Functions ¶
This section is empty.
Types ¶
type Driver ¶
type Driver[DRIVER any, CONFIG any, BUILDER any] interface { Begin(ctx context.Context, opts ...Option[CONFIG]) (Session[BUILDER], error) }
Driver is a signature that holds the specific driver in the Octobe context.
type Octobe ¶
type Octobe[DRIVER any, CONFIG any, BUILDER any] struct { // contains filtered or unexported fields }
Octobe struct that holds the database session
func New ¶
func New[DRIVER any, CONFIG any, BUILDER any](init Open[DRIVER, CONFIG, BUILDER]) (*Octobe[DRIVER, CONFIG, BUILDER], error)
New creates a new Octobe instance.
func (*Octobe[DRIVER, CONFIG, BUILDER]) Begin ¶
func (ob *Octobe[DRIVER, CONFIG, BUILDER]) Begin(ctx context.Context, opts ...Option[CONFIG]) (Session[BUILDER], error)
Begin a new session of queries, this will return a Session instance that can be used for handling queries. Options can be passed to the driver for specific configuration that overwrites the default configuration given at instantiation of the Octobe instance.
type Open ¶
Open is a signature that can be used for opening a driver, it should always return a driver with set signature of types for the local driver.
type Option ¶
type Option[CONFIG any] func(cfg *CONFIG)
Option is a signature that can be used for passing options to a driver
type Session ¶
type Session[BUILDER any] interface { // Commit will commit the transaction. Commit() error // Rollback will rollback the transaction. Rollback() error // WatchRollback will watch for error within the function, if it's set WatchRollback will rollback the transaction. WatchRollback(func() error) // Builder returns a new builder from the driver that is used to build queries for that specific driver. Builder() BUILDER }
Session is a signature that has a