postgres

package
v0.0.0-...-b5678d6 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 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 CreateNoteParams

type CreateNoteParams struct {
	ID         uuid.UUID     `json:"id"`
	UserID     uuid.UUID     `json:"user_id"`
	CategoryID uuid.NullUUID `json:"category_id"`
	Title      string        `json:"title"`
	Content    string        `json:"content"`
	Pinned     bool          `json:"pinned"`
	Priority   int32         `json:"priority"`
	UpdatedAt  time.Time     `json:"updated_at"`
	CreatedAt  time.Time     `json:"created_at"`
}

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 DeleteNoteParams

type DeleteNoteParams struct {
	ID     uuid.UUID `json:"id"`
	UserID uuid.UUID `json:"user_id"`
}

type GetNoteParams

type GetNoteParams struct {
	ID     uuid.UUID `json:"id"`
	UserID uuid.UUID `json:"user_id"`
}

type ListNotesParams

type ListNotesParams struct {
	UserID uuid.UUID `json:"user_id"`
	Limit  int32     `json:"limit"`
	Offset int32     `json:"offset"`
}

type NoteNote

type NoteNote struct {
	ID         uuid.UUID     `json:"id"`
	UserID     uuid.UUID     `json:"user_id"`
	CategoryID uuid.NullUUID `json:"category_id"`
	Title      string        `json:"title"`
	Content    string        `json:"content"`
	Pinned     bool          `json:"pinned"`
	Priority   int32         `json:"priority"`
	UpdatedAt  time.Time     `json:"updated_at"`
	CreatedAt  time.Time     `json:"created_at"`
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreateNote

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

func (*Queries) DeleteNote

func (q *Queries) DeleteNote(ctx context.Context, arg DeleteNoteParams) error

func (*Queries) GetNote

func (q *Queries) GetNote(ctx context.Context, arg GetNoteParams) (NoteNote, error)

func (*Queries) ListNotes

func (q *Queries) ListNotes(ctx context.Context, arg ListNotesParams) ([]NoteNote, error)

func (*Queries) UpdateNote

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

func (*Queries) WithTx

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

type UpdateNoteParams

type UpdateNoteParams struct {
	ID        uuid.UUID `json:"id"`
	Title     string    `json:"title"`
	Content   string    `json:"content"`
	Pinned    bool      `json:"pinned"`
	Priority  int32     `json:"priority"`
	UpdatedAt time.Time `json:"updated_at"`
	UserID    uuid.UUID `json:"user_id"`
}

Jump to

Keyboard shortcuts

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