mysql

package
v0.0.0-...-670ca8f Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConn

func NewConn(dsn string) (*sql.DB, error)

NewConn makes a new connection to the database

Types

type AddUserParams

type AddUserParams struct {
	ID    string
	Name  string
	Email 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 FindRegistrationUserRow

type FindRegistrationUserRow struct {
	ID    string
	Name  string
	Email string
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AddUser

func (q *Queries) AddUser(ctx context.Context, arg AddUserParams) error

func (*Queries) FindRegistrationUser

func (q *Queries) FindRegistrationUser(ctx context.Context, email string) (FindRegistrationUserRow, error)

func (*Queries) GetRegistrationUsers

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

func (*Queries) WithTx

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

type RegistrationUserExecutor

type RegistrationUserExecutor interface {
	AddUserIfNotExists(ctx context.Context, param AddUserParams) error
}

RegistrationUserExecutor is Query Executor

type RegistrationUserQueryExecutor

type RegistrationUserQueryExecutor interface {
	GetRegistrationUsers(ctx context.Context) ([]User, error)
}

type User

type User struct {
	ID        string
	Name      string
	Email     string
	CreatedAt sql.NullTime
}

type UserFindStore

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

func NewUserFindStore

func NewUserFindStore(db *sql.DB) *UserFindStore

type UserStore

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

func NewUserStore

func NewUserStore(db *sql.DB) *UserStore

func (*UserStore) AddUserIfNotExists

func (us *UserStore) AddUserIfNotExists(ctx context.Context, param AddUserParams) error

AddUserIfNotExists is a return active registration users

Jump to

Keyboard shortcuts

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