models

package
v0.0.0-...-e8f3219 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2019 License: Unlicense Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NoteA = "A"
	NoteB = "B"
	NoteC = "C"
	NoteD = "D"
	NoteE = "E"
	NoteF = "F"
	NoteG = "G"
)

Enum values for note

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 FrequencyColumns = struct {
	ID        string
	SoundID   string
	Frequency string
	SPL       string
}{
	ID:        "id",
	SoundID:   "sound_id",
	Frequency: "frequency",
	SPL:       "spl",
}
View Source
var FrequencyRels = struct {
	Sound string
}{
	Sound: "Sound",
}

FrequencyRels is where relationship names are stored.

View Source
var InstrumentColumns = struct {
	ID             string
	Name           string
	OrganizationID string
	CreatorID      string
	CreatedAt      string
	UpdatedAt      string
}{
	ID:             "id",
	Name:           "name",
	OrganizationID: "organization_id",
	CreatorID:      "creator_id",
	CreatedAt:      "created_at",
	UpdatedAt:      "updated_at",
}
View Source
var InstrumentRels = struct {
	Creator      string
	Organization string
	Sounds       string
}{
	Creator:      "Creator",
	Organization: "Organization",
	Sounds:       "Sounds",
}

InstrumentRels is where relationship names are stored.

View Source
var OrganizationColumns = struct {
	ID        string
	Name      string
	CreatedAt string
	UpdatedAt string
}{
	ID:        "id",
	Name:      "name",
	CreatedAt: "created_at",
	UpdatedAt: "updated_at",
}
View Source
var OrganizationRels = struct {
	Instruments string
	Sounds      string
	Users       string
}{
	Instruments: "Instruments",
	Sounds:      "Sounds",
	Users:       "Users",
}

OrganizationRels is where relationship names are stored.

View Source
var SoundColumns = struct {
	ID             string
	Name           string
	AudioFileName  string
	AudioUUID      string
	MimeType       string
	MD5File        string
	InstrumentID   string
	Note           string
	MaxFrequency   string
	MinFrequency   string
	MaxPowerFreq   string
	MaxPowerValue  string
	OrganizationID string
	CreatorID      string
	ProcessedAt    string
	CreatedAt      string
	UpdatedAt      string
}{
	ID:             "id",
	Name:           "name",
	AudioFileName:  "audio_file_name",
	AudioUUID:      "audio_uuid",
	MimeType:       "mime_type",
	MD5File:        "md5_file",
	InstrumentID:   "instrument_id",
	Note:           "note",
	MaxFrequency:   "max_frequency",
	MinFrequency:   "min_frequency",
	MaxPowerFreq:   "max_power_freq",
	MaxPowerValue:  "max_power_value",
	OrganizationID: "organization_id",
	CreatorID:      "creator_id",
	ProcessedAt:    "processed_at",
	CreatedAt:      "created_at",
	UpdatedAt:      "updated_at",
}
View Source
var SoundRels = struct {
	Instrument   string
	Creator      string
	Organization string
	Frequencies  string
}{
	Instrument:   "Instrument",
	Creator:      "Creator",
	Organization: "Organization",
	Frequencies:  "Frequencies",
}

SoundRels is where relationship names are stored.

View Source
var TableNames = struct {
	Frequencies   string
	Instruments   string
	Organizations string
	Sounds        string
	Users         string
}{
	Frequencies:   "frequencies",
	Instruments:   "instruments",
	Organizations: "organizations",
	Sounds:        "sounds",
	Users:         "users",
}
View Source
var UserColumns = struct {
	ID             string
	Name           string
	Password       string
	Email          string
	OrganizationID string
	CreatedAt      string
	UpdatedAt      string
}{
	ID:             "id",
	Name:           "name",
	Password:       "password",
	Email:          "email",
	OrganizationID: "organization_id",
	CreatedAt:      "created_at",
	UpdatedAt:      "updated_at",
}
View Source
var UserRels = struct {
	Organization       string
	CreatorInstruments string
	CreatorSounds      string
}{
	Organization:       "Organization",
	CreatorInstruments: "CreatorInstruments",
	CreatorSounds:      "CreatorSounds",
}

UserRels is where relationship names are stored.

Functions

func AddFrequencyHook

func AddFrequencyHook(hookPoint boil.HookPoint, frequencyHook FrequencyHook)

AddFrequencyHook registers your hook function for all future operations.

func AddInstrumentHook

func AddInstrumentHook(hookPoint boil.HookPoint, instrumentHook InstrumentHook)

AddInstrumentHook registers your hook function for all future operations.

func AddOrganizationHook

func AddOrganizationHook(hookPoint boil.HookPoint, organizationHook OrganizationHook)

AddOrganizationHook registers your hook function for all future operations.

func AddSoundHook

func AddSoundHook(hookPoint boil.HookPoint, soundHook SoundHook)

AddSoundHook 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 Frequencies

func Frequencies(mods ...qm.QueryMod) frequencyQuery

Frequencies retrieves all the records using an executor.

func FrequencyExists

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

FrequencyExists checks if the Frequency row exists.

func InstrumentExists

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

InstrumentExists checks if the Instrument row exists.

func Instruments

func Instruments(mods ...qm.QueryMod) instrumentQuery

Instruments 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 OrganizationExists

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

OrganizationExists checks if the Organization row exists.

func Organizations

func Organizations(mods ...qm.QueryMod) organizationQuery

Organizations retrieves all the records using an executor.

func SoundExists

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

SoundExists checks if the Sound row exists.

func Sounds

func Sounds(mods ...qm.QueryMod) soundQuery

Sounds retrieves all the records using an executor.

func UserExists

func UserExists(ctx context.Context, exec boil.ContextExecutor, iD int64) (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 Frequency

type Frequency struct {
	ID        int64         `boil:"id" json:"id" toml:"id" yaml:"id"`
	SoundID   int64         `boil:"sound_id" json:"soundID" toml:"soundID" yaml:"soundID"`
	Frequency int           `boil:"frequency" json:"frequency" toml:"frequency" yaml:"frequency"`
	SPL       types.Decimal `boil:"spl" json:"spl" toml:"spl" yaml:"spl"`
	R         *frequencyR   `boil:"-" json:"-" toml:"-" yaml:"-"`
	L         frequencyL    `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Frequency is an object representing the database table.

func FindFrequency

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

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

func (*Frequency) Delete

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

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

func (*Frequency) Insert

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

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

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

func (*Frequency) SetSound

func (o *Frequency) SetSound(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Sound) error

SetSound of the frequency to the related item. Sets o.R.Sound to related. Adds o to related.R.Frequencies.

func (*Frequency) Sound

func (o *Frequency) Sound(mods ...qm.QueryMod) soundQuery

Sound pointed to by the foreign key.

func (*Frequency) Update

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

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

func (o *Frequency) 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 FrequencyHook

type FrequencyHook func(context.Context, boil.ContextExecutor, *Frequency) error

FrequencyHook is the signature for custom Frequency hook methods

type FrequencySlice

type FrequencySlice []*Frequency

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

func (FrequencySlice) DeleteAll

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

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

func (*FrequencySlice) ReloadAll

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

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

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

type Instrument

type Instrument struct {
	ID             int64        `boil:"id" json:"id" toml:"id" yaml:"id"`
	Name           string       `boil:"name" json:"name" toml:"name" yaml:"name"`
	OrganizationID int64        `boil:"organization_id" json:"organizationID" toml:"organizationID" yaml:"organizationID"`
	CreatorID      int64        `boil:"creator_id" json:"creatorID" toml:"creatorID" yaml:"creatorID"`
	CreatedAt      null.Time    `boil:"created_at" json:"createdAt,omitempty" toml:"createdAt" yaml:"createdAt,omitempty"`
	UpdatedAt      null.Time    `boil:"updated_at" json:"updatedAt,omitempty" toml:"updatedAt" yaml:"updatedAt,omitempty"`
	R              *instrumentR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L              instrumentL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Instrument is an object representing the database table.

func FindInstrument

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

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

func (*Instrument) AddSounds

func (o *Instrument) AddSounds(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Sound) error

AddSounds adds the given related objects to the existing relationships of the instrument, optionally inserting them as new records. Appends related to o.R.Sounds. Sets related.R.Instrument appropriately.

func (*Instrument) Creator

func (o *Instrument) Creator(mods ...qm.QueryMod) userQuery

Creator pointed to by the foreign key.

func (*Instrument) Delete

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

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

func (*Instrument) Insert

func (o *Instrument) 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 (*Instrument) Organization

func (o *Instrument) Organization(mods ...qm.QueryMod) organizationQuery

Organization pointed to by the foreign key.

func (*Instrument) Reload

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

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

func (*Instrument) RemoveSounds

func (o *Instrument) RemoveSounds(ctx context.Context, exec boil.ContextExecutor, related ...*Sound) error

RemoveSounds relationships from objects passed in. Removes related items from R.Sounds (uses pointer comparison, removal does not keep order) Sets related.R.Instrument.

func (*Instrument) SetCreator

func (o *Instrument) SetCreator(ctx context.Context, exec boil.ContextExecutor, insert bool, related *User) error

SetCreator of the instrument to the related item. Sets o.R.Creator to related. Adds o to related.R.CreatorInstruments.

func (*Instrument) SetOrganization

func (o *Instrument) SetOrganization(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Organization) error

SetOrganization of the instrument to the related item. Sets o.R.Organization to related. Adds o to related.R.Instruments.

func (*Instrument) SetSounds

func (o *Instrument) SetSounds(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Sound) error

SetSounds removes all previously related items of the instrument replacing them completely with the passed in related items, optionally inserting them as new records. Sets o.R.Instrument's Sounds accordingly. Replaces o.R.Sounds with related. Sets related.R.Instrument's Sounds accordingly.

func (*Instrument) Sounds

func (o *Instrument) Sounds(mods ...qm.QueryMod) soundQuery

Sounds retrieves all the sound's Sounds with an executor.

func (*Instrument) Update

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

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

func (o *Instrument) 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 InstrumentHook

type InstrumentHook func(context.Context, boil.ContextExecutor, *Instrument) error

InstrumentHook is the signature for custom Instrument hook methods

type InstrumentSlice

type InstrumentSlice []*Instrument

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

func (InstrumentSlice) DeleteAll

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

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

func (*InstrumentSlice) ReloadAll

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

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

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

type M

type M map[string]interface{}

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

type Organization

type Organization struct {
	ID        int64          `boil:"id" json:"id" toml:"id" yaml:"id"`
	Name      string         `boil:"name" json:"name" toml:"name" yaml:"name"`
	CreatedAt null.Time      `boil:"created_at" json:"createdAt,omitempty" toml:"createdAt" yaml:"createdAt,omitempty"`
	UpdatedAt null.Time      `boil:"updated_at" json:"updatedAt,omitempty" toml:"updatedAt" yaml:"updatedAt,omitempty"`
	R         *organizationR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L         organizationL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Organization is an object representing the database table.

func FindOrganization

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

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

func (*Organization) AddInstruments

func (o *Organization) AddInstruments(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Instrument) error

AddInstruments adds the given related objects to the existing relationships of the organization, optionally inserting them as new records. Appends related to o.R.Instruments. Sets related.R.Organization appropriately.

func (*Organization) AddSounds

func (o *Organization) AddSounds(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Sound) error

AddSounds adds the given related objects to the existing relationships of the organization, optionally inserting them as new records. Appends related to o.R.Sounds. Sets related.R.Organization appropriately.

func (*Organization) AddUsers

func (o *Organization) AddUsers(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*User) error

AddUsers adds the given related objects to the existing relationships of the organization, optionally inserting them as new records. Appends related to o.R.Users. Sets related.R.Organization appropriately.

func (*Organization) Delete

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

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

func (*Organization) Insert

func (o *Organization) 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 (*Organization) Instruments

func (o *Organization) Instruments(mods ...qm.QueryMod) instrumentQuery

Instruments retrieves all the instrument's Instruments with an executor.

func (*Organization) Reload

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

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

func (*Organization) Sounds

func (o *Organization) Sounds(mods ...qm.QueryMod) soundQuery

Sounds retrieves all the sound's Sounds with an executor.

func (*Organization) Update

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

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

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

func (*Organization) Users

func (o *Organization) Users(mods ...qm.QueryMod) userQuery

Users retrieves all the user's Users with an executor.

type OrganizationHook

type OrganizationHook func(context.Context, boil.ContextExecutor, *Organization) error

OrganizationHook is the signature for custom Organization hook methods

type OrganizationSlice

type OrganizationSlice []*Organization

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

func (OrganizationSlice) DeleteAll

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

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

func (*OrganizationSlice) ReloadAll

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

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

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

type Sound

type Sound struct {
	ID             int64             `boil:"id" json:"id" toml:"id" yaml:"id"`
	Name           null.String       `boil:"name" json:"name,omitempty" toml:"name" yaml:"name,omitempty"`
	AudioFileName  string            `boil:"audio_file_name" json:"audioFileName" toml:"audioFileName" yaml:"audioFileName"`
	AudioUUID      string            `boil:"audio_uuid" json:"audioUUID" toml:"audioUUID" yaml:"audioUUID"`
	MimeType       string            `boil:"mime_type" json:"mimeType" toml:"mimeType" yaml:"mimeType"`
	MD5File        string            `boil:"md5_file" json:"md5File" toml:"md5File" yaml:"md5File"`
	InstrumentID   null.Int64        `boil:"instrument_id" json:"instrumentID,omitempty" toml:"instrumentID" yaml:"instrumentID,omitempty"`
	Note           null.String       `boil:"note" json:"note,omitempty" toml:"note" yaml:"note,omitempty"`
	MaxFrequency   types.NullDecimal `boil:"max_frequency" json:"maxFrequency,omitempty" toml:"maxFrequency" yaml:"maxFrequency,omitempty"`
	MinFrequency   types.NullDecimal `boil:"min_frequency" json:"minFrequency,omitempty" toml:"minFrequency" yaml:"minFrequency,omitempty"`
	MaxPowerFreq   types.NullDecimal `boil:"max_power_freq" json:"maxPowerFreq,omitempty" toml:"maxPowerFreq" yaml:"maxPowerFreq,omitempty"`
	MaxPowerValue  types.NullDecimal `boil:"max_power_value" json:"maxPowerValue,omitempty" toml:"maxPowerValue" yaml:"maxPowerValue,omitempty"`
	OrganizationID int64             `boil:"organization_id" json:"organizationID" toml:"organizationID" yaml:"organizationID"`
	CreatorID      int64             `boil:"creator_id" json:"creatorID" toml:"creatorID" yaml:"creatorID"`
	ProcessedAt    null.Time         `boil:"processed_at" json:"processedAt,omitempty" toml:"processedAt" yaml:"processedAt,omitempty"`
	CreatedAt      null.Time         `boil:"created_at" json:"createdAt,omitempty" toml:"createdAt" yaml:"createdAt,omitempty"`
	UpdatedAt      null.Time         `boil:"updated_at" json:"updatedAt,omitempty" toml:"updatedAt" yaml:"updatedAt,omitempty"`
	R              *soundR           `boil:"-" json:"-" toml:"-" yaml:"-"`
	L              soundL            `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Sound is an object representing the database table.

func FindSound

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

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

func (*Sound) AddFrequencies

func (o *Sound) AddFrequencies(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Frequency) error

AddFrequencies adds the given related objects to the existing relationships of the sound, optionally inserting them as new records. Appends related to o.R.Frequencies. Sets related.R.Sound appropriately.

func (*Sound) Creator

func (o *Sound) Creator(mods ...qm.QueryMod) userQuery

Creator pointed to by the foreign key.

func (*Sound) Delete

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

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

func (*Sound) Frequencies

func (o *Sound) Frequencies(mods ...qm.QueryMod) frequencyQuery

Frequencies retrieves all the frequency's Frequencies with an executor.

func (*Sound) Insert

func (o *Sound) 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 (*Sound) Instrument

func (o *Sound) Instrument(mods ...qm.QueryMod) instrumentQuery

Instrument pointed to by the foreign key.

func (*Sound) Organization

func (o *Sound) Organization(mods ...qm.QueryMod) organizationQuery

Organization pointed to by the foreign key.

func (*Sound) Reload

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

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

func (*Sound) RemoveInstrument

func (o *Sound) RemoveInstrument(ctx context.Context, exec boil.ContextExecutor, related *Instrument) error

RemoveInstrument relationship. Sets o.R.Instrument to nil. Removes o from all passed in related items' relationships struct (Optional).

func (*Sound) SetCreator

func (o *Sound) SetCreator(ctx context.Context, exec boil.ContextExecutor, insert bool, related *User) error

SetCreator of the sound to the related item. Sets o.R.Creator to related. Adds o to related.R.CreatorSounds.

func (*Sound) SetInstrument

func (o *Sound) SetInstrument(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Instrument) error

SetInstrument of the sound to the related item. Sets o.R.Instrument to related. Adds o to related.R.Sounds.

func (*Sound) SetOrganization

func (o *Sound) SetOrganization(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Organization) error

SetOrganization of the sound to the related item. Sets o.R.Organization to related. Adds o to related.R.Sounds.

func (*Sound) Update

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

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

func (o *Sound) 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 SoundHook

type SoundHook func(context.Context, boil.ContextExecutor, *Sound) error

SoundHook is the signature for custom Sound hook methods

type SoundSlice

type SoundSlice []*Sound

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

func (SoundSlice) DeleteAll

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

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

func (*SoundSlice) ReloadAll

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

func (o SoundSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, 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"`
	Password       string    `boil:"password" json:"password" toml:"password" yaml:"password"`
	Email          string    `boil:"email" json:"email" toml:"email" yaml:"email"`
	OrganizationID int64     `boil:"organization_id" json:"organizationID" toml:"organizationID" yaml:"organizationID"`
	CreatedAt      null.Time `boil:"created_at" json:"createdAt,omitempty" toml:"createdAt" yaml:"createdAt,omitempty"`
	UpdatedAt      null.Time `boil:"updated_at" json:"updatedAt,omitempty" toml:"updatedAt" yaml:"updatedAt,omitempty"`
	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, 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) AddCreatorInstruments

func (o *User) AddCreatorInstruments(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Instrument) error

AddCreatorInstruments adds the given related objects to the existing relationships of the user, optionally inserting them as new records. Appends related to o.R.CreatorInstruments. Sets related.R.Creator appropriately.

func (*User) AddCreatorSounds

func (o *User) AddCreatorSounds(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Sound) error

AddCreatorSounds adds the given related objects to the existing relationships of the user, optionally inserting them as new records. Appends related to o.R.CreatorSounds. Sets related.R.Creator appropriately.

func (*User) CreatorInstruments

func (o *User) CreatorInstruments(mods ...qm.QueryMod) instrumentQuery

CreatorInstruments retrieves all the instrument's Instruments with an executor via creator_id column.

func (*User) CreatorSounds

func (o *User) CreatorSounds(mods ...qm.QueryMod) soundQuery

CreatorSounds retrieves all the sound's Sounds with an executor via creator_id column.

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

func (o *User) Organization(mods ...qm.QueryMod) organizationQuery

Organization pointed to by the foreign key.

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

func (o *User) SetOrganization(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Organization) error

SetOrganization of the user to the related item. Sets o.R.Organization to related. Adds o to related.R.Users.

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 generally be used opposed to []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) 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.

Jump to

Keyboard shortcuts

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