sql

package
v0.0.0-...-0d6871a Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAgentContributions

func GetAgentContributions(conn *sqlite.Conn, id string, sortBy string, sortAsc bool) ([]sirkulator.AgentContribution, error)

TODO orderBy year|label orderAsc bool

func GetAllReviews

func GetAllReviews(conn *sqlite.Conn, limit int) ([]sirkulator.RelationExp, error)

TODO pagination? offset by rowid

func GetDeweyChildren

func GetDeweyChildren(conn *sqlite.Conn, id string) ([][2]string, error)

func GetDeweyParents

func GetDeweyParents(conn *sqlite.Conn, id string) ([][2]string, error)

func GetDeweyParts

func GetDeweyParts(conn *sqlite.Conn, id string) ([][2]string, error)

func GetDeweyPartsOf

func GetDeweyPartsOf(conn *sqlite.Conn, id string, limit, offset int) ([][2]string, bool, error)

func GetDeweyPartsOfCount

func GetDeweyPartsOfCount(conn *sqlite.Conn, id string) (int, error)

func GetDeweyPublications

func GetDeweyPublications(conn *sqlite.Conn, id string, params DeweyPublicationsParams) ([][4]string, bool, error)

[4]string{id, label, year, dewey}

func GetDeweyPublicationsCount

func GetDeweyPublicationsCount(conn *sqlite.Conn, id string) (int, error)

func GetDeweySubPublicationsCount

func GetDeweySubPublicationsCount(conn *sqlite.Conn, id string) (int, error)

func GetImage

func GetImage(conn *sqlite.Conn, id string) (*sirkulator.Image, error)

func GetPublcationContributors

func GetPublcationContributors(conn *sqlite.Conn, id string) ([]sirkulator.PublicationContribution, error)

func GetPublcationReviews

func GetPublcationReviews(conn *sqlite.Conn, id string) ([]sirkulator.Relation, error)

func GetPublicationRelations

func GetPublicationRelations(conn *sqlite.Conn, id string) ([]sirkulator.RelationExp, error)

func GetPublisherPublications

func GetPublisherPublications(conn *sqlite.Conn, id string, sortBy string, sortAsc bool) ([]sirkulator.PublisherPublication, error)

func GetRelationsAsObject

func GetRelationsAsObject(conn *sqlite.Conn, id string) ([]sirkulator.RelationExp, error)

func GetResource

func GetResource(conn *sqlite.Conn, t sirkulator.ResourceType, id string) (sirkulator.Resource, error)

func GetResourceTexts

func GetResourceTexts(conn *sqlite.Conn, id string) ([]sirkulator.ResourceText, error)

func OpenAt

func OpenAt(dir string) (*sqlitex.Pool, error)

OpenAt opens the and initializes databases at the given directory, creating the directory if it doesn't exist. All supplementary databases (oai, files) are attached to main.

func OpenMem

func OpenMem() (*sqlitex.Pool, error)

OpenMem opens and initalizes a new in-memory main database, and initializes and attaches the other databases (oai, files) to main.

func UpdateResource

func UpdateResource(conn *sqlite.Conn, res sirkulator.Resource, label string) (err error)

Types

type DeweyPublicationsParams

type DeweyPublicationsParams struct {
	InclSub bool
	SortBy  string
	SortDir string
	Limit   int
	Offset  int
}

type JanitorJob

type JanitorJob struct {
	DB  *sqlitex.Pool
	Idx *search.Index
}

func (*JanitorJob) Name

func (j *JanitorJob) Name() string

func (*JanitorJob) Run

func (j *JanitorJob) Run(ctx context.Context, w io.Writer) error

Jump to

Keyboard shortcuts

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