storage

package
v0.0.0-...-82364ab Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertError

func ConvertError(err error) error

Types

type ExecResult

type ExecResult interface {
	Err() error
	Affected() int64
	ID() int64
}

type MultiResult

type MultiResult interface {
	Next() bool
	Scan(dst ...interface{}) error
	Close() error
}

type Runner

type Runner interface {
	Exec(ctx context.Context, query string, params ...interface{}) ExecResult
	Query(ctx context.Context, query string, params ...interface{}) (MultiResult, error)
	QuerySingle(ctx context.Context, query string, params ...interface{}) SingleResult
}

type SQLLite

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

func NewSQLLite

func NewSQLLite(filepath string) (*SQLLite, error)

NewSQLLite returns a connection pool ready to execute statements on SQLLite database.

func (*SQLLite) Close

func (p *SQLLite) Close()

func (*SQLLite) WithTx

func (p *SQLLite) WithTx(ctx context.Context, action func(runner Runner) error) error

func (*SQLLite) WithoutTx

func (p *SQLLite) WithoutTx(_ context.Context, action func(runner Runner) error) error

type SingleResult

type SingleResult interface {
	Scan(dst ...interface{}) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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