db

package
v0.0.0-...-1109b79 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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 Editor

type Editor struct {
	ID         int64
	QuestionID string
	Lang       string
	LangSlug   string
	Code       string
}

type GetEditorsParams

type GetEditorsParams struct {
	QuestionID string
	LangSlug   string
}

type GetQuestionsParams

type GetQuestionsParams struct {
	From int64
	To   int64
}

type Hint

type Hint struct {
	ID         int64
	QuestionID string
	Hint       string
}

type InsertEditorParams

type InsertEditorParams struct {
	QuestionID string
	Lang       string
	LangSlug   string
	Code       string
}

type InsertHintParams

type InsertHintParams struct {
	QuestionID string
	Hint       string
}

type InsertQuestionParams

type InsertQuestionParams struct {
	QuestionID string
	Link       string
	Title      string
	TitleSlug  string
	IsPaidOnly bool
	Difficulty string
	Content    string
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CountQuestionByTitleSlug

func (q *Queries) CountQuestionByTitleSlug(ctx context.Context, titleSlug string) (int64, error)

func (*Queries) GetEditors

func (q *Queries) GetEditors(ctx context.Context, arg GetEditorsParams) ([]Editor, error)

func (*Queries) GetHints

func (q *Queries) GetHints(ctx context.Context, questionID string) ([]Hint, error)

func (*Queries) GetQuestions

func (q *Queries) GetQuestions(ctx context.Context, arg GetQuestionsParams) ([]Question, error)

func (*Queries) InsertEditor

func (q *Queries) InsertEditor(ctx context.Context, arg InsertEditorParams) error

func (*Queries) InsertHint

func (q *Queries) InsertHint(ctx context.Context, arg InsertHintParams) error

func (*Queries) InsertQuestion

func (q *Queries) InsertQuestion(ctx context.Context, arg InsertQuestionParams) error

func (*Queries) WithTx

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

type Question

type Question struct {
	ID         int64
	QuestionID string
	Link       string
	Title      string
	TitleSlug  string
	IsPaidOnly bool
	Difficulty string
	Content    string
}

Jump to

Keyboard shortcuts

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