sqlc

package
v0.0.0-...-ee9720a Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateNoteParams

type CreateNoteParams struct {
	UserID  int32       `json:"user_id"`
	SpaceID int32       `json:"space_id"`
	Title   string      `json:"title"`
	Body    pgtype.Text `json:"body"`
}

type CreateNoteRow

type CreateNoteRow struct {
	ID        int32            `json:"id"`
	UserID    int32            `json:"user_id"`
	SpaceID   int32            `json:"space_id"`
	Title     string           `json:"title"`
	Body      pgtype.Text      `json:"body"`
	Status    Status           `json:"status"`
	CreatedAt pgtype.Timestamp `json:"created_at"`
}

type CreateSpaceParams

type CreateSpaceParams struct {
	Name     string      `json:"name"`
	Emoji    pgtype.Text `json:"emoji"`
	IsLocked bool        `json:"is_locked"`
	UserID   int32       `json:"user_id"`
}

type CreateSpaceRow

type CreateSpaceRow struct {
	ID        int32            `json:"id"`
	UserID    int32            `json:"user_id"`
	Name      string           `json:"name"`
	Emoji     pgtype.Text      `json:"emoji"`
	IsLocked  bool             `json:"is_locked"`
	CreatedAt pgtype.Timestamp `json:"created_at"`
}

type CreateUserParams

type CreateUserParams struct {
	FullName pgtype.Text `json:"full_name"`
	Username string      `json:"username"`
	Email    string      `json:"email"`
	Password string      `json:"password"`
}

type CreateUserRow

type CreateUserRow struct {
	ID        int32            `json:"id"`
	FullName  pgtype.Text      `json:"full_name"`
	Username  string           `json:"username"`
	Email     string           `json:"email"`
	CreatedAt pgtype.Timestamp `json:"created_at"`
}

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 FindAllNotesBySpaceIDAndStatusParams

type FindAllNotesBySpaceIDAndStatusParams struct {
	SpaceID int32  `json:"space_id"`
	Status  Status `json:"status"`
	Keyword string `json:"keyword"`
}

type FindAllNotesBySpaceIDParams

type FindAllNotesBySpaceIDParams struct {
	SpaceID int32  `json:"space_id"`
	Keyword string `json:"keyword"`
}

type FindAllNotesByStatusParams

type FindAllNotesByStatusParams struct {
	UserID  int32  `json:"user_id"`
	Status  Status `json:"status"`
	Keyword string `json:"keyword"`
}

type FindAllNotesParams

type FindAllNotesParams struct {
	UserID  int32  `json:"user_id"`
	Keyword string `json:"keyword"`
}

type FindAllSpacesByUserIDRow

type FindAllSpacesByUserIDRow struct {
	ID        int32            `json:"id"`
	Name      string           `json:"name"`
	Emoji     pgtype.Text      `json:"emoji"`
	IsLocked  bool             `json:"is_locked"`
	CreatedAt pgtype.Timestamp `json:"created_at"`
	UpdatedAt pgtype.Timestamp `json:"updated_at"`
}

type Note

type Note struct {
	ID        int32            `json:"id"`
	UserID    int32            `json:"user_id"`
	SpaceID   int32            `json:"space_id"`
	Title     string           `json:"title"`
	Body      pgtype.Text      `json:"body"`
	Status    Status           `json:"status"`
	CreatedAt pgtype.Timestamp `json:"created_at"`
	UpdatedAt pgtype.Timestamp `json:"updated_at"`
}

type NullStatus

type NullStatus struct {
	Status Status `json:"status"`
	Valid  bool   `json:"valid"` // Valid is true if Status is not NULL
}

func (*NullStatus) Scan

func (ns *NullStatus) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullStatus) Value

func (ns NullStatus) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AddToken

func (q *Queries) AddToken(ctx context.Context, token string) error

func (*Queries) CreateNote

func (q *Queries) CreateNote(ctx context.Context, arg CreateNoteParams) (*CreateNoteRow, error)

func (*Queries) CreateSpace

func (q *Queries) CreateSpace(ctx context.Context, arg CreateSpaceParams) (*CreateSpaceRow, error)

func (*Queries) CreateUser

func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (*CreateUserRow, error)

func (*Queries) DeleteNote

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

func (*Queries) DeleteSpace

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

func (*Queries) DeleteToken

func (q *Queries) DeleteToken(ctx context.Context, token string) error

func (*Queries) DeleteUser

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

func (*Queries) FindAllNotes

func (q *Queries) FindAllNotes(ctx context.Context, arg FindAllNotesParams) ([]*Note, error)

func (*Queries) FindAllNotesBySpaceID

func (q *Queries) FindAllNotesBySpaceID(ctx context.Context, arg FindAllNotesBySpaceIDParams) ([]*Note, error)

func (*Queries) FindAllNotesBySpaceIDAndStatus

func (q *Queries) FindAllNotesBySpaceIDAndStatus(ctx context.Context, arg FindAllNotesBySpaceIDAndStatusParams) ([]*Note, error)

func (*Queries) FindAllNotesByStatus

func (q *Queries) FindAllNotesByStatus(ctx context.Context, arg FindAllNotesByStatusParams) ([]*Note, error)

func (*Queries) FindAllSpacesByUserID

func (q *Queries) FindAllSpacesByUserID(ctx context.Context, userID int32) ([]*FindAllSpacesByUserIDRow, error)

func (*Queries) FindNoteByID

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

func (*Queries) FindSpaceByID

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

func (*Queries) FindToken

func (q *Queries) FindToken(ctx context.Context, token string) (string, error)

func (*Queries) FindUserByEmail

func (q *Queries) FindUserByEmail(ctx context.Context, email string) (*User, error)

func (*Queries) FindUserByID

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

func (*Queries) FindUserByUsername

func (q *Queries) FindUserByUsername(ctx context.Context, username string) (*User, error)

func (*Queries) UpdateEmail

func (q *Queries) UpdateEmail(ctx context.Context, arg UpdateEmailParams) (*UpdateEmailRow, error)

func (*Queries) UpdateNote

func (q *Queries) UpdateNote(ctx context.Context, arg UpdateNoteParams) (*UpdateNoteRow, error)

func (*Queries) UpdatePassword

func (q *Queries) UpdatePassword(ctx context.Context, arg UpdatePasswordParams) error

func (*Queries) UpdateSpace

func (q *Queries) UpdateSpace(ctx context.Context, arg UpdateSpaceParams) (*UpdateSpaceRow, error)

func (*Queries) UpdateUser

func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) (*UpdateUserRow, error)

func (*Queries) WithTx

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

type Space

type Space struct {
	ID        int32            `json:"id"`
	UserID    int32            `json:"user_id"`
	Name      string           `json:"name"`
	Emoji     pgtype.Text      `json:"emoji"`
	IsLocked  bool             `json:"is_locked"`
	CreatedAt pgtype.Timestamp `json:"created_at"`
	UpdatedAt pgtype.Timestamp `json:"updated_at"`
}

type Status

type Status string
const (
	StatusNormal   Status = "normal"
	StatusFavorite Status = "favorite"
	StatusArchived Status = "archived"
	StatusTrashed  Status = "trashed"
)

func (*Status) Scan

func (e *Status) Scan(src interface{}) error

type UpdateEmailParams

type UpdateEmailParams struct {
	ID        int32            `json:"id"`
	Email     string           `json:"email"`
	UpdatedAt pgtype.Timestamp `json:"updated_at"`
}

type UpdateEmailRow

type UpdateEmailRow struct {
	ID        int32            `json:"id"`
	FullName  pgtype.Text      `json:"full_name"`
	Username  string           `json:"username"`
	Email     string           `json:"email"`
	CreatedAt pgtype.Timestamp `json:"created_at"`
	UpdatedAt pgtype.Timestamp `json:"updated_at"`
}

type UpdateNoteParams

type UpdateNoteParams struct {
	ID        int32            `json:"id"`
	Title     pgtype.Text      `json:"title"`
	Body      pgtype.Text      `json:"body"`
	Status    NullStatus       `json:"status"`
	SpaceID   pgtype.Int4      `json:"space_id"`
	UpdatedAt pgtype.Timestamp `json:"updated_at"`
}

type UpdateNoteRow

type UpdateNoteRow struct {
	ID        int32            `json:"id"`
	SpaceID   int32            `json:"space_id"`
	Title     string           `json:"title"`
	Body      pgtype.Text      `json:"body"`
	Status    Status           `json:"status"`
	CreatedAt pgtype.Timestamp `json:"created_at"`
	UpdatedAt pgtype.Timestamp `json:"updated_at"`
}

type UpdatePasswordParams

type UpdatePasswordParams struct {
	ID        int32            `json:"id"`
	Password  string           `json:"password"`
	UpdatedAt pgtype.Timestamp `json:"updated_at"`
}

type UpdateSpaceParams

type UpdateSpaceParams struct {
	ID        int32            `json:"id"`
	Name      pgtype.Text      `json:"name"`
	Emoji     pgtype.Text      `json:"emoji"`
	IsLocked  pgtype.Bool      `json:"is_locked"`
	UpdatedAt pgtype.Timestamp `json:"updated_at"`
}

type UpdateSpaceRow

type UpdateSpaceRow struct {
	ID        int32            `json:"id"`
	Name      string           `json:"name"`
	Emoji     pgtype.Text      `json:"emoji"`
	IsLocked  bool             `json:"is_locked"`
	CreatedAt pgtype.Timestamp `json:"created_at"`
	UpdatedAt pgtype.Timestamp `json:"updated_at"`
}

type UpdateUserParams

type UpdateUserParams struct {
	FullName  pgtype.Text      `json:"full_name"`
	Username  pgtype.Text      `json:"username"`
	UpdatedAt pgtype.Timestamp `json:"updated_at"`
	ID        int32            `json:"id"`
}

type UpdateUserRow

type UpdateUserRow struct {
	ID        int32            `json:"id"`
	FullName  pgtype.Text      `json:"full_name"`
	Username  string           `json:"username"`
	Email     string           `json:"email"`
	CreatedAt pgtype.Timestamp `json:"created_at"`
	UpdatedAt pgtype.Timestamp `json:"updated_at"`
}

type User

type User struct {
	ID        int32            `json:"id"`
	FullName  pgtype.Text      `json:"full_name"`
	Username  string           `json:"username"`
	Email     string           `json:"email"`
	Password  string           `json:"password"`
	CreatedAt pgtype.Timestamp `json:"created_at"`
	UpdatedAt pgtype.Timestamp `json:"updated_at"`
}

Jump to

Keyboard shortcuts

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