db

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: May 17, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package db contains generated code for schema 'public'.

Index

Constants

View Source
const (
	GooseDbVersionID        = `"id"`
	GooseDbVersionVersionID = `"version_id"`
	GooseDbVersionIsApplied = `"is_applied"`
	GooseDbVersionTstamp    = `"tstamp"`
)
  • Columns Names

Columns Names

View Source
const (
	OfficeID        = `"id"`
	OfficeName      = `"name"`
	OfficeCreatedAt = `"created_at"`
	OfficeUpdatedAt = `"updated_at"`
)
  • Columns Names

Columns Names

View Source
const (
	OfficeUserOfficeID  = `"office_id"`
	OfficeUserUserID    = `"user_id"`
	OfficeUserCreatedAt = `"created_at"`
	OfficeUserUpdatedAt = `"updated_at"`
)
  • Columns Names

Columns Names

View Source
const (
	UserID        = `"id"`
	UserName      = `"name"`
	UserEmail     = `"email"`
	UserPassword  = `"password"`
	UserCreatedAt = `"created_at"`
	UserUpdatedAt = `"updated_at"`
	UserRole      = `"role"`
)
  • Columns Names

Columns Names

Variables

View Source
var GooseDbVersion = GooseDbVersionTable{
	Table:     GooseDbVersionMeta,
	ID:        sqli.NewColumn[int](GooseDbVersionMeta, `"id"`),
	VersionID: sqli.NewColumn[int64](GooseDbVersionMeta, `"version_id"`),
	IsApplied: sqli.NewColumn[bool](GooseDbVersionMeta, `"is_applied"`),
	Tstamp:    sqli.NewColumn[time.Time](GooseDbVersionMeta, `"tstamp"`),
}
View Source
var GooseDbVersionMeta = sqli.Table{
	TableName:  `"goose_db_version"`,
	TableAlias: `"goose_db_version"`,
	ColumnNames: map[string]bool{
		`"id"`:         true,
		`"version_id"`: true,
		`"is_applied"`: true,
		`"tstamp"`:     true,
	},
}
View Source
var Office = OfficeTable{
	Table:     OfficeMeta,
	ID:        sqli.NewColumn[uuid.UUID](OfficeMeta, `"id"`),
	Name:      sqli.NewColumn[string](OfficeMeta, `"name"`),
	CreatedAt: sqli.NewColumn[time.Time](OfficeMeta, `"created_at"`),
	UpdatedAt: sqli.NewColumn[sql.NullTime](OfficeMeta, `"updated_at"`),
}
View Source
var OfficeMeta = sqli.Table{
	TableName:  `"office"`,
	TableAlias: `"office"`,
	ColumnNames: map[string]bool{
		`"id"`:         true,
		`"name"`:       true,
		`"created_at"`: true,
		`"updated_at"`: true,
	},
}
View Source
var OfficeUser = OfficeUserTable{
	Table:     OfficeUserMeta,
	OfficeID:  sqli.NewColumn[uuid.UUID](OfficeUserMeta, `"office_id"`),
	UserID:    sqli.NewColumn[uuid.UUID](OfficeUserMeta, `"user_id"`),
	CreatedAt: sqli.NewColumn[time.Time](OfficeUserMeta, `"created_at"`),
	UpdatedAt: sqli.NewColumn[sql.NullTime](OfficeUserMeta, `"updated_at"`),
}
View Source
var OfficeUserMeta = sqli.Table{
	TableName:  `"office_user"`,
	TableAlias: `"office_user"`,
	ColumnNames: map[string]bool{
		`"office_id"`:  true,
		`"user_id"`:    true,
		`"created_at"`: true,
		`"updated_at"`: true,
	},
}

Named "T" for shortness

View Source
var Tables = TablesSt{
	GooseDbVersion: "goose_db_version",
	Office:         "office",
	OfficeUser:     "office_user",
	User:           "user",
}
View Source
var User = UserTable{
	Table:     UserMeta,
	ID:        sqli.NewColumn[uuid.UUID](UserMeta, `"id"`),
	Name:      sqli.NewColumn[string](UserMeta, `"name"`),
	Email:     sqli.NewColumn[string](UserMeta, `"email"`),
	Password:  sqli.NewColumn[string](UserMeta, `"password"`),
	CreatedAt: sqli.NewColumn[time.Time](UserMeta, `"created_at"`),
	UpdatedAt: sqli.NewColumn[sql.NullTime](UserMeta, `"updated_at"`),
	Role:      sqli.NewColumn[string](UserMeta, `"role"`),
}
View Source
var UserMeta = sqli.Table{
	TableName:  `"user"`,
	TableAlias: `"user"`,
	ColumnNames: map[string]bool{
		`"id"`:         true,
		`"name"`:       true,
		`"email"`:      true,
		`"password"`:   true,
		`"created_at"`: true,
		`"updated_at"`: true,
		`"role"`:       true,
	},
}

Functions

func DeleteFromGooseDbVersionByID added in v0.1.4

func DeleteFromGooseDbVersionByID(
	ctx context.Context,
	db DB,
	ID int,
) (sql.Result, error)

## Delete by ID

func DeleteFromOfficeByID added in v0.1.4

func DeleteFromOfficeByID(
	ctx context.Context,
	db DB,
	ID uuid.UUID,
) (sql.Result, error)

## Delete by ID

func DeleteFromOfficeByName added in v0.1.4

func DeleteFromOfficeByName(
	ctx context.Context,
	db DB,
	Name string,
) (sql.Result, error)

## Delete by Name

func DeleteFromOfficeUserByOfficeID added in v0.1.4

func DeleteFromOfficeUserByOfficeID(
	ctx context.Context,
	db DB,
	OfficeID uuid.UUID,
) (sql.Result, error)

## Delete by OfficeID

func DeleteFromOfficeUserByOfficeIDUserID added in v0.1.4

func DeleteFromOfficeUserByOfficeIDUserID(
	ctx context.Context,
	db DB,
	OfficeID uuid.UUID,
	UserID uuid.UUID,
) (sql.Result, error)

## Delete by compound

func DeleteFromOfficeUserByUserID added in v0.1.4

func DeleteFromOfficeUserByUserID(
	ctx context.Context,
	db DB,
	UserID uuid.UUID,
) (sql.Result, error)

## Delete by UserID

func DeleteFromUserByEmail added in v0.1.4

func DeleteFromUserByEmail(
	ctx context.Context,
	db DB,
	Email string,
) (sql.Result, error)

## Delete by Email

func DeleteFromUserByID added in v0.1.4

func DeleteFromUserByID(
	ctx context.Context,
	db DB,
	ID uuid.UUID,
) (sql.Result, error)

## Delete by ID

func Errorf

func Errorf(s string, v ...interface{})

Errorf logs an error message using the package error logger.

func InsertIntoGooseDbVersion added in v0.1.4

func InsertIntoGooseDbVersion(
	ctx context.Context,
	db DB,
	modelsList ...*InsertableGooseDbVersionModel,
) (sql.Result, error)

func InsertIntoGooseDbVersionReturningID added in v0.1.4

func InsertIntoGooseDbVersionReturningID(
	ctx context.Context,
	db DB,
	modelsList ...*InsertableGooseDbVersionModel,
) (*int, error)

func InsertIntoOffice added in v0.1.4

func InsertIntoOffice(
	ctx context.Context,
	db DB,
	modelsList ...*InsertableOfficeModel,
) (sql.Result, error)

func InsertIntoOfficeReturningID added in v0.1.4

func InsertIntoOfficeReturningID(
	ctx context.Context,
	db DB,
	modelsList ...*InsertableOfficeModel,
) (*uuid.UUID, error)

func InsertIntoOfficeReturningName added in v0.1.4

func InsertIntoOfficeReturningName(
	ctx context.Context,
	db DB,
	modelsList ...*InsertableOfficeModel,
) (*string, error)

func InsertIntoOfficeUser added in v0.1.4

func InsertIntoOfficeUser(
	ctx context.Context,
	db DB,
	modelsList ...*InsertableOfficeUserModel,
) (sql.Result, error)

func InsertIntoOfficeUserReturningOfficeID added in v0.1.4

func InsertIntoOfficeUserReturningOfficeID(
	ctx context.Context,
	db DB,
	modelsList ...*InsertableOfficeUserModel,
) (*uuid.UUID, error)

func InsertIntoOfficeUserReturningUserID added in v0.1.4

func InsertIntoOfficeUserReturningUserID(
	ctx context.Context,
	db DB,
	modelsList ...*InsertableOfficeUserModel,
) (*uuid.UUID, error)

func InsertIntoUser added in v0.1.4

func InsertIntoUser(
	ctx context.Context,
	db DB,
	modelsList ...*InsertableUserModel,
) (sql.Result, error)

func InsertIntoUserReturningEmail added in v0.1.4

func InsertIntoUserReturningEmail(
	ctx context.Context,
	db DB,
	modelsList ...*InsertableUserModel,
) (*string, error)

func InsertIntoUserReturningID added in v0.1.4

func InsertIntoUserReturningID(
	ctx context.Context,
	db DB,
	modelsList ...*InsertableUserModel,
) (*uuid.UUID, error)

func Logf

func Logf(s string, v ...interface{})

Logf logs a message using the package logger.

func SetErrorLogger

func SetErrorLogger(logger interface{})

SetErrorLogger sets the package error logger. Valid logger types:

io.Writer
func(string, ...interface{}) (int, error) // fmt.Printf
func(string, ...interface{}) // log.Printf

func SetLogger

func SetLogger(logger interface{})

SetLogger sets the package logger. Valid logger types:

io.Writer
func(string, ...interface{}) (int, error) // fmt.Printf
func(string, ...interface{}) // log.Printf

func UUIDGenerateV1

func UUIDGenerateV1(ctx context.Context, db DB) (uuid.UUID, error)

UUIDGenerateV1 calls the stored function 'public.uuid_generate_v1() uuid' on db.

func UUIDGenerateV1mc

func UUIDGenerateV1mc(ctx context.Context, db DB) (uuid.UUID, error)

UUIDGenerateV1mc calls the stored function 'public.uuid_generate_v1mc() uuid' on db.

func UUIDGenerateV3

func UUIDGenerateV3(ctx context.Context, db DB, namespace uuid.UUID, name string) (uuid.UUID, error)

UUIDGenerateV3 calls the stored function 'public.uuid_generate_v3(uuid, text) uuid' on db.

func UUIDGenerateV4

func UUIDGenerateV4(ctx context.Context, db DB) (uuid.UUID, error)

UUIDGenerateV4 calls the stored function 'public.uuid_generate_v4() uuid' on db.

func UUIDGenerateV5

func UUIDGenerateV5(ctx context.Context, db DB, namespace uuid.UUID, name string) (uuid.UUID, error)

UUIDGenerateV5 calls the stored function 'public.uuid_generate_v5(uuid, text) uuid' on db.

func UUIDNil

func UUIDNil(ctx context.Context, db DB) (uuid.UUID, error)

UUIDNil calls the stored function 'public.uuid_nil() uuid' on db.

func UUIDNsDNS

func UUIDNsDNS(ctx context.Context, db DB) (uuid.UUID, error)

UUIDNsDNS calls the stored function 'public.uuid_ns_dns() uuid' on db.

func UUIDNsOid

func UUIDNsOid(ctx context.Context, db DB) (uuid.UUID, error)

UUIDNsOid calls the stored function 'public.uuid_ns_oid() uuid' on db.

func UUIDNsURL

func UUIDNsURL(ctx context.Context, db DB) (uuid.UUID, error)

UUIDNsURL calls the stored function 'public.uuid_ns_url() uuid' on db.

func UUIDNsX500

func UUIDNsX500(ctx context.Context, db DB) (uuid.UUID, error)

UUIDNsX500 calls the stored function 'public.uuid_ns_x500() uuid' on db.

func UpdateGooseDbVersionByID added in v0.1.4

func UpdateGooseDbVersionByID(
	ctx context.Context,
	db DB,
	ID int,
	updatableModel *UpdatableGooseDbVersionModel,
) (sql.Result, error)

# Update ## Update by ID

func UpdateOfficeByID added in v0.1.4

func UpdateOfficeByID(
	ctx context.Context,
	db DB,
	ID uuid.UUID,
	updatableModel *UpdatableOfficeModel,
) (sql.Result, error)

# Update ## Update by ID

func UpdateOfficeByName added in v0.1.4

func UpdateOfficeByName(
	ctx context.Context,
	db DB,
	Name string,
	updatableModel *UpdatableOfficeModel,
) (sql.Result, error)

# Update ## Update by Name

func UpdateOfficeUserByOfficeID added in v0.1.4

func UpdateOfficeUserByOfficeID(
	ctx context.Context,
	db DB,
	OfficeID uuid.UUID,
	updatableModel *UpdatableOfficeUserModel,
) (sql.Result, error)

# Update ## Update by OfficeID

func UpdateOfficeUserByOfficeIDUserID added in v0.1.4

func UpdateOfficeUserByOfficeIDUserID(
	ctx context.Context,
	db DB,
	OfficeID uuid.UUID,
	UserID uuid.UUID,
	updatableModel *UpdatableOfficeUserModel,
) (sql.Result, error)

## Update by compound

func UpdateOfficeUserByUserID added in v0.1.4

func UpdateOfficeUserByUserID(
	ctx context.Context,
	db DB,
	UserID uuid.UUID,
	updatableModel *UpdatableOfficeUserModel,
) (sql.Result, error)

# Update ## Update by UserID

func UpdateUserByEmail added in v0.1.4

func UpdateUserByEmail(
	ctx context.Context,
	db DB,
	Email string,
	updatableModel *UpdatableUserModel,
) (sql.Result, error)

# Update ## Update by Email

func UpdateUserByID added in v0.1.4

func UpdateUserByID(
	ctx context.Context,
	db DB,
	ID uuid.UUID,
	updatableModel *UpdatableUserModel,
) (sql.Result, error)

# Update ## Update by ID

Types

type DB

type DB interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row

	QueryxContext(context.Context, string, ...interface{}) (*sqlx.Rows, error)
	QueryRowxContext(context.Context, string, ...interface{}) *sqlx.Row
}

DB is the common interface for database operations that can be used with types from schema 'public'.

This works with both database/sql.DB and database/sql.Tx.

type ErrInsertFailed

type ErrInsertFailed struct {
	Err error
}

ErrInsertFailed is the insert failed error.

func (*ErrInsertFailed) Error

func (err *ErrInsertFailed) Error() string

Error satisfies the error interface.

func (*ErrInsertFailed) Unwrap

func (err *ErrInsertFailed) Unwrap() error

Unwrap satisfies the unwrap interface.

type ErrUpdateFailed

type ErrUpdateFailed struct {
	Err error
}

ErrUpdateFailed is the update failed error.

func (*ErrUpdateFailed) Error

func (err *ErrUpdateFailed) Error() string

Error satisfies the error interface.

func (*ErrUpdateFailed) Unwrap

func (err *ErrUpdateFailed) Unwrap() error

Unwrap satisfies the unwrap interface.

type ErrUpsertFailed

type ErrUpsertFailed struct {
	Err error
}

ErrUpsertFailed is the upsert failed error.

func (*ErrUpsertFailed) Error

func (err *ErrUpsertFailed) Error() string

Error satisfies the error interface.

func (*ErrUpsertFailed) Unwrap

func (err *ErrUpsertFailed) Unwrap() error

Unwrap satisfies the unwrap interface.

type Error

type Error string

Error is an error.

const (
	// ErrAlreadyExists is the already exists error.
	ErrAlreadyExists Error = "already exists"
	// ErrDoesNotExist is the does not exist error.
	ErrDoesNotExist Error = "does not exist"
	// ErrMarkedForDeletion is the marked for deletion error.
	ErrMarkedForDeletion Error = "marked for deletion"
)

Error values.

func (Error) Error

func (err Error) Error() string

Error satisfies the error interface.

type GooseDbVersionIDT added in v0.1.4

type GooseDbVersionIDT = int

Columns Types

type GooseDbVersionIsAppliedT added in v0.1.4

type GooseDbVersionIsAppliedT = bool

Columns Types

type GooseDbVersionModel

type GooseDbVersionModel struct {
	ID        int       `json:"id" db:"id"`
	VersionID int64     `json:"version_id" db:"version_id"`
	IsApplied bool      `json:"is_applied" db:"is_applied"`
	Tstamp    time.Time `json:"tstamp" db:"tstamp"`
}

func InsertIntoGooseDbVersionReturningAll added in v0.1.4

func InsertIntoGooseDbVersionReturningAll(
	ctx context.Context,
	db DB,
	modelsList ...*InsertableGooseDbVersionModel,
) (*GooseDbVersionModel, error)

func NewGooseDbVersionModel

func NewGooseDbVersionModel(
	ID int,
	VersionID int64,
	IsApplied bool,
	Tstamp time.Time,
) *GooseDbVersionModel

func SelectGooseDbVersionByID added in v0.1.4

func SelectGooseDbVersionByID(
	ctx context.Context,
	db DB,
	ID int,
) (*GooseDbVersionModel, error)

## Select by ID

type GooseDbVersionTable

type GooseDbVersionTable struct {
	sqli.Table
	ID        sqli.Column[int]
	VersionID sqli.Column[int64]
	IsApplied sqli.Column[bool]
	Tstamp    sqli.Column[time.Time]
}

func (GooseDbVersionTable) As added in v0.1.4

type GooseDbVersionTstampT added in v0.1.4

type GooseDbVersionTstampT = time.Time

Columns Types

type GooseDbVersionVersionIDT added in v0.1.4

type GooseDbVersionVersionIDT = int64

Columns Types

type InsertIntoOfficeUserReturningOfficeIDUserIDResult added in v0.1.4

type InsertIntoOfficeUserReturningOfficeIDUserIDResult struct {
	OfficeID uuid.UUID `json:"office_id" db:"office_id"`
	UserID   uuid.UUID `json:"user_id" db:"user_id"`
}

func InsertIntoOfficeUserReturningOfficeIDUserID added in v0.1.4

func InsertIntoOfficeUserReturningOfficeIDUserID(
	ctx context.Context,
	db DB,
	modelsList ...*InsertableOfficeUserModel,
) (*InsertIntoOfficeUserReturningOfficeIDUserIDResult, error)

type InsertableGooseDbVersionModel

type InsertableGooseDbVersionModel struct {
	VersionID int64     `json:"version_id" db:"version_id"`
	IsApplied bool      `json:"is_applied" db:"is_applied"`
	Tstamp    time.Time `json:"tstamp" db:"tstamp"`
}

func NewInsertableGooseDbVersionModel

func NewInsertableGooseDbVersionModel(
	VersionID int64,
	IsApplied bool,
	Tstamp time.Time,
) *InsertableGooseDbVersionModel

type InsertableOfficeModel

type InsertableOfficeModel struct {
	ID        uuid.UUID    `json:"id" db:"id"`
	Name      string       `json:"name" db:"name"`
	CreatedAt time.Time    `json:"created_at" db:"created_at"`
	UpdatedAt sql.NullTime `json:"updated_at" db:"updated_at"`
}

func NewInsertableOfficeModel

func NewInsertableOfficeModel(
	ID uuid.UUID,
	Name string,
	CreatedAt time.Time,
	UpdatedAt sql.NullTime,
) *InsertableOfficeModel

type InsertableOfficeUserModel

type InsertableOfficeUserModel struct {
	OfficeID  uuid.UUID    `json:"office_id" db:"office_id"`
	UserID    uuid.UUID    `json:"user_id" db:"user_id"`
	CreatedAt time.Time    `json:"created_at" db:"created_at"`
	UpdatedAt sql.NullTime `json:"updated_at" db:"updated_at"`
}

func NewInsertableOfficeUserModel

func NewInsertableOfficeUserModel(
	OfficeID uuid.UUID,
	UserID uuid.UUID,
	CreatedAt time.Time,
	UpdatedAt sql.NullTime,
) *InsertableOfficeUserModel

type InsertableUserModel

type InsertableUserModel struct {
	ID        uuid.UUID    `json:"id" db:"id"`
	Name      string       `json:"name" db:"name"`
	Email     string       `json:"email" db:"email"`
	Password  string       `json:"password" db:"password"`
	CreatedAt time.Time    `json:"created_at" db:"created_at"`
	UpdatedAt sql.NullTime `json:"updated_at" db:"updated_at"`
	Role      string       `json:"role" db:"role"`
}

func NewInsertableUserModel

func NewInsertableUserModel(
	ID uuid.UUID,
	Name string,
	Email string,
	Password string,
	CreatedAt time.Time,
	UpdatedAt sql.NullTime,
	Role string,
) *InsertableUserModel

type OfficeCreatedAtT added in v0.1.4

type OfficeCreatedAtT = time.Time

Columns Types

type OfficeIDT added in v0.1.4

type OfficeIDT = uuid.UUID

Columns Types

type OfficeModel

type OfficeModel struct {
	ID        uuid.UUID    `json:"id" db:"id"`
	Name      string       `json:"name" db:"name"`
	CreatedAt time.Time    `json:"created_at" db:"created_at"`
	UpdatedAt sql.NullTime `json:"updated_at" db:"updated_at"`
}

func InsertIntoOfficeReturningAll added in v0.1.4

func InsertIntoOfficeReturningAll(
	ctx context.Context,
	db DB,
	modelsList ...*InsertableOfficeModel,
) (*OfficeModel, error)

func NewOfficeModel

func NewOfficeModel(
	ID uuid.UUID,
	Name string,
	CreatedAt time.Time,
	UpdatedAt sql.NullTime,
) *OfficeModel

func SelectOfficeByID added in v0.1.4

func SelectOfficeByID(
	ctx context.Context,
	db DB,
	ID uuid.UUID,
) (*OfficeModel, error)

## Select by ID

func SelectOfficeByName added in v0.1.4

func SelectOfficeByName(
	ctx context.Context,
	db DB,
	Name string,
) (*OfficeModel, error)

## Select by Name

type OfficeNameT added in v0.1.4

type OfficeNameT = string

Columns Types

type OfficeTable

type OfficeTable struct {
	sqli.Table
	ID        sqli.Column[uuid.UUID]
	Name      sqli.Column[string]
	CreatedAt sqli.Column[time.Time]
	UpdatedAt sqli.Column[sql.NullTime]
}

func (OfficeTable) As added in v0.1.4

func (t OfficeTable) As(alias string) OfficeTable

type OfficeUpdatedAtT added in v0.1.4

type OfficeUpdatedAtT = sql.NullTime

Columns Types

type OfficeUserCreatedAtT added in v0.1.4

type OfficeUserCreatedAtT = time.Time

Columns Types

type OfficeUserModel

type OfficeUserModel struct {
	OfficeID  uuid.UUID    `json:"office_id" db:"office_id"`
	UserID    uuid.UUID    `json:"user_id" db:"user_id"`
	CreatedAt time.Time    `json:"created_at" db:"created_at"`
	UpdatedAt sql.NullTime `json:"updated_at" db:"updated_at"`
}

func InsertIntoOfficeUserReturningAll added in v0.1.4

func InsertIntoOfficeUserReturningAll(
	ctx context.Context,
	db DB,
	modelsList ...*InsertableOfficeUserModel,
) (*OfficeUserModel, error)

func NewOfficeUserModel

func NewOfficeUserModel(
	OfficeID uuid.UUID,
	UserID uuid.UUID,
	CreatedAt time.Time,
	UpdatedAt sql.NullTime,
) *OfficeUserModel

func SelectFromOfficeUserByOfficeIDUserID added in v0.1.4

func SelectFromOfficeUserByOfficeIDUserID(
	ctx context.Context,
	db DB,
	OfficeID uuid.UUID,
	UserID uuid.UUID,
) (*OfficeUserModel, error)

## Select by compound

func SelectOfficeUserByOfficeID added in v0.1.4

func SelectOfficeUserByOfficeID(
	ctx context.Context,
	db DB,
	OfficeID uuid.UUID,
) ([]*OfficeUserModel, error)

## Select by OfficeID

func SelectOfficeUserByUserID added in v0.1.4

func SelectOfficeUserByUserID(
	ctx context.Context,
	db DB,
	UserID uuid.UUID,
) ([]*OfficeUserModel, error)

## Select by UserID

type OfficeUserOfficeIDT added in v0.1.4

type OfficeUserOfficeIDT = uuid.UUID

Columns Types

type OfficeUserTable

type OfficeUserTable struct {
	sqli.Table
	OfficeID  sqli.Column[uuid.UUID]
	UserID    sqli.Column[uuid.UUID]
	CreatedAt sqli.Column[time.Time]
	UpdatedAt sqli.Column[sql.NullTime]
}

func (OfficeUserTable) As added in v0.1.4

type OfficeUserUpdatedAtT added in v0.1.4

type OfficeUserUpdatedAtT = sql.NullTime

Columns Types

type OfficeUserUserIDT added in v0.1.4

type OfficeUserUserIDT = uuid.UUID

Columns Types

type TablesSt added in v0.1.4

type TablesSt struct {
	GooseDbVersion string `json:"goose_db_version" db:"goose_db_version"`
	Office         string `json:"office" db:"office"`
	OfficeUser     string `json:"office_user" db:"office_user"`
	User           string `json:"user" db:"user"`
}

type UpdatableGooseDbVersionModel

type UpdatableGooseDbVersionModel struct {
	ID        *int       `json:"id" db:"id"`
	VersionID *int64     `json:"version_id" db:"version_id"`
	IsApplied *bool      `json:"is_applied" db:"is_applied"`
	Tstamp    *time.Time `json:"tstamp" db:"tstamp"`
}

func NewUpdatableGooseDbVersionModel

func NewUpdatableGooseDbVersionModel(
	ID *int,
	VersionID *int64,
	IsApplied *bool,
	Tstamp *time.Time,
) *UpdatableGooseDbVersionModel

type UpdatableOfficeModel

type UpdatableOfficeModel struct {
	ID        *uuid.UUID    `json:"id" db:"id"`
	Name      *string       `json:"name" db:"name"`
	CreatedAt *time.Time    `json:"created_at" db:"created_at"`
	UpdatedAt *sql.NullTime `json:"updated_at" db:"updated_at"`
}

func NewUpdatableOfficeModel

func NewUpdatableOfficeModel(
	ID *uuid.UUID,
	Name *string,
	CreatedAt *time.Time,
	UpdatedAt *sql.NullTime,
) *UpdatableOfficeModel

type UpdatableOfficeUserModel

type UpdatableOfficeUserModel struct {
	OfficeID  *uuid.UUID    `json:"office_id" db:"office_id"`
	UserID    *uuid.UUID    `json:"user_id" db:"user_id"`
	CreatedAt *time.Time    `json:"created_at" db:"created_at"`
	UpdatedAt *sql.NullTime `json:"updated_at" db:"updated_at"`
}

func NewUpdatableOfficeUserModel

func NewUpdatableOfficeUserModel(
	OfficeID *uuid.UUID,
	UserID *uuid.UUID,
	CreatedAt *time.Time,
	UpdatedAt *sql.NullTime,
) *UpdatableOfficeUserModel

type UpdatableUserModel

type UpdatableUserModel struct {
	ID        *uuid.UUID    `json:"id" db:"id"`
	Name      *string       `json:"name" db:"name"`
	Email     *string       `json:"email" db:"email"`
	Password  *string       `json:"password" db:"password"`
	CreatedAt *time.Time    `json:"created_at" db:"created_at"`
	UpdatedAt *sql.NullTime `json:"updated_at" db:"updated_at"`
	Role      *string       `json:"role" db:"role"`
}

func NewUpdatableUserModel

func NewUpdatableUserModel(
	ID *uuid.UUID,
	Name *string,
	Email *string,
	Password *string,
	CreatedAt *time.Time,
	UpdatedAt *sql.NullTime,
	Role *string,
) *UpdatableUserModel

type UserCreatedAtT added in v0.1.4

type UserCreatedAtT = time.Time

Columns Types

type UserEmailT added in v0.1.4

type UserEmailT = string

Columns Types

type UserIDT added in v0.1.4

type UserIDT = uuid.UUID

Columns Types

type UserModel

type UserModel struct {
	ID        uuid.UUID    `json:"id" db:"id"`
	Name      string       `json:"name" db:"name"`
	Email     string       `json:"email" db:"email"`
	Password  string       `json:"password" db:"password"`
	CreatedAt time.Time    `json:"created_at" db:"created_at"`
	UpdatedAt sql.NullTime `json:"updated_at" db:"updated_at"`
	Role      string       `json:"role" db:"role"`
}

func InsertIntoUserReturningAll added in v0.1.4

func InsertIntoUserReturningAll(
	ctx context.Context,
	db DB,
	modelsList ...*InsertableUserModel,
) (*UserModel, error)

func NewUserModel

func NewUserModel(
	ID uuid.UUID,
	Name string,
	Email string,
	Password string,
	CreatedAt time.Time,
	UpdatedAt sql.NullTime,
	Role string,
) *UserModel

func SelectUserByEmail added in v0.1.4

func SelectUserByEmail(
	ctx context.Context,
	db DB,
	Email string,
) (*UserModel, error)

## Select by Email

func SelectUserByID added in v0.1.4

func SelectUserByID(
	ctx context.Context,
	db DB,
	ID uuid.UUID,
) (*UserModel, error)

## Select by ID

type UserNameT added in v0.1.4

type UserNameT = string

Columns Types

type UserPasswordT added in v0.1.4

type UserPasswordT = string

Columns Types

type UserRoleT added in v0.1.4

type UserRoleT = string

Columns Types

type UserTable

type UserTable struct {
	sqli.Table
	ID        sqli.Column[uuid.UUID]
	Name      sqli.Column[string]
	Email     sqli.Column[string]
	Password  sqli.Column[string]
	CreatedAt sqli.Column[time.Time]
	UpdatedAt sqli.Column[sql.NullTime]
	Role      sqli.Column[string]
}

func (UserTable) As added in v0.1.4

func (t UserTable) As(alias string) UserTable

type UserUpdatedAtT added in v0.1.4

type UserUpdatedAtT = sql.NullTime

Columns Types

Jump to

Keyboard shortcuts

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