schema

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AuthColumns = struct {
	ID                  string
	PersonID            string
	CreatedAt           string
	ModifiedAt          string
	PasswordDigest      string
	YubikeyDigest       string
	YubikeyBackupDigest string
	Email               string
	EmailConfirmToken   string
	EmailConfirmed      string
	EmailConfirmTime    string
	LastIPAddress       string
	LastLoginAt         string
	LastUserAgent       string
	LoginCount          string
	ResetForce          string
	ResetPasswordTime   string
	ResetPasswordToken  string
	ResetTokenExpiresAt string
	Locked              string
	LockedTime          string
	LockedByUserID      string
	IsDeleted           string
}{
	ID:                  "id",
	PersonID:            "person_id",
	CreatedAt:           "created_at",
	ModifiedAt:          "modified_at",
	PasswordDigest:      "password_digest",
	YubikeyDigest:       "yubikey_digest",
	YubikeyBackupDigest: "yubikey_backup_digest",
	Email:               "email",
	EmailConfirmToken:   "email_confirm_token",
	EmailConfirmed:      "email_confirmed",
	EmailConfirmTime:    "email_confirm_time",
	LastIPAddress:       "last_ip_address",
	LastLoginAt:         "last_login_at",
	LastUserAgent:       "last_user_agent",
	LoginCount:          "login_count",
	ResetForce:          "reset_force",
	ResetPasswordTime:   "reset_password_time",
	ResetPasswordToken:  "reset_password_token",
	ResetTokenExpiresAt: "reset_token_expires_at",
	Locked:              "locked",
	LockedTime:          "locked_time",
	LockedByUserID:      "locked_by_user_id",
	IsDeleted:           "is_deleted",
}
View Source
var AuthRels = struct {
	Person string
}{
	Person: "Person",
}

AuthRels is where relationship names are stored.

View Source
var AuthTableColumns = struct {
	ID                  string
	PersonID            string
	CreatedAt           string
	ModifiedAt          string
	PasswordDigest      string
	YubikeyDigest       string
	YubikeyBackupDigest string
	Email               string
	EmailConfirmToken   string
	EmailConfirmed      string
	EmailConfirmTime    string
	LastIPAddress       string
	LastLoginAt         string
	LastUserAgent       string
	LoginCount          string
	ResetForce          string
	ResetPasswordTime   string
	ResetPasswordToken  string
	ResetTokenExpiresAt string
	Locked              string
	LockedTime          string
	LockedByUserID      string
	IsDeleted           string
}{
	ID:                  "auths.id",
	PersonID:            "auths.person_id",
	CreatedAt:           "auths.created_at",
	ModifiedAt:          "auths.modified_at",
	PasswordDigest:      "auths.password_digest",
	YubikeyDigest:       "auths.yubikey_digest",
	YubikeyBackupDigest: "auths.yubikey_backup_digest",
	Email:               "auths.email",
	EmailConfirmToken:   "auths.email_confirm_token",
	EmailConfirmed:      "auths.email_confirmed",
	EmailConfirmTime:    "auths.email_confirm_time",
	LastIPAddress:       "auths.last_ip_address",
	LastLoginAt:         "auths.last_login_at",
	LastUserAgent:       "auths.last_user_agent",
	LoginCount:          "auths.login_count",
	ResetForce:          "auths.reset_force",
	ResetPasswordTime:   "auths.reset_password_time",
	ResetPasswordToken:  "auths.reset_password_token",
	ResetTokenExpiresAt: "auths.reset_token_expires_at",
	Locked:              "auths.locked",
	LockedTime:          "auths.locked_time",
	LockedByUserID:      "auths.locked_by_user_id",
	IsDeleted:           "auths.is_deleted",
}
View Source
var AuthWhere = struct {
	ID                  whereHelperuint64
	PersonID            whereHelperuint64
	CreatedAt           whereHelpertime_Time
	ModifiedAt          whereHelpertime_Time
	PasswordDigest      whereHelperstring
	YubikeyDigest       whereHelperstring
	YubikeyBackupDigest whereHelperstring
	Email               whereHelperstring
	EmailConfirmToken   whereHelperstring
	EmailConfirmed      whereHelpernull_Bool
	EmailConfirmTime    whereHelpernull_Time
	LastIPAddress       whereHelperstring
	LastLoginAt         whereHelpernull_Time
	LastUserAgent       whereHelperstring
	LoginCount          whereHelpernull_Uint
	ResetForce          whereHelpernull_Bool
	ResetPasswordTime   whereHelpernull_Time
	ResetPasswordToken  whereHelperstring
	ResetTokenExpiresAt whereHelpernull_Time
	Locked              whereHelpernull_Bool
	LockedTime          whereHelpernull_Time
	LockedByUserID      whereHelpernull_Uint64
	IsDeleted           whereHelpernull_Bool
}{
	ID:                  whereHelperuint64{/* contains filtered or unexported fields */},
	PersonID:            whereHelperuint64{/* contains filtered or unexported fields */},
	CreatedAt:           whereHelpertime_Time{/* contains filtered or unexported fields */},
	ModifiedAt:          whereHelpertime_Time{/* contains filtered or unexported fields */},
	PasswordDigest:      whereHelperstring{/* contains filtered or unexported fields */},
	YubikeyDigest:       whereHelperstring{/* contains filtered or unexported fields */},
	YubikeyBackupDigest: whereHelperstring{/* contains filtered or unexported fields */},
	Email:               whereHelperstring{/* contains filtered or unexported fields */},
	EmailConfirmToken:   whereHelperstring{/* contains filtered or unexported fields */},
	EmailConfirmed:      whereHelpernull_Bool{/* contains filtered or unexported fields */},
	EmailConfirmTime:    whereHelpernull_Time{/* contains filtered or unexported fields */},
	LastIPAddress:       whereHelperstring{/* contains filtered or unexported fields */},
	LastLoginAt:         whereHelpernull_Time{/* contains filtered or unexported fields */},
	LastUserAgent:       whereHelperstring{/* contains filtered or unexported fields */},
	LoginCount:          whereHelpernull_Uint{/* contains filtered or unexported fields */},
	ResetForce:          whereHelpernull_Bool{/* contains filtered or unexported fields */},
	ResetPasswordTime:   whereHelpernull_Time{/* contains filtered or unexported fields */},
	ResetPasswordToken:  whereHelperstring{/* contains filtered or unexported fields */},
	ResetTokenExpiresAt: whereHelpernull_Time{/* contains filtered or unexported fields */},
	Locked:              whereHelpernull_Bool{/* contains filtered or unexported fields */},
	LockedTime:          whereHelpernull_Time{/* contains filtered or unexported fields */},
	LockedByUserID:      whereHelpernull_Uint64{/* contains filtered or unexported fields */},
	IsDeleted:           whereHelpernull_Bool{/* contains filtered or unexported fields */},
}
View Source
var ErrSyncFail = errors.New("schema: 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 PersonColumns = struct {
	ID         string
	FirstName  string
	MiddleName string
	LastName   string
	Email      string
	CreatedAt  string
	ModifiedAt string
	IsDeleted  string
}{
	ID:         "id",
	FirstName:  "first_name",
	MiddleName: "middle_name",
	LastName:   "last_name",
	Email:      "email",
	CreatedAt:  "created_at",
	ModifiedAt: "modified_at",
	IsDeleted:  "is_deleted",
}
View Source
var PersonRels = struct {
	Auth string
}{
	Auth: "Auth",
}

PersonRels is where relationship names are stored.

View Source
var PersonTableColumns = struct {
	ID         string
	FirstName  string
	MiddleName string
	LastName   string
	Email      string
	CreatedAt  string
	ModifiedAt string
	IsDeleted  string
}{
	ID:         "persons.id",
	FirstName:  "persons.first_name",
	MiddleName: "persons.middle_name",
	LastName:   "persons.last_name",
	Email:      "persons.email",
	CreatedAt:  "persons.created_at",
	ModifiedAt: "persons.modified_at",
	IsDeleted:  "persons.is_deleted",
}
View Source
var PersonWhere = struct {
	ID         whereHelperuint64
	FirstName  whereHelperstring
	MiddleName whereHelperstring
	LastName   whereHelperstring
	Email      whereHelperstring
	CreatedAt  whereHelpertime_Time
	ModifiedAt whereHelpertime_Time
	IsDeleted  whereHelpernull_Bool
}{
	ID:         whereHelperuint64{/* 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 */},
	Email:      whereHelperstring{/* contains filtered or unexported fields */},
	CreatedAt:  whereHelpertime_Time{/* contains filtered or unexported fields */},
	ModifiedAt: whereHelpertime_Time{/* contains filtered or unexported fields */},
	IsDeleted:  whereHelpernull_Bool{/* contains filtered or unexported fields */},
}
View Source
var TableNames = struct {
	Auths   string
	Persons string
}{
	Auths:   "auths",
	Persons: "persons",
}

Functions

func AddAuthHook

func AddAuthHook(hookPoint boil.HookPoint, authHook AuthHook)

AddAuthHook registers your hook function for all future operations.

func AddPersonHook

func AddPersonHook(hookPoint boil.HookPoint, personHook PersonHook)

AddPersonHook registers your hook function for all future operations.

func AuthExists

func AuthExists(ctx context.Context, exec boil.ContextExecutor, iD uint64) (bool, error)

AuthExists checks if the Auth row exists.

func Auths

func Auths(mods ...qm.QueryMod) authQuery

Auths 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 PersonExists

func PersonExists(ctx context.Context, exec boil.ContextExecutor, iD uint64) (bool, error)

PersonExists checks if the Person row exists.

func Persons

func Persons(mods ...qm.QueryMod) personQuery

Persons retrieves all the records using an executor.

Types

type Auth

type Auth struct {
	ID uint64 `boil:"id" json:"id" toml:"id" yaml:"id"`
	// ID of the related person record
	PersonID uint64 `boil:"person_id" json:"person_id" toml:"person_id" yaml:"person_id"`
	// Time the record was created
	CreatedAt time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
	// Time the record was last modified
	ModifiedAt time.Time `boil:"modified_at" json:"modified_at" toml:"modified_at" yaml:"modified_at"`
	// Password digest for authentication
	PasswordDigest string `boil:"password_digest" json:"password_digest" toml:"password_digest" yaml:"password_digest"`
	// Secure Yubikey ID
	YubikeyDigest string `boil:"yubikey_digest" json:"yubikey_digest" toml:"yubikey_digest" yaml:"yubikey_digest"`
	// Secure Yubikey Backup ID
	YubikeyBackupDigest string `boil:"yubikey_backup_digest" json:"yubikey_backup_digest" toml:"yubikey_backup_digest" yaml:"yubikey_backup_digest"`
	// Unique email address for the person
	Email string `boil:"email" json:"email" toml:"email" yaml:"email"`
	// Confirm email token (encrypted email address)
	EmailConfirmToken string `boil:"email_confirm_token" json:"email_confirm_token" toml:"email_confirm_token" yaml:"email_confirm_token"`
	// Flag for if email is confirmed
	EmailConfirmed null.Bool `boil:"email_confirmed" json:"email_confirmed,omitempty" toml:"email_confirmed" yaml:"email_confirmed,omitempty"`
	// Last confirm email time
	EmailConfirmTime null.Time `boil:"email_confirm_time" json:"email_confirm_time,omitempty" toml:"email_confirm_time" yaml:"email_confirm_time,omitempty"`
	// Last IP address used to login
	LastIPAddress string `boil:"last_ip_address" json:"last_ip_address" toml:"last_ip_address" yaml:"last_ip_address"`
	// Last login time
	LastLoginAt null.Time `boil:"last_login_at" json:"last_login_at,omitempty" toml:"last_login_at" yaml:"last_login_at,omitempty"`
	// Last user agent from login
	LastUserAgent string `boil:"last_user_agent" json:"last_user_agent" toml:"last_user_agent" yaml:"last_user_agent"`
	// User incremental login count
	LoginCount null.Uint `boil:"login_count" json:"login_count,omitempty" toml:"login_count" yaml:"login_count,omitempty"`
	// Flag for if the person must reset password before login
	ResetForce null.Bool `boil:"reset_force" json:"reset_force,omitempty" toml:"reset_force" yaml:"reset_force,omitempty"`
	// Last reset password time
	ResetPasswordTime null.Time `` /* 127-byte string literal not displayed */
	// Reset password token
	ResetPasswordToken string `boil:"reset_password_token" json:"reset_password_token" toml:"reset_password_token" yaml:"reset_password_token"`
	// Password reset expiration time
	ResetTokenExpiresAt null.Time `` /* 139-byte string literal not displayed */
	// Locking out from login
	Locked null.Bool `boil:"locked" json:"locked,omitempty" toml:"locked" yaml:"locked,omitempty"`
	// Time when lock out occurred
	LockedTime null.Time `boil:"locked_time" json:"locked_time,omitempty" toml:"locked_time" yaml:"locked_time,omitempty"`
	// User ID who created the record
	LockedByUserID null.Uint64 `boil:"locked_by_user_id" json:"locked_by_user_id,omitempty" toml:"locked_by_user_id" yaml:"locked_by_user_id,omitempty"`
	// Flag for if the record is deleted
	IsDeleted null.Bool `boil:"is_deleted" json:"is_deleted,omitempty" toml:"is_deleted" yaml:"is_deleted,omitempty"`

	R *authR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L authL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Auth is an object representing the database table.

func FindAuth

func FindAuth(ctx context.Context, exec boil.ContextExecutor, iD uint64, selectCols ...string) (*Auth, error)

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

func (*Auth) Delete

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

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

func (*Auth) Insert

func (o *Auth) 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 (*Auth) Person

func (o *Auth) Person(mods ...qm.QueryMod) personQuery

Person pointed to by the foreign key.

func (*Auth) Reload

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

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

func (*Auth) SetPerson

func (o *Auth) SetPerson(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Person) error

SetPerson of the auth to the related item. Sets o.R.Person to related. Adds o to related.R.Auth.

func (*Auth) Update

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

Update uses an executor to update the Auth. 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 (*Auth) Upsert

func (o *Auth) Upsert(ctx context.Context, exec boil.ContextExecutor, 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 AuthHook

type AuthHook func(context.Context, boil.ContextExecutor, *Auth) error

AuthHook is the signature for custom Auth hook methods

type AuthSlice

type AuthSlice []*Auth

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

func (AuthSlice) DeleteAll

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

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

func (*AuthSlice) ReloadAll

func (o *AuthSlice) 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 (AuthSlice) UpdateAll

func (o AuthSlice) 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 Person

type Person struct {
	ID uint64 `boil:"id" json:"id" toml:"id" yaml:"id"`
	// First name of person
	FirstName string `boil:"first_name" json:"first_name" toml:"first_name" yaml:"first_name"`
	// Middle name of person
	MiddleName string `boil:"middle_name" json:"middle_name" toml:"middle_name" yaml:"middle_name"`
	// Last name of person
	LastName string `boil:"last_name" json:"last_name" toml:"last_name" yaml:"last_name"`
	// NOT unique email address for the person
	Email string `boil:"email" json:"email" toml:"email" yaml:"email"`
	// Time the record was created
	CreatedAt time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
	// Time the record was last modified
	ModifiedAt time.Time `boil:"modified_at" json:"modified_at" toml:"modified_at" yaml:"modified_at"`
	// Flag for if the record is deleted
	IsDeleted null.Bool `boil:"is_deleted" json:"is_deleted,omitempty" toml:"is_deleted" yaml:"is_deleted,omitempty"`

	R *personR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L personL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Person is an object representing the database table.

func FindPerson

func FindPerson(ctx context.Context, exec boil.ContextExecutor, iD uint64, selectCols ...string) (*Person, error)

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

func (*Person) Auth

func (o *Person) Auth(mods ...qm.QueryMod) authQuery

Auth pointed to by the foreign key.

func (*Person) Delete

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

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

func (*Person) Insert

func (o *Person) 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 (*Person) Reload

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

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

func (*Person) SetAuth

func (o *Person) SetAuth(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Auth) error

SetAuth of the person to the related item. Sets o.R.Auth to related. Adds o to related.R.Person.

func (*Person) Update

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

Update uses an executor to update the Person. 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 (*Person) Upsert

func (o *Person) Upsert(ctx context.Context, exec boil.ContextExecutor, 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 PersonHook

type PersonHook func(context.Context, boil.ContextExecutor, *Person) error

PersonHook is the signature for custom Person hook methods

type PersonSlice

type PersonSlice []*Person

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

func (PersonSlice) DeleteAll

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

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

func (*PersonSlice) ReloadAll

func (o *PersonSlice) 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 (PersonSlice) UpdateAll

func (o PersonSlice) 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