sqlshortcutstore

package
v0.0.0-...-0390e60 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package sqlshortcutstore implements shortcut.Store using an SQL database.

Please see perf/sql/migrations for the database schema used.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SQLShortcutStore

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

SQLShortcutStore implements the shortcut.Store interface using an SQL database.

func New

func New(db pool.Pool) (*SQLShortcutStore, error)

New returns a new *SQLShortcutStore.

We presume all migrations have been run against db before this function is called.

func (*SQLShortcutStore) DeleteShortcut

func (s *SQLShortcutStore) DeleteShortcut(ctx context.Context, id string, tx pgx.Tx) error

DeleteShortcut implements the shortcut.Store interface.

func (*SQLShortcutStore) Get

Get implements the shortcut.Store interface.

func (*SQLShortcutStore) GetAll

func (s *SQLShortcutStore) GetAll(ctx context.Context) (<-chan *shortcut.Shortcut, error)

GetAll implements the shortcut.Store interface.

func (*SQLShortcutStore) Insert

func (s *SQLShortcutStore) Insert(ctx context.Context, r io.Reader) (string, error)

Insert implements the shortcut.Store interface.

func (*SQLShortcutStore) InsertShortcut

func (s *SQLShortcutStore) InsertShortcut(ctx context.Context, sc *shortcut.Shortcut) (string, error)

InsertShortcut implements the shortcut.Store interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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