internal

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 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 CreateBulkUserParams

type CreateBulkUserParams struct {
	Email       string          `json:"email"`
	Name        string          `json:"name"`
	Age         sql.NullInt32   `json:"age"`
	Password    string          `json:"password"`
	ApiKey      []byte          `json:"api_key"`
	IsActive    bool            `json:"is_active"`
	LoginCount  int64           `json:"login_count"`
	Rating      float64         `json:"rating"`
	Preferences json.RawMessage `json:"preferences"`
	CreatedAt   time.Time       `json:"created_at"`
	UpdatedAt   time.Time       `json:"updated_at"`
}

type CreateUserParams

type CreateUserParams struct {
	Email       string          `json:"email"`
	Name        string          `json:"name"`
	Age         sql.NullInt32   `json:"age"`
	Password    string          `json:"password"`
	ApiKey      []byte          `json:"api_key"`
	IsActive    bool            `json:"is_active"`
	LoginCount  int64           `json:"login_count"`
	Rating      float64         `json:"rating"`
	Preferences json.RawMessage `json:"preferences"`
	CreatedAt   time.Time       `json:"created_at"`
	UpdatedAt   time.Time       `json:"updated_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 ListActiveParams added in v0.0.4

type ListActiveParams struct {
	IsActive bool  `json:"is_active"`
	Limit    int32 `json:"limit"`
	Offset   int32 `json:"offset"`
}

type ListUserFilterByAgeNameParams

type ListUserFilterByAgeNameParams struct {
	MinAge sql.NullInt32 `json:"min_age"`
	MaxAge sql.NullInt32 `json:"max_age"`
	Name   string        `json:"name"`
	Limit  int32         `json:"limit"`
	Offset int32         `json:"offset"`
}

type ListUserFilterByAgeNameRow added in v0.0.5

type ListUserFilterByAgeNameRow struct {
	ID          int32           `json:"id"`
	Email       string          `json:"email"`
	Name        string          `json:"name"`
	Age         sql.NullInt32   `json:"age"`
	Password    string          `json:"password"`
	ApiKey      []byte          `json:"api_key"`
	IsActive    bool            `json:"is_active"`
	LoginCount  int64           `json:"login_count"`
	Rating      float64         `json:"rating"`
	Preferences json.RawMessage `json:"preferences"`
	CreatedAt   time.Time       `json:"created_at"`
	UpdatedAt   time.Time       `json:"updated_at"`
	TotalSize   int64           `json:"total_size"`
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreateBulkUser

func (q *Queries) CreateBulkUser(ctx context.Context, arg CreateBulkUserParams) (int64, error)

re-importing the same users overwrites the row that shares the email

func (*Queries) CreateUser

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

Code generated by entlite. DO NOT EDIT. SQLC compatible query definitions User CRUD operations

func (*Queries) DB

func (q *Queries) DB() DBTX

DB returns the handle this Queries was constructed with.

func (*Queries) DeleteAllUser

func (q *Queries) DeleteAllUser(ctx context.Context) error

func (*Queries) DeleteUser

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

func (*Queries) GetUserByEmail

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

Look up a user by email address

func (*Queries) GetUserById added in v0.0.6

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

func (*Queries) ListActive

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

func (*Queries) ListAllUser

func (q *Queries) ListAllUser(ctx context.Context) ([]User, error)

func (*Queries) ListUserFilterByAgeName

func (q *Queries) ListUserFilterByAgeName(ctx context.Context, arg ListUserFilterByAgeNameParams) ([]ListUserFilterByAgeNameRow, error)

func (*Queries) UpdateUser

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

func (*Queries) WithTx

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

type UpdateUserParams

type UpdateUserParams struct {
	Email       string          `json:"email"`
	Name        string          `json:"name"`
	Age         sql.NullInt32   `json:"age"`
	Password    sql.NullString  `json:"password"`
	IsActive    sql.NullBool    `json:"is_active"`
	LoginCount  sql.NullInt64   `json:"login_count"`
	Rating      sql.NullFloat64 `json:"rating"`
	Preferences json.RawMessage `json:"preferences"`
	UpdatedAt   time.Time       `json:"updated_at"`
	ID          int32           `json:"id"`
}

type User

type User struct {
	ID          int32           `json:"id"`
	Email       string          `json:"email"`
	Name        string          `json:"name"`
	Age         sql.NullInt32   `json:"age"`
	Password    string          `json:"password"`
	ApiKey      []byte          `json:"api_key"`
	IsActive    bool            `json:"is_active"`
	LoginCount  int64           `json:"login_count"`
	Rating      float64         `json:"rating"`
	Preferences json.RawMessage `json:"preferences"`
	CreatedAt   time.Time       `json:"created_at"`
	UpdatedAt   time.Time       `json:"updated_at"`
}

Jump to

Keyboard shortcuts

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