Versions in this module Expand all Collapse all v0 v0.0.3 Nov 29, 2025 Changes in this version + const DriverTypeMysql + const DriverTypePostgres + const DriverTypeSQLite + const LogArgs + const LogColumn + const LogComponent + const LogDatabase + const LogDuration + const LogEndTime + const LogError + const LogFilename + const LogSql + const LogStartTime + const LogTable + var InstanceId = time.Now().UnixMicro() & int64(^(uint64(recordVersionMask) << 38)) + var IntPrimaryKeyFunc func() int64 + var RecordVersionFunc func(prev int64) int64 + func AddDatabase(d DatabaseI, key string) + func AssociateOnly[J, K any](ctx context.Context, d DatabaseI, assnTable string, srcColumnName string, pk J, ...) error + func Associate[J, K any](ctx context.Context, d DatabaseI, assnTable string, srcColumnName string, pk J, ...) error + func DatabaseIter() iter.Seq2[string, DatabaseI] + func NewIntPrimaryKey() int64 + func NewOptimisticLockError(table string, pkValue any, err error) error + func NewQueryError(operation, query string, args []any, err error) error + func NewRecordNotFoundError(table string, pkValue any) error + func NewUniqueValueError(table string, valuesByColumn map[string]any, err error) error + func RecordVersion(prev int64) (v int64) + func WalkCursor[T any](cursor Cursor[T], fn func(index int, item *T) error) (rerr error) + func WithConstraintsOff(ctx context.Context, d DatabaseI, f func(ctx context.Context) error) error + func WithTransaction(ctx context.Context, d DatabaseI, f func(ctx context.Context) error) error + type AutoPrimaryKeyJsonUnmarshaller interface + AutoPrimaryKeyJsonUnmarshal func(any) AutoPrimaryKey + type Copier interface + Copy func() interface{} + type Cursor interface + Close func() error + Next func() (*T, error) + type DatabaseI interface + BuilderQuery func(ctx context.Context, builder *Builder) (any, error) + Delete func(ctx context.Context, table string, primaryKey map[string]any, ...) error + DeleteWhere func(ctx context.Context, table string, where map[string]any) error + Insert func(ctx context.Context, table string, fields map[string]any, autoPkKey string) error + Query func(ctx context.Context, table string, fields map[string]ReceiverType, ...) (CursorI, error) + Update func(ctx context.Context, table string, primaryKey map[string]any, ...) error + func GetDatabase(key string) DatabaseI + type Decoder interface + Decode func(v interface{}) error + type Encoder interface + Encode func(v interface{}) error + type OptimisticLockError struct + Err error + PkValue any + Table string + func (e *OptimisticLockError) Error() string + func (e *OptimisticLockError) Unwrap() error + type QueryError struct + Args []any + Err error + Operation string + Query string + func (e *QueryError) Error() string + func (e *QueryError) Unwrap() error + type RecordNotFoundError struct + PkValue any + Table string + func (e *RecordNotFoundError) Error() string + type SchemaExtractor interface + ExtractSchema func(options map[string]any) schema.Database + type SchemaRebuilder interface + CreateSchema func(ctx context.Context, s schema.Database) error + DestroySchema func(ctx context.Context, s schema.Database) error + type UniqueValueError struct + Err error + Table string + ValuesByColumn map[string]any + func (e *UniqueValueError) Error() string + func (e *UniqueValueError) Unwrap() error + type ValueMap map[string]any + func NewValueMap() ValueMap + func (m ValueMap) Copy() interface{}