sqlite

package
v0.0.0-...-b1f9b26 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package sqlite provides a thin wrapper over the sqlc-generated SQLite wrapper to adhere to our server's DB interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

func New

func New(dbPath string) (*DB, error)

func (*DB) AddGraphEncryptKey

func (d *DB) AddGraphEncryptKey(ctx context.Context, gID db.GraphID, gek *db.GraphEncryptKey) error

func (*DB) AddGraphSalt

func (d *DB) AddGraphSalt(ctx context.Context, gID db.GraphID, salt *db.GraphSalt) error

func (*DB) AllFileMeta

func (d *DB) AllFileMeta(ctx context.Context, id db.GraphID) ([]*db.FileMeta, error)

func (*DB) BatchFileMeta

func (d *DB) BatchFileMeta(ctx context.Context, id db.GraphID, fIDs []db.FileID) (map[db.FileID]*db.FileMeta, error)

Because the Logseq client can/will request files it hasn't uploaded yet, the map will contain nil entries for requested files that don't exist

func (*DB) CreateGraph

func (d *DB) CreateGraph(ctx context.Context, name string) (db.GraphID, db.Tx, error)

func (*DB) DeleteGraph

func (d *DB) DeleteGraph(ctx context.Context, id db.GraphID) error

func (*DB) Graph

func (d *DB) Graph(ctx context.Context, id db.GraphID) (*db.Graph, error)

func (*DB) GraphEncryptKeys

func (d *DB) GraphEncryptKeys(ctx context.Context, id db.GraphID) ([]*db.GraphEncryptKey, error)

func (*DB) GraphSalts

func (d *DB) GraphSalts(ctx context.Context, id db.GraphID) ([]*db.GraphSalt, error)

func (*DB) Graphs

func (d *DB) Graphs(ctx context.Context) ([]*db.Graph, error)

func (*DB) IncrementTx

func (d *DB) IncrementTx(ctx context.Context, id db.GraphID) (db.Tx, error)

func (*DB) SetFileMeta

func (d *DB) SetFileMeta(ctx context.Context, gID db.GraphID, md *db.FileMeta) error

func (*DB) SetTx

func (d *DB) SetTx(ctx context.Context, id db.GraphID, tx db.Tx) error

func (*DB) Tx

func (d *DB) Tx(ctx context.Context, id db.GraphID) (db.Tx, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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