models

package
v0.0.0-...-914eb61 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSyncFail = errors.New("models: failed to synchronize data after insert")

ErrSyncFail occurs during insert when the record could not be retrieved in order to populate default value information. This usually happens when LastInsertId fails or there was a primary key configuration that was not resolvable.

View Source
var TBookColumns = struct {
	ID        string
	Title     string
	Author    string
	Category  string
	DeleteFLG string
	CreatedAt string
	UpdatedAt string
}{
	ID:        "id",
	Title:     "title",
	Author:    "author",
	Category:  "category",
	DeleteFLG: "delete_flg",
	CreatedAt: "created_at",
	UpdatedAt: "updated_at",
}
View Source
var TBookRels = struct {
}{}

TBookRels is where relationship names are stored.

View Source
var TBookWhere = struct {
	ID        whereHelperint
	Title     whereHelperstring
	Author    whereHelperstring
	Category  whereHelperstring
	DeleteFLG whereHelpernull_String
	CreatedAt whereHelpernull_Time
	UpdatedAt whereHelpernull_Time
}{
	ID:        whereHelperint{/* contains filtered or unexported fields */},
	Title:     whereHelperstring{/* contains filtered or unexported fields */},
	Author:    whereHelperstring{/* contains filtered or unexported fields */},
	Category:  whereHelperstring{/* contains filtered or unexported fields */},
	DeleteFLG: whereHelpernull_String{/* contains filtered or unexported fields */},
	CreatedAt: whereHelpernull_Time{/* contains filtered or unexported fields */},
	UpdatedAt: whereHelpernull_Time{/* contains filtered or unexported fields */},
}
View Source
var TUserColumns = struct {
	ID         string
	FirstName  string
	LastName   string
	Email      string
	Password   string
	Oauth2Type string
	DeleteFLG  string
	CreatedAt  string
	UpdatedAt  string
}{
	ID:         "id",
	FirstName:  "first_name",
	LastName:   "last_name",
	Email:      "email",
	Password:   "password",
	Oauth2Type: "oauth2_type",
	DeleteFLG:  "delete_flg",
	CreatedAt:  "created_at",
	UpdatedAt:  "updated_at",
}
View Source
var TUserRels = struct {
}{}

TUserRels is where relationship names are stored.

View Source
var TUserWhere = struct {
	ID         whereHelperint
	FirstName  whereHelperstring
	LastName   whereHelperstring
	Email      whereHelperstring
	Password   whereHelperstring
	Oauth2Type whereHelperuint8
	DeleteFLG  whereHelpernull_String
	CreatedAt  whereHelpernull_Time
	UpdatedAt  whereHelpernull_Time
}{
	ID:         whereHelperint{/* contains filtered or unexported fields */},
	FirstName:  whereHelperstring{/* contains filtered or unexported fields */},
	LastName:   whereHelperstring{/* contains filtered or unexported fields */},
	Email:      whereHelperstring{/* contains filtered or unexported fields */},
	Password:   whereHelperstring{/* contains filtered or unexported fields */},
	Oauth2Type: whereHelperuint8{/* contains filtered or unexported fields */},
	DeleteFLG:  whereHelpernull_String{/* contains filtered or unexported fields */},
	CreatedAt:  whereHelpernull_Time{/* contains filtered or unexported fields */},
	UpdatedAt:  whereHelpernull_Time{/* contains filtered or unexported fields */},
}
View Source
var TableNames = struct {
	TBook string
	TUser string
}{
	TBook: "t_book",
	TUser: "t_user",
}

Functions

func NewQuery

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

NewQuery initializes a new Query using the passed in QueryMods

func TBookExists

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

TBookExists checks if the TBook row exists.

func TBooks

func TBooks(mods ...qm.QueryMod) tBookQuery

TBooks retrieves all the records using an executor.

func TUserExists

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

TUserExists checks if the TUser row exists.

func TUsers

func TUsers(mods ...qm.QueryMod) tUserQuery

TUsers 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 TBook

type TBook struct {
	ID        int         `boil:"id" json:"id" toml:"id" yaml:"id"`
	Title     string      `boil:"title" json:"title" toml:"title" yaml:"title"`
	Author    string      `boil:"author" json:"author" toml:"author" yaml:"author"`
	Category  string      `boil:"category" json:"category" toml:"category" yaml:"category"`
	DeleteFLG null.String `boil:"delete_flg" json:"delete_flg,omitempty" toml:"delete_flg" yaml:"delete_flg,omitempty"`
	CreatedAt null.Time   `boil:"created_at" json:"created_at,omitempty" toml:"created_at" yaml:"created_at,omitempty"`
	UpdatedAt null.Time   `boil:"updated_at" json:"updated_at,omitempty" toml:"updated_at" yaml:"updated_at,omitempty"`

	R *tBookR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L tBookL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

TBook is an object representing the database table.

func FindTBook

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

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

func (*TBook) Delete

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

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

func (*TBook) Insert

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

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

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

func (*TBook) Update

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

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

func (o *TBook) 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 TBookSlice

type TBookSlice []*TBook

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

func (TBookSlice) DeleteAll

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

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

func (*TBookSlice) ReloadAll

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

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

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

type TUser

type TUser struct {
	ID         int         `boil:"id" json:"id" toml:"id" yaml:"id"`
	FirstName  string      `boil:"first_name" json:"first_name" toml:"first_name" yaml:"first_name"`
	LastName   string      `boil:"last_name" json:"last_name" toml:"last_name" yaml:"last_name"`
	Email      string      `boil:"email" json:"email" toml:"email" yaml:"email"`
	Password   string      `boil:"password" json:"password" toml:"password" yaml:"password"`
	Oauth2Type uint8       `boil:"oauth2_type" json:"oauth2_type" toml:"oauth2_type" yaml:"oauth2_type"`
	DeleteFLG  null.String `boil:"delete_flg" json:"delete_flg,omitempty" toml:"delete_flg" yaml:"delete_flg,omitempty"`
	CreatedAt  null.Time   `boil:"created_at" json:"created_at,omitempty" toml:"created_at" yaml:"created_at,omitempty"`
	UpdatedAt  null.Time   `boil:"updated_at" json:"updated_at,omitempty" toml:"updated_at" yaml:"updated_at,omitempty"`

	R *tUserR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L tUserL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

TUser is an object representing the database table.

func FindTUser

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

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

func (*TUser) Delete

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

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

func (*TUser) Insert

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

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

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

func (*TUser) Update

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

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

func (o *TUser) 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 TUserSlice

type TUserSlice []*TUser

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

func (TUserSlice) DeleteAll

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

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

func (*TUserSlice) ReloadAll

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

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