Versions in this module Expand all Collapse all v0 v0.0.2 Aug 18, 2023 Changes in this version + type ConnectionConfigurator func(connection *Connection) + func WithPreRunHook(preRunHook PreRunHook) ConnectionConfigurator + type PreRunHook func(statement string, parameters map[string]any) error v0.0.1 Aug 6, 2023 Changes in this version + func WithPreRunFunc(preRunFunc PreRunFunc) connectionConfig + type Connection struct + func NewConnection(db *sqlx.DB, configOptions ...connectionConfig) *Connection + func (c *Connection) Execute(ctx context.Context, statement string, parameters map[string]any) (sql.Result, error) + func (c *Connection) Select(ctx context.Context, target any, statement string, parameters map[string]any) error + type Entity interface + Joins func() string + TableName func() string + type PreRunFunc func(statement string, parameters map[string]any) error + type Query struct + From string + GroupBy string + Having string + Join string + Limit string + OrderBy string + PrimaryKey string + Select string + Where string + func GenerateQuery(e Entity) Query + func (q Query) String() string + type ReadOnlyRepository struct + func NewReadOnlyRepository(connection *Connection) *ReadOnlyRepository[T] + func (repo ReadOnlyRepository[T]) Find(ctx context.Context, query Query, parameters map[string]any) ([]T, error) + func (repo ReadOnlyRepository[T]) FindOne(ctx context.Context, query Query, parameters map[string]any) (T, error) + type Repository struct + func NewRepository(connection *Connection) *Repository[T] + func (repo Repository[T]) Delete(ctx context.Context, entity T) error + func (repo Repository[T]) Insert(ctx context.Context, entity T) (uint64, error) + func (repo Repository[T]) Save(ctx context.Context, entity T) error + func (repo Repository[T]) Update(ctx context.Context, entity T) error