models

package
v0.0.0-...-4dcdfb1 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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 SettingColumns = struct {
	Key   string
	Value string
}{
	Key:   "key",
	Value: "value",
}
View Source
var SettingRels = struct {
}{}

SettingRels is where relationship names are stored.

View Source
var SettingTableColumns = struct {
	Key   string
	Value string
}{
	Key:   "settings.key",
	Value: "settings.value",
}
View Source
var SettingWhere = struct {
	Key   whereHelpernull_String
	Value whereHelpernull_String
}{
	Key:   whereHelpernull_String{/* contains filtered or unexported fields */},
	Value: whereHelpernull_String{/* contains filtered or unexported fields */},
}
View Source
var TableNames = struct {
	Settings    string
	UserLinks   string
	UserSession string
	Users       string
}{
	Settings:    "settings",
	UserLinks:   "user_links",
	UserSession: "user_session",
	Users:       "users",
}
View Source
var UserColumns = struct {
	ID   string
	Name string
}{
	ID:   "id",
	Name: "name",
}
View Source
var UserLinkColumns = struct {
	LinkID   string
	UserID   string
	Category string
	Hidden   string
	Link     string
	Headline string
	Added    string
}{
	LinkID:   "link_id",
	UserID:   "user_id",
	Category: "category",
	Hidden:   "hidden",
	Link:     "link",
	Headline: "headline",
	Added:    "added",
}
View Source
var UserLinkRels = struct {
}{}

UserLinkRels is where relationship names are stored.

View Source
var UserLinkTableColumns = struct {
	LinkID   string
	UserID   string
	Category string
	Hidden   string
	Link     string
	Headline string
	Added    string
}{
	LinkID:   "user_links.link_id",
	UserID:   "user_links.user_id",
	Category: "user_links.category",
	Hidden:   "user_links.hidden",
	Link:     "user_links.link",
	Headline: "user_links.headline",
	Added:    "user_links.added",
}
View Source
var UserLinkWhere = struct {
	LinkID   whereHelperstring
	UserID   whereHelperint64
	Category whereHelperstring
	Hidden   whereHelperbool
	Link     whereHelperstring
	Headline whereHelperstring
	Added    whereHelpertime_Time
}{
	LinkID:   whereHelperstring{/* contains filtered or unexported fields */},
	UserID:   whereHelperint64{/* contains filtered or unexported fields */},
	Category: whereHelperstring{/* contains filtered or unexported fields */},
	Hidden:   whereHelperbool{/* contains filtered or unexported fields */},
	Link:     whereHelperstring{/* contains filtered or unexported fields */},
	Headline: whereHelperstring{/* contains filtered or unexported fields */},
	Added:    whereHelpertime_Time{/* contains filtered or unexported fields */},
}
View Source
var UserRels = struct {
}{}

UserRels is where relationship names are stored.

View Source
var UserSessionColumns = struct {
	UserID         string
	ChatID         string
	LastUserAction string
	Data           string
}{
	UserID:         "user_id",
	ChatID:         "chat_id",
	LastUserAction: "last_user_action",
	Data:           "data",
}
View Source
var UserSessionRels = struct {
}{}

UserSessionRels is where relationship names are stored.

View Source
var UserSessionTableColumns = struct {
	UserID         string
	ChatID         string
	LastUserAction string
	Data           string
}{
	UserID:         "user_session.user_id",
	ChatID:         "user_session.chat_id",
	LastUserAction: "user_session.last_user_action",
	Data:           "user_session.data",
}
View Source
var UserSessionWhere = struct {
	UserID         whereHelperint64
	ChatID         whereHelperint64
	LastUserAction whereHelpernull_Time
	Data           whereHelpernull_String
}{
	UserID:         whereHelperint64{/* contains filtered or unexported fields */},
	ChatID:         whereHelperint64{/* contains filtered or unexported fields */},
	LastUserAction: whereHelpernull_Time{/* contains filtered or unexported fields */},
	Data:           whereHelpernull_String{/* contains filtered or unexported fields */},
}
View Source
var UserTableColumns = struct {
	ID   string
	Name string
}{
	ID:   "users.id",
	Name: "users.name",
}
View Source
var UserWhere = struct {
	ID   whereHelperint64
	Name whereHelperstring
}{
	ID:   whereHelperint64{/* contains filtered or unexported fields */},
	Name: whereHelperstring{/* contains filtered or unexported fields */},
}
View Source
var ViewNames = struct {
}{}

Functions

func AddSettingHook

func AddSettingHook(hookPoint boil.HookPoint, settingHook SettingHook)

AddSettingHook registers your hook function for all future operations.

func AddUserHook

func AddUserHook(hookPoint boil.HookPoint, userHook UserHook)

AddUserHook registers your hook function for all future operations.

func AddUserLinkHook

func AddUserLinkHook(hookPoint boil.HookPoint, userLinkHook UserLinkHook)

AddUserLinkHook registers your hook function for all future operations.

func AddUserSessionHook

func AddUserSessionHook(hookPoint boil.HookPoint, userSessionHook UserSessionHook)

AddUserSessionHook registers your hook function for all future operations.

func NewQuery

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

NewQuery initializes a new Query using the passed in QueryMods

func SettingExists

func SettingExists(exec boil.Executor, key null.String) (bool, error)

SettingExists checks if the Setting row exists.

func Settings

func Settings(mods ...qm.QueryMod) settingQuery

Settings retrieves all the records using an executor.

func UserExists

func UserExists(exec boil.Executor, iD int64) (bool, error)

UserExists checks if the User row exists.

func UserLinkExists

func UserLinkExists(exec boil.Executor, linkID string) (bool, error)

UserLinkExists checks if the UserLink row exists.

func UserLinks(mods ...qm.QueryMod) userLinkQuery

UserLinks retrieves all the records using an executor.

func UserSessionExists

func UserSessionExists(exec boil.Executor, userID int64) (bool, error)

UserSessionExists checks if the UserSession row exists.

func UserSessions

func UserSessions(mods ...qm.QueryMod) userSessionQuery

UserSessions retrieves all the records using an executor.

func Users

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

Users retrieves all the records using an executor.

Types

type M

type M map[string]interface{}

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

type Setting

type Setting struct {
	Key   null.String `boil:"key" json:"key,omitempty" toml:"key" yaml:"key,omitempty"`
	Value null.String `boil:"value" json:"value,omitempty" toml:"value" yaml:"value,omitempty"`

	R *settingR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L settingL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Setting is an object representing the database table.

func FindSetting

func FindSetting(exec boil.Executor, key null.String, selectCols ...string) (*Setting, error)

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

func (*Setting) Delete

func (o *Setting) Delete(exec boil.Executor) error

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

func (*Setting) Exists

func (o *Setting) Exists(exec boil.Executor) (bool, error)

Exists checks if the Setting row exists.

func (*Setting) Insert

func (o *Setting) Insert(exec boil.Executor, columns boil.Columns) error

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

func (*Setting) Reload

func (o *Setting) Reload(exec boil.Executor) error

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

func (*Setting) Update

func (o *Setting) Update(exec boil.Executor, columns boil.Columns) error

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

func (o *Setting) Upsert(exec boil.Executor, 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 SettingHook

type SettingHook func(boil.Executor, *Setting) error

SettingHook is the signature for custom Setting hook methods

type SettingSlice

type SettingSlice []*Setting

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

func (SettingSlice) DeleteAll

func (o SettingSlice) DeleteAll(exec boil.Executor) error

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

func (*SettingSlice) ReloadAll

func (o *SettingSlice) ReloadAll(exec boil.Executor) error

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

func (SettingSlice) UpdateAll

func (o SettingSlice) UpdateAll(exec boil.Executor, cols M) 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"`
	Name string `boil:"name" json:"name" toml:"name" yaml:"name"`

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

User is an object representing the database table.

func FindUser

func FindUser(exec boil.Executor, 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) Delete

func (o *User) Delete(exec boil.Executor) 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) Exists

func (o *User) Exists(exec boil.Executor) (bool, error)

Exists checks if the User row exists.

func (*User) Insert

func (o *User) Insert(exec boil.Executor, 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) Reload

func (o *User) Reload(exec boil.Executor) error

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

func (*User) Update

func (o *User) Update(exec boil.Executor, columns boil.Columns) 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(exec boil.Executor, 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 UserHook

type UserHook func(boil.Executor, *User) error

UserHook is the signature for custom User hook methods

type UserLink struct {
	LinkID   string    `boil:"link_id" json:"link_id" toml:"link_id" yaml:"link_id"`
	UserID   int64     `boil:"user_id" json:"user_id" toml:"user_id" yaml:"user_id"`
	Category string    `boil:"category" json:"category" toml:"category" yaml:"category"`
	Hidden   bool      `boil:"hidden" json:"hidden" toml:"hidden" yaml:"hidden"`
	Link     string    `boil:"link" json:"link" toml:"link" yaml:"link"`
	Headline string    `boil:"headline" json:"headline" toml:"headline" yaml:"headline"`
	Added    time.Time `boil:"added" json:"added" toml:"added" yaml:"added"`

	R *userLinkR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L userLinkL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

UserLink is an object representing the database table.

func FindUserLink(exec boil.Executor, linkID string, selectCols ...string) (*UserLink, error)

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

func (*UserLink) Delete

func (o *UserLink) Delete(exec boil.Executor) error

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

func (*UserLink) Exists

func (o *UserLink) Exists(exec boil.Executor) (bool, error)

Exists checks if the UserLink row exists.

func (*UserLink) Insert

func (o *UserLink) Insert(exec boil.Executor, columns boil.Columns) error

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

func (*UserLink) Reload

func (o *UserLink) Reload(exec boil.Executor) error

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

func (*UserLink) Update

func (o *UserLink) Update(exec boil.Executor, columns boil.Columns) error

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

func (o *UserLink) Upsert(exec boil.Executor, 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 UserLinkHook

type UserLinkHook func(boil.Executor, *UserLink) error

UserLinkHook is the signature for custom UserLink hook methods

type UserLinkSlice

type UserLinkSlice []*UserLink

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

func (UserLinkSlice) DeleteAll

func (o UserLinkSlice) DeleteAll(exec boil.Executor) error

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

func (*UserLinkSlice) ReloadAll

func (o *UserLinkSlice) ReloadAll(exec boil.Executor) error

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

func (UserLinkSlice) UpdateAll

func (o UserLinkSlice) UpdateAll(exec boil.Executor, cols M) error

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

type UserSession

type UserSession struct {
	UserID         int64       `boil:"user_id" json:"user_id" toml:"user_id" yaml:"user_id"`
	ChatID         int64       `boil:"chat_id" json:"chat_id" toml:"chat_id" yaml:"chat_id"`
	LastUserAction null.Time   `boil:"last_user_action" json:"last_user_action,omitempty" toml:"last_user_action" yaml:"last_user_action,omitempty"`
	Data           null.String `boil:"data" json:"data,omitempty" toml:"data" yaml:"data,omitempty"`

	R *userSessionR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L userSessionL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

UserSession is an object representing the database table.

func FindUserSession

func FindUserSession(exec boil.Executor, userID int64, selectCols ...string) (*UserSession, error)

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

func (*UserSession) Delete

func (o *UserSession) Delete(exec boil.Executor) error

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

func (*UserSession) Exists

func (o *UserSession) Exists(exec boil.Executor) (bool, error)

Exists checks if the UserSession row exists.

func (*UserSession) Insert

func (o *UserSession) Insert(exec boil.Executor, columns boil.Columns) error

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

func (*UserSession) Reload

func (o *UserSession) Reload(exec boil.Executor) error

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

func (*UserSession) Update

func (o *UserSession) Update(exec boil.Executor, columns boil.Columns) error

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

func (o *UserSession) Upsert(exec boil.Executor, 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 UserSessionHook

type UserSessionHook func(boil.Executor, *UserSession) error

UserSessionHook is the signature for custom UserSession hook methods

type UserSessionSlice

type UserSessionSlice []*UserSession

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

func (UserSessionSlice) DeleteAll

func (o UserSessionSlice) DeleteAll(exec boil.Executor) error

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

func (*UserSessionSlice) ReloadAll

func (o *UserSessionSlice) ReloadAll(exec boil.Executor) error

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

func (UserSessionSlice) UpdateAll

func (o UserSessionSlice) UpdateAll(exec boil.Executor, cols M) error

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

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(exec boil.Executor) error

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

func (*UserSlice) ReloadAll

func (o *UserSlice) ReloadAll(exec boil.Executor) 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(exec boil.Executor, cols M) 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