models

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AuthenticationCodeColumns = struct {
	ID        string
	CreatedAt string
	UserID    string
	Code      string
	Expired   string
}{
	ID:        "id",
	CreatedAt: "created_at",
	UserID:    "user_id",
	Code:      "code",
	Expired:   "expired",
}
View Source
var AuthenticationCodeRels = struct {
	User string
}{
	User: "User",
}

AuthenticationCodeRels is where relationship names are stored.

View Source
var AuthenticationCodeTableColumns = struct {
	ID        string
	CreatedAt string
	UserID    string
	Code      string
	Expired   string
}{
	ID:        "authentication_codes.id",
	CreatedAt: "authentication_codes.created_at",
	UserID:    "authentication_codes.user_id",
	Code:      "authentication_codes.code",
	Expired:   "authentication_codes.expired",
}
View Source
var AuthenticationCodeWhere = struct {
	ID        whereHelperint64
	CreatedAt whereHelpertime_Time
	UserID    whereHelperint64
	Code      whereHelperstring
	Expired   whereHelperbool
}{
	ID:        whereHelperint64{/* contains filtered or unexported fields */},
	CreatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */},
	UserID:    whereHelperint64{/* contains filtered or unexported fields */},
	Code:      whereHelperstring{/* contains filtered or unexported fields */},
	Expired:   whereHelperbool{/* contains filtered or unexported fields */},
}
View Source
var ErrSyncFail = errors.New("models: failed to synchronize data after insert")

ErrSyncFail occurs during insert when the record could not be retrieved in order to populate default value information. This usually happens when LastInsertId fails or there was a primary key configuration that was not resolvable.

View Source
var PassportColumns = struct {
	ID         string
	Series     string
	Number     string
	FirstName  string
	MiddleName string
	LastName   string
	IssuedBy   string
	IssuedAt   string
	Address    string
	Birthplace string
	Birthdate  string
}{
	ID:         "id",
	Series:     "series",
	Number:     "number",
	FirstName:  "first_name",
	MiddleName: "middle_name",
	LastName:   "last_name",
	IssuedBy:   "issued_by",
	IssuedAt:   "issued_at",
	Address:    "address",
	Birthplace: "birthplace",
	Birthdate:  "birthdate",
}
View Source
var PassportRels = struct {
	User string
}{
	User: "User",
}

PassportRels is where relationship names are stored.

View Source
var PassportTableColumns = struct {
	ID         string
	Series     string
	Number     string
	FirstName  string
	MiddleName string
	LastName   string
	IssuedBy   string
	IssuedAt   string
	Address    string
	Birthplace string
	Birthdate  string
}{
	ID:         "passports.id",
	Series:     "passports.series",
	Number:     "passports.number",
	FirstName:  "passports.first_name",
	MiddleName: "passports.middle_name",
	LastName:   "passports.last_name",
	IssuedBy:   "passports.issued_by",
	IssuedAt:   "passports.issued_at",
	Address:    "passports.address",
	Birthplace: "passports.birthplace",
	Birthdate:  "passports.birthdate",
}
View Source
var PassportWhere = struct {
	ID         whereHelperint64
	Series     whereHelperstring
	Number     whereHelperstring
	FirstName  whereHelperstring
	MiddleName whereHelperstring
	LastName   whereHelperstring
	IssuedBy   whereHelperstring
	IssuedAt   whereHelpertime_Time
	Address    whereHelperstring
	Birthplace whereHelperstring
	Birthdate  whereHelpertime_Time
}{
	ID:         whereHelperint64{/* contains filtered or unexported fields */},
	Series:     whereHelperstring{/* contains filtered or unexported fields */},
	Number:     whereHelperstring{/* contains filtered or unexported fields */},
	FirstName:  whereHelperstring{/* contains filtered or unexported fields */},
	MiddleName: whereHelperstring{/* contains filtered or unexported fields */},
	LastName:   whereHelperstring{/* contains filtered or unexported fields */},
	IssuedBy:   whereHelperstring{/* contains filtered or unexported fields */},
	IssuedAt:   whereHelpertime_Time{/* contains filtered or unexported fields */},
	Address:    whereHelperstring{/* contains filtered or unexported fields */},
	Birthplace: whereHelperstring{/* contains filtered or unexported fields */},
	Birthdate:  whereHelpertime_Time{/* contains filtered or unexported fields */},
}
View Source
var TableNames = struct {
	AuthenticationCodes string
	Passports           string
	Users               string
}{
	AuthenticationCodes: "authentication_codes",
	Passports:           "passports",
	Users:               "users",
}
View Source
var UserColumns = struct {
	ID         string
	CreatedAt  string
	Email      string
	Password   string
	PassportID string
	HashSalt   string
}{
	ID:         "id",
	CreatedAt:  "created_at",
	Email:      "email",
	Password:   "password",
	PassportID: "passport_id",
	HashSalt:   "hash_salt",
}
View Source
var UserRels = struct {
	Passport            string
	AuthenticationCodes string
}{
	Passport:            "Passport",
	AuthenticationCodes: "AuthenticationCodes",
}

UserRels is where relationship names are stored.

View Source
var UserTableColumns = struct {
	ID         string
	CreatedAt  string
	Email      string
	Password   string
	PassportID string
	HashSalt   string
}{
	ID:         "users.id",
	CreatedAt:  "users.created_at",
	Email:      "users.email",
	Password:   "users.password",
	PassportID: "users.passport_id",
	HashSalt:   "users.hash_salt",
}
View Source
var UserWhere = struct {
	ID         whereHelperint64
	CreatedAt  whereHelpertime_Time
	Email      whereHelperstring
	Password   whereHelperstring
	PassportID whereHelperint64
	HashSalt   whereHelperstring
}{
	ID:         whereHelperint64{/* contains filtered or unexported fields */},
	CreatedAt:  whereHelpertime_Time{/* contains filtered or unexported fields */},
	Email:      whereHelperstring{/* contains filtered or unexported fields */},
	Password:   whereHelperstring{/* contains filtered or unexported fields */},
	PassportID: whereHelperint64{/* contains filtered or unexported fields */},
	HashSalt:   whereHelperstring{/* contains filtered or unexported fields */},
}
View Source
var ViewNames = struct {
}{}

Functions

func AuthenticationCodeExists

func AuthenticationCodeExists(ctx context.Context, exec boil.ContextExecutor, iD int64) (bool, error)

AuthenticationCodeExists checks if the AuthenticationCode row exists.

func AuthenticationCodes

func AuthenticationCodes(mods ...qm.QueryMod) authenticationCodeQuery

AuthenticationCodes retrieves all the records using an executor.

func NewQuery

func NewQuery(mods ...qm.QueryMod) *queries.Query

NewQuery initializes a new Query using the passed in QueryMods

func PassportExists

func PassportExists(ctx context.Context, exec boil.ContextExecutor, iD int64) (bool, error)

PassportExists checks if the Passport row exists.

func Passports

func Passports(mods ...qm.QueryMod) passportQuery

Passports retrieves all the records using an executor.

func UserExists

func UserExists(ctx context.Context, exec boil.ContextExecutor, iD int64) (bool, error)

UserExists checks if the User row exists.

func Users

func Users(mods ...qm.QueryMod) userQuery

Users retrieves all the records using an executor.

Types

type AuthenticationCode

type AuthenticationCode struct {
	ID        int64     `boil:"id" json:"id" toml:"id" yaml:"id"`
	CreatedAt time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
	UserID    int64     `boil:"user_id" json:"user_id" toml:"user_id" yaml:"user_id"`
	Code      string    `boil:"code" json:"code" toml:"code" yaml:"code"`
	Expired   bool      `boil:"expired" json:"expired" toml:"expired" yaml:"expired"`

	R *authenticationCodeR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L authenticationCodeL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

AuthenticationCode is an object representing the database table.

func FindAuthenticationCode

func FindAuthenticationCode(ctx context.Context, exec boil.ContextExecutor, iD int64, selectCols ...string) (*AuthenticationCode, error)

FindAuthenticationCode retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.

func (*AuthenticationCode) Delete

Delete deletes a single AuthenticationCode record with an executor. Delete will match against the primary key column to find the record to delete.

func (*AuthenticationCode) Insert

func (o *AuthenticationCode) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error

Insert a single record using an executor. See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts.

func (*AuthenticationCode) Reload

Reload refetches the object from the database using the primary keys with an executor.

func (*AuthenticationCode) SetUser

func (o *AuthenticationCode) SetUser(ctx context.Context, exec boil.ContextExecutor, insert bool, related *User) error

SetUser of the authenticationCode to the related item. Sets o.R.User to related. Adds o to related.R.AuthenticationCodes.

func (*AuthenticationCode) Update

func (o *AuthenticationCode) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)

Update uses an executor to update the AuthenticationCode. See boil.Columns.UpdateColumnSet documentation to understand column list inference for updates. Update does not automatically update the record in case of default values. Use .Reload() to refresh the records.

func (*AuthenticationCode) Upsert

func (o *AuthenticationCode) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns) error

Upsert attempts an insert using an executor, and does an update or ignore on conflict. See boil.Columns documentation for how to properly use updateColumns and insertColumns.

func (*AuthenticationCode) User

func (o *AuthenticationCode) User(mods ...qm.QueryMod) userQuery

User pointed to by the foreign key.

type AuthenticationCodeSlice

type AuthenticationCodeSlice []*AuthenticationCode

AuthenticationCodeSlice is an alias for a slice of pointers to AuthenticationCode. This should almost always be used instead of []AuthenticationCode.

func (AuthenticationCodeSlice) DeleteAll

DeleteAll deletes all rows in the slice, using an executor.

func (*AuthenticationCodeSlice) ReloadAll

ReloadAll refetches every row with matching primary key column values and overwrites the original object slice with the newly updated slice.

func (AuthenticationCodeSlice) UpdateAll

func (o AuthenticationCodeSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error)

UpdateAll updates all rows with the specified column values, using an executor.

type M

type M map[string]interface{}

M type is for providing columns and column values to UpdateAll.

type Passport

type Passport struct {
	ID         int64     `boil:"id" json:"id" toml:"id" yaml:"id"`
	Series     string    `boil:"series" json:"series" toml:"series" yaml:"series"`
	Number     string    `boil:"number" json:"number" toml:"number" yaml:"number"`
	FirstName  string    `boil:"first_name" json:"first_name" toml:"first_name" yaml:"first_name"`
	MiddleName string    `boil:"middle_name" json:"middle_name" toml:"middle_name" yaml:"middle_name"`
	LastName   string    `boil:"last_name" json:"last_name" toml:"last_name" yaml:"last_name"`
	IssuedBy   string    `boil:"issued_by" json:"issued_by" toml:"issued_by" yaml:"issued_by"`
	IssuedAt   time.Time `boil:"issued_at" json:"issued_at" toml:"issued_at" yaml:"issued_at"`
	Address    string    `boil:"address" json:"address" toml:"address" yaml:"address"`
	Birthplace string    `boil:"birthplace" json:"birthplace" toml:"birthplace" yaml:"birthplace"`
	Birthdate  time.Time `boil:"birthdate" json:"birthdate" toml:"birthdate" yaml:"birthdate"`

	R *passportR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L passportL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Passport is an object representing the database table.

func FindPassport

func FindPassport(ctx context.Context, exec boil.ContextExecutor, iD int64, selectCols ...string) (*Passport, error)

FindPassport retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.

func (*Passport) Delete

func (o *Passport) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)

Delete deletes a single Passport record with an executor. Delete will match against the primary key column to find the record to delete.

func (*Passport) Insert

func (o *Passport) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error

Insert a single record using an executor. See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts.

func (*Passport) Reload

func (o *Passport) Reload(ctx context.Context, exec boil.ContextExecutor) error

Reload refetches the object from the database using the primary keys with an executor.

func (*Passport) SetUser

func (o *Passport) SetUser(ctx context.Context, exec boil.ContextExecutor, insert bool, related *User) error

SetUser of the passport to the related item. Sets o.R.User to related. Adds o to related.R.Passport.

func (*Passport) Update

func (o *Passport) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)

Update uses an executor to update the Passport. See boil.Columns.UpdateColumnSet documentation to understand column list inference for updates. Update does not automatically update the record in case of default values. Use .Reload() to refresh the records.

func (*Passport) Upsert

func (o *Passport) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns) error

Upsert attempts an insert using an executor, and does an update or ignore on conflict. See boil.Columns documentation for how to properly use updateColumns and insertColumns.

func (*Passport) User

func (o *Passport) User(mods ...qm.QueryMod) userQuery

User pointed to by the foreign key.

type PassportSlice

type PassportSlice []*Passport

PassportSlice is an alias for a slice of pointers to Passport. This should almost always be used instead of []Passport.

func (PassportSlice) DeleteAll

func (o PassportSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error)

DeleteAll deletes all rows in the slice, using an executor.

func (*PassportSlice) ReloadAll

func (o *PassportSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error

ReloadAll refetches every row with matching primary key column values and overwrites the original object slice with the newly updated slice.

func (PassportSlice) UpdateAll

func (o PassportSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error)

UpdateAll updates all rows with the specified column values, using an executor.

type User

type User struct {
	ID         int64     `boil:"id" json:"id" toml:"id" yaml:"id"`
	CreatedAt  time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
	Email      string    `boil:"email" json:"email" toml:"email" yaml:"email"`
	Password   string    `boil:"password" json:"password" toml:"password" yaml:"password"`
	PassportID int64     `boil:"passport_id" json:"passport_id" toml:"passport_id" yaml:"passport_id"`
	HashSalt   string    `boil:"hash_salt" json:"hash_salt" toml:"hash_salt" yaml:"hash_salt"`

	R *userR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L userL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

User is an object representing the database table.

func FindUser

func FindUser(ctx context.Context, exec boil.ContextExecutor, iD int64, selectCols ...string) (*User, error)

FindUser retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.

func (*User) AddAuthenticationCodes

func (o *User) AddAuthenticationCodes(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*AuthenticationCode) error

AddAuthenticationCodes adds the given related objects to the existing relationships of the user, optionally inserting them as new records. Appends related to o.R.AuthenticationCodes. Sets related.R.User appropriately.

func (*User) AuthenticationCodes

func (o *User) AuthenticationCodes(mods ...qm.QueryMod) authenticationCodeQuery

AuthenticationCodes retrieves all the authentication_code's AuthenticationCodes with an executor.

func (*User) Delete

func (o *User) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)

Delete deletes a single User record with an executor. Delete will match against the primary key column to find the record to delete.

func (*User) Insert

func (o *User) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error

Insert a single record using an executor. See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts.

func (*User) Passport

func (o *User) Passport(mods ...qm.QueryMod) passportQuery

Passport pointed to by the foreign key.

func (*User) Reload

func (o *User) Reload(ctx context.Context, exec boil.ContextExecutor) error

Reload refetches the object from the database using the primary keys with an executor.

func (*User) SetPassport

func (o *User) SetPassport(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Passport) error

SetPassport of the user to the related item. Sets o.R.Passport to related. Adds o to related.R.User.

func (*User) Update

func (o *User) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)

Update uses an executor to update the User. See boil.Columns.UpdateColumnSet documentation to understand column list inference for updates. Update does not automatically update the record in case of default values. Use .Reload() to refresh the records.

func (*User) Upsert

func (o *User) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns) error

Upsert attempts an insert using an executor, and does an update or ignore on conflict. See boil.Columns documentation for how to properly use updateColumns and insertColumns.

type UserSlice

type UserSlice []*User

UserSlice is an alias for a slice of pointers to User. This should almost always be used instead of []User.

func (UserSlice) DeleteAll

func (o UserSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error)

DeleteAll deletes all rows in the slice, using an executor.

func (*UserSlice) ReloadAll

func (o *UserSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error

ReloadAll refetches every row with matching primary key column values and overwrites the original object slice with the newly updated slice.

func (UserSlice) UpdateAll

func (o UserSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error)

UpdateAll updates all rows with the specified column values, using an executor.

Jump to

Keyboard shortcuts

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