users

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UserMeta = drel.ModelMeta[User]{
	Table:         "users",
	Columns:       []string{"id", "name", "email", "created_at", "updated_at"},
	PKColumns:     []string{"id"},
	Scan:          scanUser,
	Snapshot:      snapshotUser,
	Diff:          diffUser,
	PKValue:       userPKValue,
	InsertColumns: userInsertColumns,
	ScanReturning: userScanReturning,
	ColumnValue:   userColumnValue,
	NormalizeKey:  userNormalizeKey,
}
View Source
var Users = struct {
	ID        drel.OrderedColumn[int]
	Name      drel.StringColumn
	Email     drel.StringColumn
	CreatedAt drel.TimeColumn
	UpdatedAt drel.TimeColumn
}{
	ID:        drel.NewOrderedCol[int]("id"),
	Name:      drel.NewStringCol("name"),
	Email:     drel.NewStringCol("email"),
	CreatedAt: drel.NewTimeCol("created_at"),
	UpdatedAt: drel.NewTimeCol("updated_at"),
}

Functions

This section is empty.

Types

type TxUserRepository

type TxUserRepository struct {
	*drel.TxRepository[User]
}

func (*TxUserRepository) FindByID

func (r *TxUserRepository) FindByID(ctx context.Context, id int) (*User, error)

type User

type User struct {
	drel.Model[int]
	Name  string `db:"name"`
	Email string `db:"email"`
}

User is owned by the users slice. Its migrations live next to it, in features/users/migrations.

type UserRepository

type UserRepository struct {
	*drel.Repository[User]
}

func (*UserRepository) FindByID

func (r *UserRepository) FindByID(ctx context.Context, id int) (*User, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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