composite

package
v0.0.0-...-c369810 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Arrays

type Arrays struct {
	Texts  []string   `json:"texts"`
	Int8s  []*int     `json:"int8s"`
	Bools  []bool     `json:"bools"`
	Floats []*float64 `json:"floats"`
}

Arrays represents the Postgres composite type "arrays".

type Blocks

type Blocks struct {
	ID           int    `json:"id"`
	ScreenshotID int    `json:"screenshot_id"`
	Body         string `json:"body"`
}

Blocks represents the Postgres composite type "blocks".

type DBQuerier

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

func NewQuerier

func NewQuerier(conn genericConn) *DBQuerier

NewQuerier creates a DBQuerier that implements Querier. conn is typically *pgx.Conn, pgx.Tx, or *pgxpool.Pool.

func (*DBQuerier) ArraysInput

func (q *DBQuerier) ArraysInput(ctx context.Context, arrays Arrays) (Arrays, error)

ArraysInput implements Querier.ArraysInput.

func (*DBQuerier) InsertScreenshotBlocks

func (q *DBQuerier) InsertScreenshotBlocks(ctx context.Context, screenshotID int, body string) (InsertScreenshotBlocksRow, error)

InsertScreenshotBlocks implements Querier.InsertScreenshotBlocks.

func (*DBQuerier) SearchScreenshots

func (q *DBQuerier) SearchScreenshots(ctx context.Context, params SearchScreenshotsParams) ([]SearchScreenshotsRow, error)

SearchScreenshots implements Querier.SearchScreenshots.

func (*DBQuerier) SearchScreenshotsOneCol

func (q *DBQuerier) SearchScreenshotsOneCol(ctx context.Context, params SearchScreenshotsOneColParams) ([][]Blocks, error)

SearchScreenshotsOneCol implements Querier.SearchScreenshotsOneCol.

func (*DBQuerier) UserEmails

func (q *DBQuerier) UserEmails(ctx context.Context) (UserEmail, error)

UserEmails implements Querier.UserEmails.

func (*DBQuerier) WithTx

func (q *DBQuerier) WithTx(tx pgx.Tx) (*DBQuerier, error)

WithTx creates a new DBQuerier that uses the transaction to run all queries.

type InsertScreenshotBlocksRow

type InsertScreenshotBlocksRow struct {
	ID           int    `json:"id"`
	ScreenshotID int    `json:"screenshot_id"`
	Body         string `json:"body"`
}

type Querier

type Querier interface {
	SearchScreenshots(ctx context.Context, params SearchScreenshotsParams) ([]SearchScreenshotsRow, error)

	SearchScreenshotsOneCol(ctx context.Context, params SearchScreenshotsOneColParams) ([][]Blocks, error)

	InsertScreenshotBlocks(ctx context.Context, screenshotID int, body string) (InsertScreenshotBlocksRow, error)

	ArraysInput(ctx context.Context, arrays Arrays) (Arrays, error)

	UserEmails(ctx context.Context) (UserEmail, error)
}

Querier is a typesafe Go interface backed by SQL queries.

type SearchScreenshotsOneColParams

type SearchScreenshotsOneColParams struct {
	Body   string `json:"Body"`
	Limit  int    `json:"Limit"`
	Offset int    `json:"Offset"`
}

type SearchScreenshotsParams

type SearchScreenshotsParams struct {
	Body   string `json:"Body"`
	Limit  int    `json:"Limit"`
	Offset int    `json:"Offset"`
}

type SearchScreenshotsRow

type SearchScreenshotsRow struct {
	ID     int      `json:"id"`
	Blocks []Blocks `json:"blocks"`
}

type UserEmail

type UserEmail struct {
	ID    string      `json:"id"`
	Email pgtype.Text `json:"email"`
}

UserEmail represents the Postgres composite type "user_email".

Jump to

Keyboard shortcuts

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