sqlite

package
v0.0.0-...-9c71d87 Latest Latest
Warning

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

Go to latest
Published: May 19, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dialect

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

func (*Dialect) DB

func (d *Dialect) DB() *sql.DB

DB returns the database/sql dbh.

func (*Dialect) IsDuplicateKeyError

func (d *Dialect) IsDuplicateKeyError(err error) bool

func (*Dialect) SetParamPlaceholders

func (d *Dialect) SetParamPlaceholders(sql string) string

func (*Dialect) TimeToType

func (d *Dialect) TimeToType(t time.Time) any

TimeToType returns the given time in the type supported by the db.

type SQLite

type SQLite struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func New

func New(path string) (*SQLite, error)

func (*SQLite) DeleteBlobMeta

func (s *SQLite) DeleteBlobMeta(ctx context.Context, blobId blid.Blid) error

DeleteBlobMeta deletes metadata about a blob.

func (*SQLite) GetBlobMeta

func (s *SQLite) GetBlobMeta(ctx context.Context, blobId blid.Blid) (*metadata.Item, bool, error)

HasBlobMeta returns true if we have metadata about a given blob.

func (*SQLite) GetBlobTags

func (s *SQLite) GetBlobTags(ctx context.Context, blobId blid.Blid) ([]string, error)

GetBlobTags returns the tags attached to a certain blob.

func (*SQLite) ListBlobChunk

func (s *SQLite) ListBlobChunk(ctx context.Context, filter *filter.Filter, limit int) ([]*metadata.Item, error)

ListBlobChunk returns blob chunk metadata.

func (*SQLite) SetBlobMeta

func (s *SQLite) SetBlobMeta(ctx context.Context, item *metadata.Item) error

func (*SQLite) SetBlobTags

func (s *SQLite) SetBlobTags(ctx context.Context, tags []string, blobId blid.Blid) error

SetBlobTags updates tags of the given blob id.

Jump to

Keyboard shortcuts

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