database

package
v0.0.0-...-a59e774 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommentRow

type CommentRow struct {
	ID     string
	Slug   sql.NullString
	Body   sql.NullString
	Author sql.NullString
}

type Database

type Database struct {
	Client *sqlx.DB
}

func NewDatabase

func NewDatabase() (*Database, error)

func (*Database) CreateComment

func (d *Database) CreateComment(ctx context.Context, cmt comment.Comment) (comment.Comment, error)

func (*Database) DeleteComment

func (d *Database) DeleteComment(ctx context.Context, id string) error

func (*Database) GetComment

func (d *Database) GetComment(ctx context.Context, uuid string) (comment.Comment, error)

func (*Database) GetComments

func (d *Database) GetComments(ctx context.Context) ([]comment.Comment, error)

func (*Database) MigrateDB

func (d *Database) MigrateDB() error

func (*Database) Ping

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

func (*Database) UpdateComment

func (d *Database) UpdateComment(
	ctx context.Context,
	id string,
	cmt comment.Comment,
) (comment.Comment, error)

Jump to

Keyboard shortcuts

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