postgres

package
v0.0.0-...-95c1afc Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UsersTable      = "users"
	TodoListsTable  = "todo_lists"
	UsersListsTable = "users_lists"
	TodoItemsTable  = "todo_items"
	ListsItemsTable = "lists_items"
)

Variables

This section is empty.

Functions

func NewPostgresDB

func NewPostgresDB(cfg config.Config) (*sqlx.DB, error)

Types

type AuthRepo

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

func NewAuthRepo

func NewAuthRepo(db DBTX) *AuthRepo

func (*AuthRepo) CreateUser

func (r *AuthRepo) CreateUser(ctx context.Context, user *models.User) (*models.User, error)

func (*AuthRepo) GetUserByEmail

func (r *AuthRepo) GetUserByEmail(ctx context.Context, email string) (*models.User, error)

type DBTX

type DBTX interface {
	ExecContext(ctx context.Context, query string, args ...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
}

Jump to

Keyboard shortcuts

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