queries

package
v0.0.0-...-a8dead8 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Comment

type Comment struct {
	ID       string
	Position int64
	Subject  string
	Author   sql.NullString
	Date     time.Time
	Text     string
}

type CommentEdit

type CommentEdit struct {
	Comment string
	Date    time.Time
	OldText string
}

type CreateCommentParams

type CreateCommentParams struct {
	ID      string
	Subject string
	Author  sql.NullString
	Text    string
}

type CreateEditParams

type CreateEditParams struct {
	ID   string
	Text string
}

type CreateSubjectParams

type CreateSubjectParams struct {
	ID   string
	Name sql.NullString
}

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 GetCommentsParams

type GetCommentsParams struct {
	Subject string
	POffset int64
	PLimit  int64
}

type GetCommentsRow

type GetCommentsRow struct {
	ID       string
	Position int64
	Subject  string
	Author   sql.NullString
	Date     time.Time
	Text     string
	Replies  int64
	Edits    int64
}

type GetEditsParams

type GetEditsParams struct {
	ID      string
	POffset int64
	PLimit  int64
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CountComments

func (q *Queries) CountComments(ctx context.Context, subject string) (int64, error)

func (*Queries) CountEdits

func (q *Queries) CountEdits(ctx context.Context, id string) (int64, error)

func (*Queries) CreateComment

func (q *Queries) CreateComment(ctx context.Context, arg CreateCommentParams) (Comment, error)

func (*Queries) CreateEdit

func (q *Queries) CreateEdit(ctx context.Context, arg CreateEditParams) (CommentEdit, error)

func (*Queries) CreateSubject

func (q *Queries) CreateSubject(ctx context.Context, arg CreateSubjectParams) error

func (*Queries) GetComment

func (q *Queries) GetComment(ctx context.Context, id string) (Comment, error)

func (*Queries) GetComments

func (q *Queries) GetComments(ctx context.Context, arg GetCommentsParams) ([]GetCommentsRow, error)

func (*Queries) GetEdits

func (q *Queries) GetEdits(ctx context.Context, arg GetEditsParams) ([]CommentEdit, error)

func (*Queries) GetSubjectById

func (q *Queries) GetSubjectById(ctx context.Context, id string) (Subject, error)

func (*Queries) UpdateComment

func (q *Queries) UpdateComment(ctx context.Context, arg UpdateCommentParams) (Comment, error)

func (*Queries) WithTx

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

type Subject

type Subject struct {
	ID      string
	Name    sql.NullString
	Created time.Time
}

type UpdateCommentParams

type UpdateCommentParams struct {
	NewText string
	ID      string
}

Jump to

Keyboard shortcuts

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