sqlc

package
v0.0.0-...-71eae79 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2022 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 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 Email

type Email struct {
	ID          int32
	Email       string
	ConfirmedAt sql.NullTime
	EmailLower  sql.NullString
	CreatedAt   time.Time
}

type Event

type Event struct {
	ID          int32
	PublicID    uuid.UUID
	EmailID     sql.NullInt32
	HostName    sql.NullString
	Title       string
	Description string
	Venue       sql.NullString
	StartTime   time.Time
	Duration    pgtype.Interval
	CreatedAt   time.Time
	ConfirmedAt sql.NullTime
	DeletedAt   sql.NullTime
}

type GetEventByIDRow

type GetEventByIDRow struct {
	ID               int32
	PublicID         uuid.UUID
	EmailID          sql.NullInt32
	EmailAddress     sql.NullString
	IsEmailConfirmed bool
	EmailConfirmed   sql.NullTime
	HostName         sql.NullString
	Title            string
	Description      string
	Venue            sql.NullString
	StartTime        time.Time
	Duration         pgtype.Interval
	CreatedAt        time.Time
	IsConfirmed      bool
	ConfirmedAt      sql.NullTime
	IsDeleted        bool
	DeletedAt        sql.NullTime
}

type InsertEventParams

type InsertEventParams struct {
	PublicID    uuid.UUID
	EmailID     sql.NullInt32
	HostName    sql.NullString
	Title       string
	Description string
	Venue       sql.NullString
	StartTime   time.Time
	Duration    pgtype.Interval
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) EmailExists

func (q *Queries) EmailExists(ctx context.Context, email string) (bool, error)

EmailExists checks if an email address is known.

func (*Queries) GetEventByID

func (q *Queries) GetEventByID(ctx context.Context, id int32) (GetEventByIDRow, error)

GetEventByID returns an event by ID.

func (*Queries) GetEventIDByPublicID

func (q *Queries) GetEventIDByPublicID(ctx context.Context, id int32) (uuid.UUID, error)

GetEventIDByPublicID returns an event ID from its public ID.

func (*Queries) InsertEmail

func (q *Queries) InsertEmail(ctx context.Context, email string) (int32, error)

InsertEmail inserts an email. The inserted ID is returned.

func (*Queries) InsertEvent

func (q *Queries) InsertEvent(ctx context.Context, arg InsertEventParams) (int32, error)

InsertEvent inserts a new event into the database, returning its new ID.

func (*Queries) SoftDeleteEvent

func (q *Queries) SoftDeleteEvent(ctx context.Context, id int32) error

SoftDeleteEvent soft deletes an event.

func (*Queries) WithTx

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

Jump to

Keyboard shortcuts

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