models

package
v0.0.0-...-64253c3 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ChannelColumns = struct {
	ChannelID string
	Name      string
	CreatedAt string
	UpdatedAt string
}{
	ChannelID: "channel_id",
	Name:      "name",
	CreatedAt: "created_at",
	UpdatedAt: "updated_at",
}
View Source
var ChannelRels = struct {
	FollowedChannels string
}{
	FollowedChannels: "FollowedChannels",
}

ChannelRels is where relationship names are stored.

View Source
var ChannelWhere = struct {
	ChannelID whereHelperstring
	Name      whereHelperstring
	CreatedAt whereHelpertime_Time
	UpdatedAt whereHelpertime_Time
}{
	ChannelID: whereHelperstring{/* contains filtered or unexported fields */},
	Name:      whereHelperstring{/* contains filtered or unexported fields */},
	CreatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */},
	UpdatedAt: whereHelpertime_Time{/* 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 FollowedChannelColumns = struct {
	FollowedChannelID string
	ListenerID        string
	ChannelID         string
	CreatedAt         string
	UpdatedAt         string
}{
	FollowedChannelID: "followed_channel_id",
	ListenerID:        "listener_id",
	ChannelID:         "channel_id",
	CreatedAt:         "created_at",
	UpdatedAt:         "updated_at",
}
View Source
var FollowedChannelRels = struct {
	Channel  string
	Listener string
}{
	Channel:  "Channel",
	Listener: "Listener",
}

FollowedChannelRels is where relationship names are stored.

View Source
var FollowedChannelWhere = struct {
	FollowedChannelID whereHelperint
	ListenerID        whereHelperstring
	ChannelID         whereHelperstring
	CreatedAt         whereHelpertime_Time
	UpdatedAt         whereHelpertime_Time
}{
	FollowedChannelID: whereHelperint{/* contains filtered or unexported fields */},
	ListenerID:        whereHelperstring{/* contains filtered or unexported fields */},
	ChannelID:         whereHelperstring{/* contains filtered or unexported fields */},
	CreatedAt:         whereHelpertime_Time{/* contains filtered or unexported fields */},
	UpdatedAt:         whereHelpertime_Time{/* contains filtered or unexported fields */},
}
View Source
var ListenerColumns = struct {
	ListenerID string
	Name       string
	CreatedAt  string
	UpdatedAt  string
}{
	ListenerID: "listener_id",
	Name:       "name",
	CreatedAt:  "created_at",
	UpdatedAt:  "updated_at",
}
View Source
var ListenerRels = struct {
	FollowedChannels string
}{
	FollowedChannels: "FollowedChannels",
}

ListenerRels is where relationship names are stored.

View Source
var ListenerWhere = struct {
	ListenerID whereHelperstring
	Name       whereHelperstring
	CreatedAt  whereHelpertime_Time
	UpdatedAt  whereHelpertime_Time
}{
	ListenerID: whereHelperstring{/* contains filtered or unexported fields */},
	Name:       whereHelperstring{/* contains filtered or unexported fields */},
	CreatedAt:  whereHelpertime_Time{/* contains filtered or unexported fields */},
	UpdatedAt:  whereHelpertime_Time{/* contains filtered or unexported fields */},
}
View Source
var TableNames = struct {
	Channels         string
	FollowedChannels string
	Listeners        string
}{
	Channels:         "channels",
	FollowedChannels: "followed_channels",
	Listeners:        "listeners",
}

Functions

func AddChannelHook

func AddChannelHook(hookPoint boil.HookPoint, channelHook ChannelHook)

AddChannelHook registers your hook function for all future operations.

func AddFollowedChannelHook

func AddFollowedChannelHook(hookPoint boil.HookPoint, followedChannelHook FollowedChannelHook)

AddFollowedChannelHook registers your hook function for all future operations.

func AddListenerHook

func AddListenerHook(hookPoint boil.HookPoint, listenerHook ListenerHook)

AddListenerHook registers your hook function for all future operations.

func ChannelExists

func ChannelExists(ctx context.Context, exec boil.ContextExecutor, channelID string) (bool, error)

ChannelExists checks if the Channel row exists.

func Channels

func Channels(mods ...qm.QueryMod) channelQuery

Channels retrieves all the records using an executor.

func FollowedChannelExists

func FollowedChannelExists(ctx context.Context, exec boil.ContextExecutor, followedChannelID int) (bool, error)

FollowedChannelExists checks if the FollowedChannel row exists.

func FollowedChannels

func FollowedChannels(mods ...qm.QueryMod) followedChannelQuery

FollowedChannels retrieves all the records using an executor.

func ListenerExists

func ListenerExists(ctx context.Context, exec boil.ContextExecutor, listenerID string) (bool, error)

ListenerExists checks if the Listener row exists.

func Listeners

func Listeners(mods ...qm.QueryMod) listenerQuery

Listeners 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

Types

type Channel

type Channel struct {
	ChannelID string    `boil:"channel_id" json:"channel_id" toml:"channel_id" yaml:"channel_id"`
	Name      string    `boil:"name" json:"name" toml:"name" yaml:"name"`
	CreatedAt time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
	UpdatedAt time.Time `boil:"updated_at" json:"updated_at" toml:"updated_at" yaml:"updated_at"`

	R *channelR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L channelL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Channel is an object representing the database table.

func FindChannel

func FindChannel(ctx context.Context, exec boil.ContextExecutor, channelID string, selectCols ...string) (*Channel, error)

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

func (*Channel) AddFollowedChannels

func (o *Channel) AddFollowedChannels(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*FollowedChannel) error

AddFollowedChannels adds the given related objects to the existing relationships of the channel, optionally inserting them as new records. Appends related to o.R.FollowedChannels. Sets related.R.Channel appropriately.

func (*Channel) Delete

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

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

func (*Channel) FollowedChannels

func (o *Channel) FollowedChannels(mods ...qm.QueryMod) followedChannelQuery

FollowedChannels retrieves all the followed_channel's FollowedChannels with an executor.

func (*Channel) Insert

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

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

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

func (*Channel) Update

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

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

func (o *Channel) 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 ChannelHook

type ChannelHook func(context.Context, boil.ContextExecutor, *Channel) error

ChannelHook is the signature for custom Channel hook methods

type ChannelSlice

type ChannelSlice []*Channel

ChannelSlice is an alias for a slice of pointers to Channel. This should generally be used opposed to []Channel.

func (ChannelSlice) DeleteAll

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

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

func (*ChannelSlice) ReloadAll

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

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

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

type FollowedChannel

type FollowedChannel struct {
	FollowedChannelID int       `boil:"followed_channel_id" json:"followed_channel_id" toml:"followed_channel_id" yaml:"followed_channel_id"`
	ListenerID        string    `boil:"listener_id" json:"listener_id" toml:"listener_id" yaml:"listener_id"`
	ChannelID         string    `boil:"channel_id" json:"channel_id" toml:"channel_id" yaml:"channel_id"`
	CreatedAt         time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
	UpdatedAt         time.Time `boil:"updated_at" json:"updated_at" toml:"updated_at" yaml:"updated_at"`

	R *followedChannelR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L followedChannelL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

FollowedChannel is an object representing the database table.

func FindFollowedChannel

func FindFollowedChannel(ctx context.Context, exec boil.ContextExecutor, followedChannelID int, selectCols ...string) (*FollowedChannel, error)

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

func (*FollowedChannel) Channel

func (o *FollowedChannel) Channel(mods ...qm.QueryMod) channelQuery

Channel pointed to by the foreign key.

func (*FollowedChannel) Delete

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

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

func (*FollowedChannel) Insert

func (o *FollowedChannel) 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 (*FollowedChannel) Listener

func (o *FollowedChannel) Listener(mods ...qm.QueryMod) listenerQuery

Listener pointed to by the foreign key.

func (*FollowedChannel) Reload

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

func (*FollowedChannel) SetChannel

func (o *FollowedChannel) SetChannel(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Channel) error

SetChannel of the followedChannel to the related item. Sets o.R.Channel to related. Adds o to related.R.FollowedChannels.

func (*FollowedChannel) SetListener

func (o *FollowedChannel) SetListener(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Listener) error

SetListener of the followedChannel to the related item. Sets o.R.Listener to related. Adds o to related.R.FollowedChannels.

func (*FollowedChannel) Update

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

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

func (o *FollowedChannel) 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 FollowedChannelHook

type FollowedChannelHook func(context.Context, boil.ContextExecutor, *FollowedChannel) error

FollowedChannelHook is the signature for custom FollowedChannel hook methods

type FollowedChannelSlice

type FollowedChannelSlice []*FollowedChannel

FollowedChannelSlice is an alias for a slice of pointers to FollowedChannel. This should generally be used opposed to []FollowedChannel.

func (FollowedChannelSlice) DeleteAll

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

func (*FollowedChannelSlice) ReloadAll

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

func (FollowedChannelSlice) UpdateAll

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

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

type Listener

type Listener struct {
	ListenerID string    `boil:"listener_id" json:"listener_id" toml:"listener_id" yaml:"listener_id"`
	Name       string    `boil:"name" json:"name" toml:"name" yaml:"name"`
	CreatedAt  time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
	UpdatedAt  time.Time `boil:"updated_at" json:"updated_at" toml:"updated_at" yaml:"updated_at"`

	R *listenerR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L listenerL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Listener is an object representing the database table.

func FindListener

func FindListener(ctx context.Context, exec boil.ContextExecutor, listenerID string, selectCols ...string) (*Listener, error)

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

func (*Listener) AddFollowedChannels

func (o *Listener) AddFollowedChannels(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*FollowedChannel) error

AddFollowedChannels adds the given related objects to the existing relationships of the listener, optionally inserting them as new records. Appends related to o.R.FollowedChannels. Sets related.R.Listener appropriately.

func (*Listener) Delete

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

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

func (*Listener) FollowedChannels

func (o *Listener) FollowedChannels(mods ...qm.QueryMod) followedChannelQuery

FollowedChannels retrieves all the followed_channel's FollowedChannels with an executor.

func (*Listener) Insert

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

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

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

func (*Listener) Update

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

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

func (o *Listener) 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 ListenerHook

type ListenerHook func(context.Context, boil.ContextExecutor, *Listener) error

ListenerHook is the signature for custom Listener hook methods

type ListenerSlice

type ListenerSlice []*Listener

ListenerSlice is an alias for a slice of pointers to Listener. This should generally be used opposed to []Listener.

func (ListenerSlice) DeleteAll

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

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

func (*ListenerSlice) ReloadAll

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

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

Jump to

Keyboard shortcuts

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