models

package
v0.0.0-...-699b961 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2025 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxPageSize = 65000
)

Variables

View Source
var (
	ClientAllColumns            = clientAllColumns
	ClientColumnsWithoutDefault = clientColumnsWithoutDefault
	ClientColumnsWithDefault    = clientColumnsWithDefault
	ClientPrimaryKeyColumns     = clientPrimaryKeyColumns
	ClientGeneratedColumns      = clientGeneratedColumns
)

/////////////////////////////// BEGIN EXTENSIONS ///////////////////////////////// Expose table columns

View Source
var (
	LogAllColumns            = logAllColumns
	LogColumnsWithoutDefault = logColumnsWithoutDefault
	LogColumnsWithDefault    = logColumnsWithDefault
	LogPrimaryKeyColumns     = logPrimaryKeyColumns
	LogGeneratedColumns      = logGeneratedColumns
)

/////////////////////////////// BEGIN EXTENSIONS ///////////////////////////////// Expose table columns

View Source
var (
	MessageAllColumns            = messageAllColumns
	MessageColumnsWithoutDefault = messageColumnsWithoutDefault
	MessageColumnsWithDefault    = messageColumnsWithDefault
	MessagePrimaryKeyColumns     = messagePrimaryKeyColumns
	MessageGeneratedColumns      = messageGeneratedColumns
)

/////////////////////////////// BEGIN EXTENSIONS ///////////////////////////////// Expose table columns

View Source
var (
	UserAllColumns            = userAllColumns
	UserColumnsWithoutDefault = userColumnsWithoutDefault
	UserColumnsWithDefault    = userColumnsWithDefault
	UserPrimaryKeyColumns     = userPrimaryKeyColumns
	UserGeneratedColumns      = userGeneratedColumns
)

/////////////////////////////// BEGIN EXTENSIONS ///////////////////////////////// Expose table columns

View Source
var ClientColumns = struct {
	ID           string
	FriendlyName string
	Primary      string
	Credentials  string
	Services     string
	Attributes   string
	Secondaries  string
	Owner        string
	ClientName   string
	Topics       string
}{
	ID:           "id",
	FriendlyName: "friendlyName",
	Primary:      "primary",
	Credentials:  "credentials",
	Services:     "services",
	Attributes:   "attributes",
	Secondaries:  "secondaries",
	Owner:        "owner",
	ClientName:   "clientName",
	Topics:       "topics",
}
View Source
var ClientRels = struct {
	Logs     string
	Messages string
}{
	Logs:     "Logs",
	Messages: "Messages",
}

ClientRels is where relationship names are stored.

View Source
var ClientTableColumns = struct {
	ID           string
	FriendlyName string
	Primary      string
	Credentials  string
	Services     string
	Attributes   string
	Secondaries  string
	Owner        string
	ClientName   string
	Topics       string
}{
	ID:           "clients.id",
	FriendlyName: "clients.friendlyName",
	Primary:      "clients.primary",
	Credentials:  "clients.credentials",
	Services:     "clients.services",
	Attributes:   "clients.attributes",
	Secondaries:  "clients.secondaries",
	Owner:        "clients.owner",
	ClientName:   "clients.clientName",
	Topics:       "clients.topics",
}
View Source
var ClientWhere = struct {
	ID           whereHelperstring
	FriendlyName whereHelpernull_String
	Primary      whereHelpernull_JSON
	Credentials  whereHelpernull_JSON
	Services     whereHelpernull_JSON
	Attributes   whereHelpernull_JSON
	Secondaries  whereHelpernull_JSON
	Owner        whereHelperstring
	ClientName   whereHelpernull_String
	Topics       whereHelpernull_JSON
}{
	ID:           whereHelperstring{/* contains filtered or unexported fields */},
	FriendlyName: whereHelpernull_String{/* contains filtered or unexported fields */},
	Primary:      whereHelpernull_JSON{/* contains filtered or unexported fields */},
	Credentials:  whereHelpernull_JSON{/* contains filtered or unexported fields */},
	Services:     whereHelpernull_JSON{/* contains filtered or unexported fields */},
	Attributes:   whereHelpernull_JSON{/* contains filtered or unexported fields */},
	Secondaries:  whereHelpernull_JSON{/* contains filtered or unexported fields */},
	Owner:        whereHelperstring{/* contains filtered or unexported fields */},
	ClientName:   whereHelpernull_String{/* contains filtered or unexported fields */},
	Topics:       whereHelpernull_JSON{/* contains filtered or unexported fields */},
}
View Source
var (
	DefaultPageSize = 1000
)
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 LogColumns = struct {
	ID        string
	Client    string
	Level     string
	Timestamp string
	Message   string
	Label     string
}{
	ID:        "id",
	Client:    "client",
	Level:     "level",
	Timestamp: "timestamp",
	Message:   "message",
	Label:     "label",
}
View Source
var LogRels = struct {
	LogClient string
}{
	LogClient: "LogClient",
}

LogRels is where relationship names are stored.

View Source
var LogTableColumns = struct {
	ID        string
	Client    string
	Level     string
	Timestamp string
	Message   string
	Label     string
}{
	ID:        "logs.id",
	Client:    "logs.client",
	Level:     "logs.level",
	Timestamp: "logs.timestamp",
	Message:   "logs.message",
	Label:     "logs.label",
}
View Source
var LogWhere = struct {
	ID        whereHelperint64
	Client    whereHelperstring
	Level     whereHelperstring
	Timestamp whereHelpernull_Time
	Message   whereHelpernull_String
	Label     whereHelpernull_String
}{
	ID:        whereHelperint64{/* contains filtered or unexported fields */},
	Client:    whereHelperstring{/* contains filtered or unexported fields */},
	Level:     whereHelperstring{/* contains filtered or unexported fields */},
	Timestamp: whereHelpernull_Time{/* contains filtered or unexported fields */},
	Message:   whereHelpernull_String{/* contains filtered or unexported fields */},
	Label:     whereHelpernull_String{/* contains filtered or unexported fields */},
}
View Source
var MessageColumns = struct {
	ID        string
	Client    string
	Topic     string
	Message   string
	Timestamp string
	Viewed    string
}{
	ID:        "id",
	Client:    "client",
	Topic:     "topic",
	Message:   "message",
	Timestamp: "timestamp",
	Viewed:    "viewed",
}
View Source
var MessageRels = struct {
	MessageClient string
}{
	MessageClient: "MessageClient",
}

MessageRels is where relationship names are stored.

View Source
var MessageTableColumns = struct {
	ID        string
	Client    string
	Topic     string
	Message   string
	Timestamp string
	Viewed    string
}{
	ID:        "messages.id",
	Client:    "messages.client",
	Topic:     "messages.topic",
	Message:   "messages.message",
	Timestamp: "messages.timestamp",
	Viewed:    "messages.viewed",
}
View Source
var MessageWhere = struct {
	ID        whereHelperint64
	Client    whereHelperstring
	Topic     whereHelperstring
	Message   whereHelpernull_JSON
	Timestamp whereHelpernull_Time
	Viewed    whereHelpernull_Bool
}{
	ID:        whereHelperint64{/* contains filtered or unexported fields */},
	Client:    whereHelperstring{/* contains filtered or unexported fields */},
	Topic:     whereHelperstring{/* contains filtered or unexported fields */},
	Message:   whereHelpernull_JSON{/* contains filtered or unexported fields */},
	Timestamp: whereHelpernull_Time{/* contains filtered or unexported fields */},
	Viewed:    whereHelpernull_Bool{/* contains filtered or unexported fields */},
}
View Source
var TableNames = struct {
	Clients  string
	Logs     string
	Messages string
	Users    string
}{
	Clients:  "clients",
	Logs:     "logs",
	Messages: "messages",
	Users:    "users",
}
View Source
var UserColumns = struct {
	User string
	Clid string
}{
	User: "user",
	Clid: "clid",
}
View Source
var UserRels = struct {
}{}

UserRels is where relationship names are stored.

View Source
var UserTableColumns = struct {
	User string
	Clid string
}{
	User: "users.user",
	Clid: "users.clid",
}
View Source
var UserWhere = struct {
	User whereHelperstring
	Clid whereHelperstring
}{
	User: whereHelperstring{/* contains filtered or unexported fields */},
	Clid: whereHelperstring{/* contains filtered or unexported fields */},
}
View Source
var ViewNames = struct {
}{}

Functions

func AddClientHook

func AddClientHook(hookPoint boil.HookPoint, clientHook ClientHook)

AddClientHook registers your hook function for all future operations.

func AddLogHook

func AddLogHook(hookPoint boil.HookPoint, logHook LogHook)

AddLogHook registers your hook function for all future operations.

func AddMessageHook

func AddMessageHook(hookPoint boil.HookPoint, messageHook MessageHook)

AddMessageHook 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 ClientExists

func ClientExists(ctx context.Context, exec boil.ContextExecutor, iD string) (bool, error)

ClientExists checks if the Client row exists.

func Clients

func Clients(mods ...qm.QueryMod) clientQuery

Clients retrieves all the records using an executor.

func LogExists

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

LogExists checks if the Log row exists.

func Logs

func Logs(mods ...qm.QueryMod) logQuery

Logs retrieves all the records using an executor.

func MessageExists

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

MessageExists checks if the Message row exists.

func Messages

func Messages(mods ...qm.QueryMod) messageQuery

Messages 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 SplitInChunks

func SplitInChunks[T any](slice []T) [][]T

func SplitInChunksBySize

func SplitInChunksBySize[T any](slice []T, chunkSize int) [][]T

func UserExists

func UserExists(ctx context.Context, exec boil.ContextExecutor, user string, clid string) (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 Client

type Client struct {
	ID           string      `boil:"id" json:"id" toml:"id" yaml:"id"`
	FriendlyName null.String `boil:"friendlyName" json:"friendlyName,omitempty" toml:"friendlyName" yaml:"friendlyName,omitempty"`
	Primary      null.JSON   `boil:"primary" json:"primary,omitempty" toml:"primary" yaml:"primary,omitempty"`
	Credentials  null.JSON   `boil:"credentials" json:"credentials,omitempty" toml:"credentials" yaml:"credentials,omitempty"`
	Services     null.JSON   `boil:"services" json:"services,omitempty" toml:"services" yaml:"services,omitempty"`
	Attributes   null.JSON   `boil:"attributes" json:"attributes,omitempty" toml:"attributes" yaml:"attributes,omitempty"`
	Secondaries  null.JSON   `boil:"secondaries" json:"secondaries,omitempty" toml:"secondaries" yaml:"secondaries,omitempty"`
	Owner        string      `boil:"owner" json:"owner" toml:"owner" yaml:"owner"`
	ClientName   null.String `boil:"clientName" json:"clientName,omitempty" toml:"clientName" yaml:"clientName,omitempty"`
	Topics       null.JSON   `boil:"topics" json:"topics,omitempty" toml:"topics" yaml:"topics,omitempty"`

	R *clientR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L clientL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Client is an object representing the database table.

func FindClient

func FindClient(ctx context.Context, exec boil.ContextExecutor, iD string, selectCols ...string) (*Client, error)

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

func (*Client) AddLogs

func (o *Client) AddLogs(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Log) error

AddLogs adds the given related objects to the existing relationships of the client, optionally inserting them as new records. Appends related to o.R.Logs. Sets related.R.LogClient appropriately.

func (*Client) AddMessages

func (o *Client) AddMessages(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Message) error

AddMessages adds the given related objects to the existing relationships of the client, optionally inserting them as new records. Appends related to o.R.Messages. Sets related.R.MessageClient appropriately.

func (*Client) Delete

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

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

func (*Client) Exists

func (o *Client) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error)

Exists checks if the Client row exists.

func (*Client) GetID

func (o *Client) GetID() string

GetID get ID from model object

func (*Client) Insert

func (o *Client) 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 (*Client) Logs

func (o *Client) Logs(mods ...qm.QueryMod) logQuery

Logs retrieves all the log's Logs with an executor.

func (*Client) Messages

func (o *Client) Messages(mods ...qm.QueryMod) messageQuery

Messages retrieves all the message's Messages with an executor.

func (*Client) Reload

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

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

func (*Client) Update

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

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

func (o *Client) 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 ClientHook

type ClientHook func(context.Context, boil.ContextExecutor, *Client) error

ClientHook is the signature for custom Client hook methods

type ClientSlice

type ClientSlice []*Client

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

func (ClientSlice) DeleteAll

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

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

func (ClientSlice) DeleteAllByPage

func (s ClientSlice) DeleteAllByPage(ctx context.Context, exec boil.ContextExecutor, limits ...int) (int64, error)

DeleteAllByPage delete all Client records from the slice. This function deletes data by pages to avoid exceeding Postgres limitation (max parameters: 65535)

func (ClientSlice) FindItemByID

func (s ClientSlice) FindItemByID(id string) *Client

FindItemByID find item by ID in the slice

func (ClientSlice) FindMissingItemIDs

func (s ClientSlice) FindMissingItemIDs(expectedIDs []string) []string

FindMissingItemIDs find all item IDs that are not in the list NOTE: the input ID slice should contain unique values

func (ClientSlice) GetIDs

func (s ClientSlice) GetIDs() []string

GetIDs extract IDs from model objects

func (ClientSlice) GetIntfIDs

func (s ClientSlice) GetIntfIDs() []interface{}

GetIntfIDs extract IDs from model objects as interface slice

func (ClientSlice) GetLoadedLogs

func (s ClientSlice) GetLoadedLogs() LogSlice

func (ClientSlice) GetLoadedMessages

func (s ClientSlice) GetLoadedMessages() MessageSlice

func (ClientSlice) InsertAll

func (o ClientSlice) InsertAll(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)

InsertAll inserts all rows with the specified column values, using an executor. IMPORTANT: this will calculate the widest columns from all items in the slice, be careful if you want to use default column values

func (ClientSlice) InsertAllByPage

func (s ClientSlice) InsertAllByPage(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns, limits ...int) (int64, error)

InsertAllByPage insert all Client records from the slice. This function inserts data by pages to avoid exceeding Postgres limitation (max parameters: 65535)

func (ClientSlice) InsertIgnoreAll

func (o ClientSlice) InsertIgnoreAll(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)

InsertIgnoreAll inserts all rows with ignoring the existing ones having the same primary key values. NOTE: This function calls UpsertAll() with updateOnConflict=false and conflictColumns=<primary key columns> IMPORTANT: this will calculate the widest columns from all items in the slice, be careful if you want to use default column values IMPORTANT: if the table has `id` column of auto-increment type, this may not work as expected

func (ClientSlice) InsertIgnoreAllByPage

func (s ClientSlice) InsertIgnoreAllByPage(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns, limits ...int) (int64, error)

InsertIgnoreAllByPage insert all Client records from the slice. This function inserts data by pages to avoid exceeding Postgres limitation (max parameters: 65535)

func (ClientSlice) LoadLogsByPage

func (s ClientSlice) LoadLogsByPage(ctx context.Context, e boil.ContextExecutor, mods ...qm.QueryMod) error

LoadLogsByPage performs eager loading of values by page. This is for a 1-M or N-M relationship.

func (ClientSlice) LoadLogsByPageEx

func (s ClientSlice) LoadLogsByPageEx(ctx context.Context, e boil.ContextExecutor, pageSize int, mods ...qm.QueryMod) error

func (ClientSlice) LoadMessagesByPage

func (s ClientSlice) LoadMessagesByPage(ctx context.Context, e boil.ContextExecutor, mods ...qm.QueryMod) error

LoadMessagesByPage performs eager loading of values by page. This is for a 1-M or N-M relationship.

func (ClientSlice) LoadMessagesByPageEx

func (s ClientSlice) LoadMessagesByPageEx(ctx context.Context, e boil.ContextExecutor, pageSize int, mods ...qm.QueryMod) error

func (*ClientSlice) ReloadAll

func (o *ClientSlice) 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 (ClientSlice) ToIDMap

func (s ClientSlice) ToIDMap() map[string]*Client

ToIDMap convert a slice of model objects to a map with ID as key

func (ClientSlice) ToUniqueItems

func (s ClientSlice) ToUniqueItems() ClientSlice

ToUniqueItems construct a slice of unique items from the given slice

func (ClientSlice) UpdateAll

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

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

func (ClientSlice) UpdateAllByPage

func (s ClientSlice) UpdateAllByPage(ctx context.Context, exec boil.ContextExecutor, cols M, limits ...int) (int64, error)

UpdateAllByPage update all Client records from the slice. This function updates data by pages to avoid exceeding Postgres limitation (max parameters: 65535)

func (ClientSlice) UpsertAll

func (o ClientSlice) UpsertAll(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns) (int64, error)

UpsertAll inserts or updates all rows Currently it doesn't support "NoContext" and "NoRowsAffected" IMPORTANT: this will calculate the widest columns from all items in the slice, be careful if you want to use default column values IMPORTANT: if the table has `id` column of auto-increment type, this may not work as expected

func (ClientSlice) UpsertAllByPage

func (s ClientSlice) UpsertAllByPage(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns, limits ...int) (int64, error)

UpsertAllByPage upsert all Client records from the slice. This function upserts data by pages to avoid exceeding Postgres limitation (max parameters: 65535)

type Log

type Log struct {
	ID        int64       `boil:"id" json:"id" toml:"id" yaml:"id"`
	Client    string      `boil:"client" json:"client" toml:"client" yaml:"client"`
	Level     string      `boil:"level" json:"level" toml:"level" yaml:"level"`
	Timestamp null.Time   `boil:"timestamp" json:"timestamp,omitempty" toml:"timestamp" yaml:"timestamp,omitempty"`
	Message   null.String `boil:"message" json:"message,omitempty" toml:"message" yaml:"message,omitempty"`
	Label     null.String `boil:"label" json:"label,omitempty" toml:"label" yaml:"label,omitempty"`

	R *logR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L logL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Log is an object representing the database table.

func FindLog

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

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

func (*Log) Delete

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

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

func (*Log) Exists

func (o *Log) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error)

Exists checks if the Log row exists.

func (*Log) GetID

func (o *Log) GetID() int64

GetID get ID from model object

func (*Log) Insert

func (o *Log) 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 (*Log) LogClient

func (o *Log) LogClient(mods ...qm.QueryMod) clientQuery

LogClient pointed to by the foreign key.

func (*Log) Reload

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

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

func (*Log) SetLogClient

func (o *Log) SetLogClient(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Client) error

SetLogClient of the log to the related item. Sets o.R.LogClient to related. Adds o to related.R.Logs.

func (*Log) Update

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

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

func (o *Log) 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 LogHook

type LogHook func(context.Context, boil.ContextExecutor, *Log) error

LogHook is the signature for custom Log hook methods

type LogSlice

type LogSlice []*Log

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

func (LogSlice) DeleteAll

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

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

func (LogSlice) DeleteAllByPage

func (s LogSlice) DeleteAllByPage(ctx context.Context, exec boil.ContextExecutor, limits ...int) (int64, error)

DeleteAllByPage delete all Log records from the slice. This function deletes data by pages to avoid exceeding Postgres limitation (max parameters: 65535)

func (LogSlice) FindItemByID

func (s LogSlice) FindItemByID(id int64) *Log

FindItemByID find item by ID in the slice

func (LogSlice) FindMissingItemIDs

func (s LogSlice) FindMissingItemIDs(expectedIDs []int64) []int64

FindMissingItemIDs find all item IDs that are not in the list NOTE: the input ID slice should contain unique values

func (LogSlice) GetIDs

func (s LogSlice) GetIDs() []int64

GetIDs extract IDs from model objects

func (LogSlice) GetIntfIDs

func (s LogSlice) GetIntfIDs() []interface{}

GetIntfIDs extract IDs from model objects as interface slice

func (LogSlice) GetLoadedLogClients

func (s LogSlice) GetLoadedLogClients() ClientSlice

func (LogSlice) InsertAll

func (o LogSlice) InsertAll(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)

InsertAll inserts all rows with the specified column values, using an executor. IMPORTANT: this will calculate the widest columns from all items in the slice, be careful if you want to use default column values

func (LogSlice) InsertAllByPage

func (s LogSlice) InsertAllByPage(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns, limits ...int) (int64, error)

InsertAllByPage insert all Log records from the slice. This function inserts data by pages to avoid exceeding Postgres limitation (max parameters: 65535)

func (LogSlice) InsertIgnoreAll

func (o LogSlice) InsertIgnoreAll(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)

InsertIgnoreAll inserts all rows with ignoring the existing ones having the same primary key values. NOTE: This function calls UpsertAll() with updateOnConflict=false and conflictColumns=<primary key columns> IMPORTANT: this will calculate the widest columns from all items in the slice, be careful if you want to use default column values IMPORTANT: if the table has `id` column of auto-increment type, this may not work as expected

func (LogSlice) InsertIgnoreAllByPage

func (s LogSlice) InsertIgnoreAllByPage(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns, limits ...int) (int64, error)

InsertIgnoreAllByPage insert all Log records from the slice. This function inserts data by pages to avoid exceeding Postgres limitation (max parameters: 65535)

func (LogSlice) LoadLogClientsByPage

func (s LogSlice) LoadLogClientsByPage(ctx context.Context, e boil.ContextExecutor, mods ...qm.QueryMod) error

LoadLogClientsByPage performs eager loading of values by page. This is for a N-1 relationship.

func (LogSlice) LoadLogClientsByPageEx

func (s LogSlice) LoadLogClientsByPageEx(ctx context.Context, e boil.ContextExecutor, pageSize int, mods ...qm.QueryMod) error

func (*LogSlice) ReloadAll

func (o *LogSlice) 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 (LogSlice) ToIDMap

func (s LogSlice) ToIDMap() map[int64]*Log

ToIDMap convert a slice of model objects to a map with ID as key

func (LogSlice) ToUniqueItems

func (s LogSlice) ToUniqueItems() LogSlice

ToUniqueItems construct a slice of unique items from the given slice

func (LogSlice) UpdateAll

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

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

func (LogSlice) UpdateAllByPage

func (s LogSlice) UpdateAllByPage(ctx context.Context, exec boil.ContextExecutor, cols M, limits ...int) (int64, error)

UpdateAllByPage update all Log records from the slice. This function updates data by pages to avoid exceeding Postgres limitation (max parameters: 65535)

func (LogSlice) UpsertAll

func (o LogSlice) UpsertAll(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns) (int64, error)

UpsertAll inserts or updates all rows Currently it doesn't support "NoContext" and "NoRowsAffected" IMPORTANT: this will calculate the widest columns from all items in the slice, be careful if you want to use default column values IMPORTANT: if the table has `id` column of auto-increment type, this may not work as expected

func (LogSlice) UpsertAllByPage

func (s LogSlice) UpsertAllByPage(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns, limits ...int) (int64, error)

UpsertAllByPage upsert all Log records from the slice. This function upserts data by pages to avoid exceeding Postgres limitation (max parameters: 65535)

type M

type M map[string]interface{}

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

type Message

type Message struct {
	ID        int64     `boil:"id" json:"id" toml:"id" yaml:"id"`
	Client    string    `boil:"client" json:"client" toml:"client" yaml:"client"`
	Topic     string    `boil:"topic" json:"topic" toml:"topic" yaml:"topic"`
	Message   null.JSON `boil:"message" json:"message,omitempty" toml:"message" yaml:"message,omitempty"`
	Timestamp null.Time `boil:"timestamp" json:"timestamp,omitempty" toml:"timestamp" yaml:"timestamp,omitempty"`
	Viewed    null.Bool `boil:"viewed" json:"viewed,omitempty" toml:"viewed" yaml:"viewed,omitempty"`

	R *messageR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L messageL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Message is an object representing the database table.

func FindMessage

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

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

func (*Message) Delete

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

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

func (*Message) Exists

func (o *Message) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error)

Exists checks if the Message row exists.

func (*Message) GetID

func (o *Message) GetID() int64

GetID get ID from model object

func (*Message) Insert

func (o *Message) 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 (*Message) MessageClient

func (o *Message) MessageClient(mods ...qm.QueryMod) clientQuery

MessageClient pointed to by the foreign key.

func (*Message) Reload

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

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

func (*Message) SetMessageClient

func (o *Message) SetMessageClient(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Client) error

SetMessageClient of the message to the related item. Sets o.R.MessageClient to related. Adds o to related.R.Messages.

func (*Message) Update

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

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

func (o *Message) 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 MessageHook

type MessageHook func(context.Context, boil.ContextExecutor, *Message) error

MessageHook is the signature for custom Message hook methods

type MessageSlice

type MessageSlice []*Message

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

func (MessageSlice) DeleteAll

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

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

func (MessageSlice) DeleteAllByPage

func (s MessageSlice) DeleteAllByPage(ctx context.Context, exec boil.ContextExecutor, limits ...int) (int64, error)

DeleteAllByPage delete all Message records from the slice. This function deletes data by pages to avoid exceeding Postgres limitation (max parameters: 65535)

func (MessageSlice) FindItemByID

func (s MessageSlice) FindItemByID(id int64) *Message

FindItemByID find item by ID in the slice

func (MessageSlice) FindMissingItemIDs

func (s MessageSlice) FindMissingItemIDs(expectedIDs []int64) []int64

FindMissingItemIDs find all item IDs that are not in the list NOTE: the input ID slice should contain unique values

func (MessageSlice) GetIDs

func (s MessageSlice) GetIDs() []int64

GetIDs extract IDs from model objects

func (MessageSlice) GetIntfIDs

func (s MessageSlice) GetIntfIDs() []interface{}

GetIntfIDs extract IDs from model objects as interface slice

func (MessageSlice) GetLoadedMessageClients

func (s MessageSlice) GetLoadedMessageClients() ClientSlice

func (MessageSlice) InsertAll

func (o MessageSlice) InsertAll(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)

InsertAll inserts all rows with the specified column values, using an executor. IMPORTANT: this will calculate the widest columns from all items in the slice, be careful if you want to use default column values

func (MessageSlice) InsertAllByPage

func (s MessageSlice) InsertAllByPage(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns, limits ...int) (int64, error)

InsertAllByPage insert all Message records from the slice. This function inserts data by pages to avoid exceeding Postgres limitation (max parameters: 65535)

func (MessageSlice) InsertIgnoreAll

func (o MessageSlice) InsertIgnoreAll(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)

InsertIgnoreAll inserts all rows with ignoring the existing ones having the same primary key values. NOTE: This function calls UpsertAll() with updateOnConflict=false and conflictColumns=<primary key columns> IMPORTANT: this will calculate the widest columns from all items in the slice, be careful if you want to use default column values IMPORTANT: if the table has `id` column of auto-increment type, this may not work as expected

func (MessageSlice) InsertIgnoreAllByPage

func (s MessageSlice) InsertIgnoreAllByPage(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns, limits ...int) (int64, error)

InsertIgnoreAllByPage insert all Message records from the slice. This function inserts data by pages to avoid exceeding Postgres limitation (max parameters: 65535)

func (MessageSlice) LoadMessageClientsByPage

func (s MessageSlice) LoadMessageClientsByPage(ctx context.Context, e boil.ContextExecutor, mods ...qm.QueryMod) error

LoadMessageClientsByPage performs eager loading of values by page. This is for a N-1 relationship.

func (MessageSlice) LoadMessageClientsByPageEx

func (s MessageSlice) LoadMessageClientsByPageEx(ctx context.Context, e boil.ContextExecutor, pageSize int, mods ...qm.QueryMod) error

func (*MessageSlice) ReloadAll

func (o *MessageSlice) 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 (MessageSlice) ToIDMap

func (s MessageSlice) ToIDMap() map[int64]*Message

ToIDMap convert a slice of model objects to a map with ID as key

func (MessageSlice) ToUniqueItems

func (s MessageSlice) ToUniqueItems() MessageSlice

ToUniqueItems construct a slice of unique items from the given slice

func (MessageSlice) UpdateAll

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

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

func (MessageSlice) UpdateAllByPage

func (s MessageSlice) UpdateAllByPage(ctx context.Context, exec boil.ContextExecutor, cols M, limits ...int) (int64, error)

UpdateAllByPage update all Message records from the slice. This function updates data by pages to avoid exceeding Postgres limitation (max parameters: 65535)

func (MessageSlice) UpsertAll

func (o MessageSlice) UpsertAll(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns) (int64, error)

UpsertAll inserts or updates all rows Currently it doesn't support "NoContext" and "NoRowsAffected" IMPORTANT: this will calculate the widest columns from all items in the slice, be careful if you want to use default column values IMPORTANT: if the table has `id` column of auto-increment type, this may not work as expected

func (MessageSlice) UpsertAllByPage

func (s MessageSlice) UpsertAllByPage(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns, limits ...int) (int64, error)

UpsertAllByPage upsert all Message records from the slice. This function upserts data by pages to avoid exceeding Postgres limitation (max parameters: 65535)

type User

type User struct {
	User string `boil:"user" json:"user" toml:"user" yaml:"user"`
	Clid string `boil:"clid" json:"clid" toml:"clid" yaml:"clid"`

	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, user string, clid string, 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(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) Exists

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

Exists checks if the User row exists.

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) 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) 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 UserHook

type UserHook func(context.Context, boil.ContextExecutor, *User) error

UserHook is the signature for custom User hook methods

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) DeleteAllByPage

func (s UserSlice) DeleteAllByPage(ctx context.Context, exec boil.ContextExecutor, limits ...int) (int64, error)

DeleteAllByPage delete all User records from the slice. This function deletes data by pages to avoid exceeding Postgres limitation (max parameters: 65535)

func (UserSlice) InsertAll

func (o UserSlice) InsertAll(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)

InsertAll inserts all rows with the specified column values, using an executor. IMPORTANT: this will calculate the widest columns from all items in the slice, be careful if you want to use default column values

func (UserSlice) InsertAllByPage

func (s UserSlice) InsertAllByPage(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns, limits ...int) (int64, error)

InsertAllByPage insert all User records from the slice. This function inserts data by pages to avoid exceeding Postgres limitation (max parameters: 65535)

func (UserSlice) InsertIgnoreAll

func (o UserSlice) InsertIgnoreAll(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)

InsertIgnoreAll inserts all rows with ignoring the existing ones having the same primary key values. NOTE: This function calls UpsertAll() with updateOnConflict=false and conflictColumns=<primary key columns> IMPORTANT: this will calculate the widest columns from all items in the slice, be careful if you want to use default column values IMPORTANT: if the table has `id` column of auto-increment type, this may not work as expected

func (UserSlice) InsertIgnoreAllByPage

func (s UserSlice) InsertIgnoreAllByPage(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns, limits ...int) (int64, error)

InsertIgnoreAllByPage insert all User records from the slice. This function inserts data by pages to avoid exceeding Postgres limitation (max parameters: 65535)

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.

func (UserSlice) UpdateAllByPage

func (s UserSlice) UpdateAllByPage(ctx context.Context, exec boil.ContextExecutor, cols M, limits ...int) (int64, error)

UpdateAllByPage update all User records from the slice. This function updates data by pages to avoid exceeding Postgres limitation (max parameters: 65535)

func (UserSlice) UpsertAll

func (o UserSlice) UpsertAll(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns) (int64, error)

UpsertAll inserts or updates all rows Currently it doesn't support "NoContext" and "NoRowsAffected" IMPORTANT: this will calculate the widest columns from all items in the slice, be careful if you want to use default column values IMPORTANT: if the table has `id` column of auto-increment type, this may not work as expected

func (UserSlice) UpsertAllByPage

func (s UserSlice) UpsertAllByPage(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns, limits ...int) (int64, error)

UpsertAllByPage upsert all User records from the slice. This function upserts data by pages to avoid exceeding Postgres limitation (max parameters: 65535)

Jump to

Keyboard shortcuts

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