sqlc

package
v0.0.0-...-d242cfc Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreatePostParams

type CreatePostParams struct {
	ID         string
	Content    string
	Visibility string
	UserID     string
}

type CreateUserParams

type CreateUserParams struct {
	ID       string
	Username string
	Email    string
	Password string
}

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 ListPostsByUserParams

type ListPostsByUserParams struct {
	UserID string
	Limit  int32
	Offset int32
}

type ListPostsParams

type ListPostsParams struct {
	Limit  int32
	Offset int32
}

type ListUsersParams

type ListUsersParams struct {
	Limit  int32
	Offset int32
}

type Post

type Post struct {
	ID         string
	Content    string
	Visibility string
	UserID     string
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreatePost

func (q *Queries) CreatePost(ctx context.Context, arg CreatePostParams) (sql.Result, error)

func (*Queries) CreateUser

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

func (*Queries) DeletePost

func (q *Queries) DeletePost(ctx context.Context, id string) error

func (*Queries) DeleteUser

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

func (*Queries) GetPost

func (q *Queries) GetPost(ctx context.Context, id string) (Post, error)

func (*Queries) GetUser

func (q *Queries) GetUser(ctx context.Context, id string) (User, error)

func (*Queries) ListPosts

func (q *Queries) ListPosts(ctx context.Context, arg ListPostsParams) ([]Post, error)

func (*Queries) ListPostsByUser

func (q *Queries) ListPostsByUser(ctx context.Context, arg ListPostsByUserParams) ([]Post, error)

func (*Queries) ListUsers

func (q *Queries) ListUsers(ctx context.Context, arg ListUsersParams) ([]User, error)

func (*Queries) UpdatePost

func (q *Queries) UpdatePost(ctx context.Context, arg UpdatePostParams) (sql.Result, error)

func (*Queries) UpdateUser

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

func (*Queries) WithTx

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

type UpdatePostParams

type UpdatePostParams struct {
	Content    string
	Visibility string
	ID         string
}

type UpdateUserParams

type UpdateUserParams struct {
	Username string
	Email    string
	Password string
	ID       string
}

type User

type User struct {
	ID       string
	Username string
	Email    string
	Password string
}

Jump to

Keyboard shortcuts

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