persistence

package
v0.0.0-...-2817302 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSqliteDB

func NewSqliteDB(dataSourceName string) (*sql.DB, error)

NewSqliteDB creates a new sqlite database connection.

Types

type CreateFeedParams

type CreateFeedParams struct {
	Title       string
	Description sql.NullString
	Link        sql.NullString
	FeedLink    sql.NullString
	Updated     sql.NullTime
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type Feed

type Feed struct {
	Title       string
	Description sql.NullString
	Link        sql.NullString
	FeedLink    sql.NullString
	Updated     sql.NullTime
}

type GetFeedRow

type GetFeedRow struct {
	Title       string
	Description sql.NullString
	Updated     sql.NullTime
}

type ListFeedsRow

type ListFeedsRow struct {
	Title       string
	Description sql.NullString
	Updated     sql.NullTime
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreateFeed

func (q *Queries) CreateFeed(ctx context.Context, arg CreateFeedParams) (Feed, error)

func (*Queries) DeleteFeed

func (q *Queries) DeleteFeed(ctx context.Context, title string) error

func (*Queries) GetFeed

func (q *Queries) GetFeed(ctx context.Context, title string) (GetFeedRow, error)

func (*Queries) ListFeeds

func (q *Queries) ListFeeds(ctx context.Context) ([]ListFeedsRow, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

Jump to

Keyboard shortcuts

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