models

package
v0.0.0-...-fe19d6a Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2022 License: Apache-2.0 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 StreamColumns = struct {
	ID          string
	CreatedAt   string
	UpdatedAt   string
	Name        string
	Description string
	URL         string
}{
	ID:          "id",
	CreatedAt:   "created_at",
	UpdatedAt:   "updated_at",
	Name:        "name",
	Description: "description",
	URL:         "url",
}
View Source
var StreamRels = struct {
	CastTracks string
}{
	CastTracks: "CastTracks",
}

StreamRels is where relationship names are stored.

View Source
var StreamTableColumns = struct {
	ID          string
	CreatedAt   string
	UpdatedAt   string
	Name        string
	Description string
	URL         string
}{
	ID:          "stream.id",
	CreatedAt:   "stream.created_at",
	UpdatedAt:   "stream.updated_at",
	Name:        "stream.name",
	Description: "stream.description",
	URL:         "stream.url",
}
View Source
var StreamWhere = struct {
	ID          whereHelperint
	CreatedAt   whereHelpertime_Time
	UpdatedAt   whereHelpertime_Time
	Name        whereHelperstring
	Description whereHelpernull_String
	URL         whereHelperstring
}{
	ID:          whereHelperint{/* contains filtered or unexported fields */},
	CreatedAt:   whereHelpertime_Time{/* contains filtered or unexported fields */},
	UpdatedAt:   whereHelpertime_Time{/* contains filtered or unexported fields */},
	Name:        whereHelperstring{/* contains filtered or unexported fields */},
	Description: whereHelpernull_String{/* contains filtered or unexported fields */},
	URL:         whereHelperstring{/* contains filtered or unexported fields */},
}
View Source
var TableNames = struct {
	Stream string
	Track  string
}{
	Stream: "stream",
	Track:  "track",
}
View Source
var TrackColumns = struct {
	ID        string
	CastID    string
	StartedAt string
	EndedAt   string
	Title     string
	Listeners string
}{
	ID:        "id",
	CastID:    "cast_id",
	StartedAt: "started_at",
	EndedAt:   "ended_at",
	Title:     "title",
	Listeners: "listeners",
}
View Source
var TrackRels = struct {
	Cast string
}{
	Cast: "Cast",
}

TrackRels is where relationship names are stored.

View Source
var TrackTableColumns = struct {
	ID        string
	CastID    string
	StartedAt string
	EndedAt   string
	Title     string
	Listeners string
}{
	ID:        "track.id",
	CastID:    "track.cast_id",
	StartedAt: "track.started_at",
	EndedAt:   "track.ended_at",
	Title:     "track.title",
	Listeners: "track.listeners",
}
View Source
var TrackWhere = struct {
	ID        whereHelperint64
	CastID    whereHelperint
	StartedAt whereHelpertime_Time
	EndedAt   whereHelpertime_Time
	Title     whereHelperstring
	Listeners whereHelperint
}{
	ID:        whereHelperint64{/* contains filtered or unexported fields */},
	CastID:    whereHelperint{/* contains filtered or unexported fields */},
	StartedAt: whereHelpertime_Time{/* contains filtered or unexported fields */},
	EndedAt:   whereHelpertime_Time{/* contains filtered or unexported fields */},
	Title:     whereHelperstring{/* contains filtered or unexported fields */},
	Listeners: whereHelperint{/* contains filtered or unexported fields */},
}
View Source
var ViewNames = struct {
}{}

Functions

func AddStreamHook

func AddStreamHook(hookPoint boil.HookPoint, streamHook StreamHook)

AddStreamHook registers your hook function for all future operations.

func AddTrackHook

func AddTrackHook(hookPoint boil.HookPoint, trackHook TrackHook)

AddTrackHook 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 StreamExists

func StreamExists(ctx context.Context, exec boil.ContextExecutor, iD int) (bool, error)

StreamExists checks if the Stream row exists.

func Streams

func Streams(mods ...qm.QueryMod) streamQuery

Streams retrieves all the records using an executor.

func TrackExists

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

TrackExists checks if the Track row exists.

func Tracks

func Tracks(mods ...qm.QueryMod) trackQuery

Tracks 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 Stream

type Stream struct {
	ID          int         `boil:"id" json:"id" toml:"id" yaml:"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"`
	Name        string      `boil:"name" json:"name" toml:"name" yaml:"name"`
	Description null.String `boil:"description" json:"description,omitempty" toml:"description" yaml:"description,omitempty"`
	URL         string      `boil:"url" json:"url" toml:"url" yaml:"url"`

	R *streamR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L streamL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Stream is an object representing the database table.

func FindStream

func FindStream(ctx context.Context, exec boil.ContextExecutor, iD int, selectCols ...string) (*Stream, error)

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

func (*Stream) AddCastTracks

func (o *Stream) AddCastTracks(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Track) error

AddCastTracks adds the given related objects to the existing relationships of the stream, optionally inserting them as new records. Appends related to o.R.CastTracks. Sets related.R.Cast appropriately.

func (*Stream) CastTracks

func (o *Stream) CastTracks(mods ...qm.QueryMod) trackQuery

CastTracks retrieves all the track's Tracks with an executor via cast_id column.

func (*Stream) Delete

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

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

func (*Stream) Insert

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

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

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

func (*Stream) Update

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

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

func (o *Stream) 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 StreamHook

type StreamHook func(context.Context, boil.ContextExecutor, *Stream) error

StreamHook is the signature for custom Stream hook methods

type StreamSlice

type StreamSlice []*Stream

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

func (StreamSlice) DeleteAll

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

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

func (*StreamSlice) ReloadAll

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

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

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

type Track

type Track struct {
	ID        int64     `boil:"id" json:"id" toml:"id" yaml:"id"`
	CastID    int       `boil:"cast_id" json:"cast_id" toml:"cast_id" yaml:"cast_id"`
	StartedAt time.Time `boil:"started_at" json:"started_at" toml:"started_at" yaml:"started_at"`
	EndedAt   time.Time `boil:"ended_at" json:"ended_at" toml:"ended_at" yaml:"ended_at"`
	Title     string    `boil:"title" json:"title" toml:"title" yaml:"title"`
	Listeners int       `boil:"listeners" json:"listeners" toml:"listeners" yaml:"listeners"`

	R *trackR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L trackL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Track is an object representing the database table.

func FindTrack

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

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

func (*Track) Cast

func (o *Track) Cast(mods ...qm.QueryMod) streamQuery

Cast pointed to by the foreign key.

func (*Track) Delete

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

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

func (*Track) Insert

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

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

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

func (*Track) SetCast

func (o *Track) SetCast(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Stream) error

SetCast of the track to the related item. Sets o.R.Cast to related. Adds o to related.R.CastTracks.

func (*Track) Update

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

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

func (o *Track) 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 TrackHook

type TrackHook func(context.Context, boil.ContextExecutor, *Track) error

TrackHook is the signature for custom Track hook methods

type TrackSlice

type TrackSlice []*Track

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

func (TrackSlice) DeleteAll

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

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

func (*TrackSlice) ReloadAll

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

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