sqlc

package
v0.0.0-...-a85820a Latest Latest
Warning

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

Go to latest
Published: May 24, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Comments

type Comments struct {
	ID        int32     `json:"id"`
	PostID    int32     `json:"postID"`
	Author    string    `json:"author"`
	Content   string    `json:"content"`
	CreatedAt time.Time `json:"createdAt"`
}

type CreateUserParams

type CreateUserParams struct {
	Addr      string `json:"addr"`
	Name      string `json:"name"`
	RandomMsg string `json:"randomMsg"`
}

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 Likes

type Likes struct {
	ID      int32  `json:"id"`
	PostID  int32  `json:"postID"`
	LikedBy string `json:"likedBy"`
}

type Posts

type Posts struct {
	ID           int32         `json:"id"`
	ContractAddr string        `json:"contractAddr"`
	TokenID      int32         `json:"tokenID"`
	LikeCount    sql.NullInt32 `json:"likeCount"`
	CommentCount sql.NullInt32 `json:"commentCount"`
	Author       string        `json:"author"`
	CreatedAt    time.Time     `json:"createdAt"`
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreateUser

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

func (*Queries) GetUser

func (q *Queries) GetUser(ctx context.Context, addr string) (Users, error)

func (*Queries) UpdateUser

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

func (*Queries) WithTx

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

type UpdateUserParams

type UpdateUserParams struct {
	Addr      string      `json:"addr"`
	Name      string      `json:"name"`
	Pfp       interface{} `json:"pfp"`
	RandomMsg string      `json:"randomMsg"`
}

type Users

type Users struct {
	Addr      string       `json:"addr"`
	Admin     sql.NullBool `json:"admin"`
	Name      string       `json:"name"`
	Pfp       interface{}  `json:"pfp"`
	RandomMsg string       `json:"randomMsg"`
}

Jump to

Keyboard shortcuts

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