sqlite

package
v0.0.0-...-e0046dd Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package sqlite implements a storer backed by sqlite3

nolint :revive TODO: remove ^ this

nolint :unused

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	*unimplemented.StatusThingStore
	// contains filtered or unexported fields
}

Store stores statusthing data

func New

func New(db *sql.DB) (*Store, error)

New returns a new Store

func (*Store) DeleteItem

func (s *Store) DeleteItem(ctx context.Context, itemID string) error

DeleteItem deletes the statusthingv1.Item by its id

func (*Store) DeleteNote

func (s *Store) DeleteNote(ctx context.Context, noteID string) error

DeleteNote deletes a statusthingv1.Note by its id

func (*Store) DeleteStatus

func (s *Store) DeleteStatus(ctx context.Context, statusID string) error

DeleteStatus deletes a statusthingv1.Status by its id

func (*Store) DeleteUser

func (s *Store) DeleteUser(ctx context.Context, username string) error

DeleteUser deletes a v1.User

func (*Store) FindItems

func (s *Store) FindItems(ctx context.Context, opts ...filters.FilterOption) ([]*statusthingv1.Item, error)

FindItems returns all known statusthingv1.Item optionally filtered by the provided filters.FilterOption

func (*Store) FindNotes

func (s *Store) FindNotes(ctx context.Context, itemID string, _ ...filters.FilterOption) ([]*v1.Note, error)

FindNotes gets all known statusthingv1.Note for the provided item id no filters are supported at this time

func (*Store) FindStatus

func (s *Store) FindStatus(ctx context.Context, opts ...filters.FilterOption) ([]*statusthingv1.Status, error)

FindStatus returns all know statusthingv1.Status optionally filtered by the provided filters.FilterOption

func (*Store) FindUsers

func (s *Store) FindUsers(ctx context.Context, opts ...filters.FilterOption) ([]*v1.User, error)

FindUsers finds users

func (*Store) GetItem

func (s *Store) GetItem(ctx context.Context, itemID string) (*statusthingv1.Item, error)

GetItem gets a statusthingv1.Item by its id

func (*Store) GetNote

func (s *Store) GetNote(ctx context.Context, noteID string) (*v1.Note, error)

GetNote gets a statusthingv1.Note by its id

func (*Store) GetStatus

func (s *Store) GetStatus(ctx context.Context, statusID string) (*statusthingv1.Status, error)

GetStatus gets a statusthingv1.Status by its unique id

func (*Store) GetUser

func (s *Store) GetUser(ctx context.Context, username string) (*v1.User, error)

GetUser gets a v1.User by id

func (*Store) StoreItem

func (s *Store) StoreItem(ctx context.Context, item *statusthingv1.Item) (*statusthingv1.Item, error)

StoreItem stores the provided statusthingv1.Item

func (*Store) StoreNote

func (s *Store) StoreNote(ctx context.Context, note *v1.Note, itemID string) (*v1.Note, error)

StoreNote stores the provided statusthingv1.Note associated with the provided statusthingv1.StatusThing by its id

func (*Store) StoreStatus

func (s *Store) StoreStatus(ctx context.Context, status *statusthingv1.Status) (*statusthingv1.Status, error)

StoreStatus stores the provided statusthingv1.Status

func (*Store) StoreUser

func (s *Store) StoreUser(ctx context.Context, user *v1.User) (*v1.User, error)

StoreUser stores the provied v1.User

func (*Store) UpdateItem

func (s *Store) UpdateItem(ctx context.Context, itemID string, opts ...filters.FilterOption) error

UpdateItem updates the statusthingv1.Item by its id with the provided filters.FilterOption Supported filters: - filters.WithStatusID - filters.WithName - filters.WithDescription

func (*Store) UpdateNote

func (s *Store) UpdateNote(ctx context.Context, noteID string, opts ...filters.FilterOption) error

UpdateNote updates the statusthingv1.Note with the provided filters.FilterOption supported filters: filters.WithNoteText

func (*Store) UpdateStatus

func (s *Store) UpdateStatus(ctx context.Context, statusID string, opts ...filters.FilterOption) error

UpdateStatus updates the statusthingv1.Status by id with the provided filters.FilterOption

func (*Store) UpdateUser

func (s *Store) UpdateUser(ctx context.Context, username string, opts ...filters.FilterOption) error

UpdateUser updates a v1.User

Directories

Path Synopsis
Package driver is a package containing a custom sqlite3 driver that enforces fks
Package driver is a package containing a custom sqlite3 driver that enforces fks

Jump to

Keyboard shortcuts

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