sqlite3

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2023 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBuilder

func NewBuilder(options ...Option) db.ClientInterface

func RunMigrations

func RunMigrations(ctx context.Context, tx utils.QueryWrapper, generator imap.UIDValidityGenerator) error

func ScanMailbox

func ScanMailbox(scanner utils.RowScanner) (*db.Mailbox, error)

func ScanMailboxWithAttr

func ScanMailboxWithAttr(scanner utils.RowScanner) (*db.MailboxWithAttr, error)

func ScanMessage

func ScanMessage(scanner utils.RowScanner) (*db.Message, error)

func ScanMessageWithFlags

func ScanMessageWithFlags(scanner utils.RowScanner) (*db.MessageWithFlags, error)

func TestUpdateDBVersion

func TestUpdateDBVersion(ctx context.Context, dbPath, userID string, version int) error

Types

type Builder

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

func (Builder) Delete

func (Builder) Delete(dir string, userID string) error

func (Builder) New

func (b Builder) New(dir string, userID string) (db.Client, bool, error)

type Client

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

func NewClient

func NewClient(dir string, userID string, debug, trace bool) (*Client, bool, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) Init

func (c *Client) Init(ctx context.Context, generator imap.UIDValidityGenerator) error

func (*Client) Read

func (c *Client) Read(ctx context.Context, op func(context.Context, db.ReadOnly) error) error

func (*Client) Write

func (c *Client) Write(ctx context.Context, op func(context.Context, db.Transaction) error) error

type Migration

type Migration interface {
	Run(ctx context.Context, tx utils.QueryWrapper, generator imap.UIDValidityGenerator) error
}

type Option

type Option interface {
	// contains filtered or unexported methods
}

func Debug

func Debug() Option

Debug enables logging of the SQL queries and their values. Written to debug log.

func Trace

func Trace() Option

Trace enables db interface call tracing. Name of the called functions will be written to trace log.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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