database

package
v0.0.0-...-1eaaa5a Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateWordRow

type CreateWordRow struct {
	ID        int64              `json:"id"`
	Value     string             `json:"value"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
}

type CreateWordsBatchParams

type CreateWordsBatchParams struct {
	Name    string   `json:"name"`
	Column2 []string `json:"column_2"`
}

type CreateWordsBatchRow

type CreateWordsBatchRow struct {
	ID      int64       `json:"id"`
	Value   string      `json:"value"`
	BatchID pgtype.Int8 `json:"batch_id"`
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type ListWordBatchesParams

type ListWordBatchesParams struct {
	Limit  int32 `json:"limit"`
	Offset int32 `json:"offset"`
}

type ListWordBatchesRow

type ListWordBatchesRow struct {
	ID        int64              `json:"id"`
	Name      string             `json:"name"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
}

type ListWordFrequenciesParams

type ListWordFrequenciesParams struct {
	Limit  int32 `json:"limit"`
	Offset int32 `json:"offset"`
}

type ListWordFrequenciesRow

type ListWordFrequenciesRow struct {
	Value string `json:"value"`
	Total int64  `json:"total"`
}

type ListWordRankingsParams

type ListWordRankingsParams struct {
	Limit  int32 `json:"limit"`
	Offset int32 `json:"offset"`
}

type ListWordRankingsRow

type ListWordRankingsRow struct {
	Value   string `json:"value"`
	Ranking int64  `json:"ranking"`
}

type ListWordsByBatchNameRow

type ListWordsByBatchNameRow struct {
	BatchName string `json:"batch_name"`
	WordValue string `json:"word_value"`
}

type ListWordsParams

type ListWordsParams struct {
	Limit  int32 `json:"limit"`
	Offset int32 `json:"offset"`
}

type ListWordsRow

type ListWordsRow struct {
	ID        int64              `json:"id"`
	Value     string             `json:"value"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
}

type Querier

type Querier interface {
	CreateWord(ctx context.Context, value string) (CreateWordRow, error)
	CreateWordsBatch(ctx context.Context, arg CreateWordsBatchParams) (CreateWordsBatchRow, error)
	ListWordBatches(ctx context.Context, arg ListWordBatchesParams) ([]ListWordBatchesRow, error)
	ListWordFrequencies(ctx context.Context, arg ListWordFrequenciesParams) ([]ListWordFrequenciesRow, error)
	ListWordRankings(ctx context.Context, arg ListWordRankingsParams) ([]ListWordRankingsRow, error)
	ListWords(ctx context.Context, arg ListWordsParams) ([]ListWordsRow, error)
	ListWordsByBatchName(ctx context.Context, name string) ([]ListWordsByBatchNameRow, error)
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreateWord

func (q *Queries) CreateWord(ctx context.Context, value string) (CreateWordRow, error)

func (*Queries) CreateWordsBatch

func (q *Queries) CreateWordsBatch(ctx context.Context, arg CreateWordsBatchParams) (CreateWordsBatchRow, error)

func (*Queries) ListWordBatches

func (q *Queries) ListWordBatches(ctx context.Context, arg ListWordBatchesParams) ([]ListWordBatchesRow, error)

func (*Queries) ListWordFrequencies

func (q *Queries) ListWordFrequencies(ctx context.Context, arg ListWordFrequenciesParams) ([]ListWordFrequenciesRow, error)

func (*Queries) ListWordRankings

func (q *Queries) ListWordRankings(ctx context.Context, arg ListWordRankingsParams) ([]ListWordRankingsRow, error)

func (*Queries) ListWords

func (q *Queries) ListWords(ctx context.Context, arg ListWordsParams) ([]ListWordsRow, error)

func (*Queries) ListWordsByBatchName

func (q *Queries) ListWordsByBatchName(ctx context.Context, name string) ([]ListWordsByBatchNameRow, error)

func (*Queries) WithTx

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

type Word

type Word struct {
	ID        int64              `json:"id"`
	Value     string             `json:"value"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
	DeletedAt pgtype.Timestamptz `json:"deleted_at"`
	BatchID   pgtype.Int8        `json:"batch_id"`
}

type WordBatch

type WordBatch struct {
	ID        int64              `json:"id"`
	Name      string             `json:"name"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
	DeletedAt pgtype.Timestamptz `json:"deleted_at"`
}

Jump to

Keyboard shortcuts

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