sql

package
v0.0.0-...-99c871e Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database struct {
	DB *sqlx.DB
	// contains filtered or unexported fields
}

func NewDatabase

func NewDatabase(opts NewDatabaseOptions) *Database

NewDatabase with the given options. If no logger is provided, logs are discarded.

func (*Database) Connect

func (d *Database) Connect() error

func (*Database) CreateNote

func (d *Database) CreateNote(ctx context.Context) (model.Note, error)

func (*Database) DeleteNote

func (d *Database) DeleteNote(ctx context.Context, id model.ID) error

func (*Database) GetNote

func (d *Database) GetNote(ctx context.Context, id model.ID) (model.Note, error)

func (*Database) GetNotes

func (d *Database) GetNotes(ctx context.Context) ([]model.Note, error)

func (*Database) MigrateDown

func (d *Database) MigrateDown(ctx context.Context) error

func (*Database) MigrateUp

func (d *Database) MigrateUp(ctx context.Context) error

func (*Database) Ping

func (d *Database) Ping(ctx context.Context) error

func (*Database) SaveNote

func (d *Database) SaveNote(ctx context.Context, n model.Note) error

type NewDatabaseOptions

type NewDatabaseOptions struct {
	Log  *snorkel.Logger
	Path string
}

Jump to

Keyboard shortcuts

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