sql

package
v0.1.23 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2024 License: GPL-2.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoProvider = errors.New("ConnectionProvider was not provided")
View Source
var ErrUndefinedParam = errors.New("invalid param")

Functions

This section is empty.

Types

type ConnectionProvider

type ConnectionProvider = func(conf any) (*sql.DB, error)

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(params ...any) (*Service, error)

New creates new sql service params may be *sql.DB or ConnectionProvider;

in later case the next param (if any) will be used as conf argument in call to provider

func (*Service) DB

func (ss *Service) DB() (*sql.DB, error)

func (*Service) Prepare

func (ss *Service) Prepare(eng *vivard.Engine, prov dep.Provider) (err error)

func (*Service) Provide

func (ss *Service) Provide() any

func (*Service) Reconnect

func (ss *Service) Reconnect(force bool) error

func (*Service) Start

func (ss *Service) Start(eng *vivard.Engine, prov dep.Provider) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL