Documentation ¶
Index ¶
- Variables
- func AuthorExists(ctx context.Context, exec boil.ContextExecutor, iD int) (bool, error)
- func Authors(mods ...qm.QueryMod) authorQuery
- func NewQuery(mods ...qm.QueryMod) *queries.Query
- func PostExists(ctx context.Context, exec boil.ContextExecutor, iD int) (bool, error)
- func Posts(mods ...qm.QueryMod) postQuery
- func SchemaMigrationExists(ctx context.Context, exec boil.ContextExecutor, version int64) (bool, error)
- func SchemaMigrations(mods ...qm.QueryMod) schemaMigrationQuery
- type Author
- func (o *Author) AddPosts(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Post) error
- func (o *Author) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)
- func (o *Author) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error)
- func (o *Author) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error
- func (o *Author) Posts(mods ...qm.QueryMod) postQuery
- func (o *Author) Reload(ctx context.Context, exec boil.ContextExecutor) error
- func (o *Author) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
- func (o *Author) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, ...) error
- type AuthorSlice
- type M
- type Post
- func (o *Post) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)
- func (o *Post) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error)
- func (o *Post) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error
- func (o *Post) PostAuthor(mods ...qm.QueryMod) authorQuery
- func (o *Post) Reload(ctx context.Context, exec boil.ContextExecutor) error
- func (o *Post) SetPostAuthor(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Author) error
- func (o *Post) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
- func (o *Post) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, ...) error
- type PostSlice
- type SchemaMigration
- func (o *SchemaMigration) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)
- func (o *SchemaMigration) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error)
- func (o *SchemaMigration) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error
- func (o *SchemaMigration) Reload(ctx context.Context, exec boil.ContextExecutor) error
- func (o *SchemaMigration) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
- func (o *SchemaMigration) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, ...) error
- type SchemaMigrationSlice
- func (o SchemaMigrationSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error)
- func (o *SchemaMigrationSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error
- func (o SchemaMigrationSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error)
Constants ¶
This section is empty.
Variables ¶
var AuthorColumns = struct { ID string Email string Name string }{ ID: "id", Email: "email", Name: "name", }
var AuthorRels = struct { Posts string }{ Posts: "Posts", }
AuthorRels is where relationship names are stored.
var AuthorTableColumns = struct { ID string Email string Name string }{ ID: "author.id", Email: "author.email", Name: "author.name", }
var AuthorWhere = struct { ID whereHelperint Email whereHelperstring Name whereHelperstring }{ ID: whereHelperint{/* contains filtered or unexported fields */}, Email: whereHelperstring{/* contains filtered or unexported fields */}, Name: whereHelperstring{/* contains filtered or unexported fields */}, }
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.
var PostColumns = struct { ID string Title string Content string CreatedAt string UpdatedAt string Author string }{ ID: "id", Title: "title", Content: "content", CreatedAt: "created_at", UpdatedAt: "updated_at", Author: "author", }
var PostRels = struct { PostAuthor string }{ PostAuthor: "PostAuthor", }
PostRels is where relationship names are stored.
var PostTableColumns = struct { ID string Title string Content string CreatedAt string UpdatedAt string Author string }{ ID: "post.id", Title: "post.title", Content: "post.content", CreatedAt: "post.created_at", UpdatedAt: "post.updated_at", Author: "post.author", }
var PostWhere = struct { ID whereHelperint Title whereHelperstring Content whereHelpernull_String CreatedAt whereHelpernull_Time UpdatedAt whereHelpernull_Time Author whereHelperint }{ ID: whereHelperint{/* contains filtered or unexported fields */}, Title: whereHelperstring{/* contains filtered or unexported fields */}, Content: whereHelpernull_String{/* contains filtered or unexported fields */}, CreatedAt: whereHelpernull_Time{/* contains filtered or unexported fields */}, UpdatedAt: whereHelpernull_Time{/* contains filtered or unexported fields */}, Author: whereHelperint{/* contains filtered or unexported fields */}, }
var SchemaMigrationColumns = struct { Version string Dirty string }{ Version: "version", Dirty: "dirty", }
var SchemaMigrationRels = struct {
}{}
SchemaMigrationRels is where relationship names are stored.
var SchemaMigrationTableColumns = struct { Version string Dirty string }{ Version: "schema_migrations.version", Dirty: "schema_migrations.dirty", }
var SchemaMigrationWhere = struct { Version whereHelperint64 Dirty whereHelperbool }{ Version: whereHelperint64{/* contains filtered or unexported fields */}, Dirty: whereHelperbool{/* contains filtered or unexported fields */}, }
var TableNames = struct { Author string Post string SchemaMigrations string }{ Author: "author", Post: "post", SchemaMigrations: "schema_migrations", }
var ViewNames = struct {
}{}
Functions ¶
func AuthorExists ¶
AuthorExists checks if the Author row exists.
func PostExists ¶
PostExists checks if the Post row exists.
func SchemaMigrationExists ¶
func SchemaMigrationExists(ctx context.Context, exec boil.ContextExecutor, version int64) (bool, error)
SchemaMigrationExists checks if the SchemaMigration row exists.
func SchemaMigrations ¶
SchemaMigrations retrieves all the records using an executor.
Types ¶
type Author ¶
type Author struct { ID int `boil:"id" json:"id" toml:"id" yaml:"id"` Email string `boil:"email" json:"email" toml:"email" yaml:"email"` Name string `boil:"name" json:"name" toml:"name" yaml:"name"` R *authorR `boil:"-" json:"-" toml:"-" yaml:"-"` L authorL `boil:"-" json:"-" toml:"-" yaml:"-"` }
Author is an object representing the database table.
func FindAuthor ¶
func FindAuthor(ctx context.Context, exec boil.ContextExecutor, iD int, selectCols ...string) (*Author, error)
FindAuthor retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.
func (*Author) AddPosts ¶
func (o *Author) AddPosts(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Post) error
AddPosts adds the given related objects to the existing relationships of the author, optionally inserting them as new records. Appends related to o.R.Posts. Sets related.R.PostAuthor appropriately.
func (*Author) Delete ¶
Delete deletes a single Author record with an executor. Delete will match against the primary key column to find the record to delete.
func (*Author) Insert ¶
Insert a single record using an executor. See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts.
func (*Author) Reload ¶
Reload refetches the object from the database using the primary keys with an executor.
func (*Author) Update ¶
func (o *Author) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
Update uses an executor to update the Author. 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 (*Author) Upsert ¶
func (o *Author) 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 AuthorSlice ¶
type AuthorSlice []*Author
AuthorSlice is an alias for a slice of pointers to Author. This should almost always be used instead of []Author.
func (AuthorSlice) DeleteAll ¶
func (o AuthorSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error)
DeleteAll deletes all rows in the slice, using an executor.
func (*AuthorSlice) ReloadAll ¶
func (o *AuthorSlice) 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 (AuthorSlice) UpdateAll ¶
func (o AuthorSlice) 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 Post ¶
type Post struct { ID int `boil:"id" json:"id" toml:"id" yaml:"id"` Title string `boil:"title" json:"title" toml:"title" yaml:"title"` Content null.String `boil:"content" json:"content,omitempty" toml:"content" yaml:"content,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"` Author int `boil:"author" json:"author" toml:"author" yaml:"author"` R *postR `boil:"-" json:"-" toml:"-" yaml:"-"` L postL `boil:"-" json:"-" toml:"-" yaml:"-"` }
Post is an object representing the database table.
func FindPost ¶
func FindPost(ctx context.Context, exec boil.ContextExecutor, iD int, selectCols ...string) (*Post, error)
FindPost retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.
func (*Post) Delete ¶
Delete deletes a single Post record with an executor. Delete will match against the primary key column to find the record to delete.
func (*Post) Insert ¶
Insert a single record using an executor. See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts.
func (*Post) PostAuthor ¶
PostAuthor pointed to by the foreign key.
func (*Post) Reload ¶
Reload refetches the object from the database using the primary keys with an executor.
func (*Post) SetPostAuthor ¶
func (o *Post) SetPostAuthor(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Author) error
SetPostAuthor of the post to the related item. Sets o.R.PostAuthor to related. Adds o to related.R.Posts.
func (*Post) Update ¶
func (o *Post) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
Update uses an executor to update the Post. 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 (*Post) Upsert ¶
func (o *Post) 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 PostSlice ¶
type PostSlice []*Post
PostSlice is an alias for a slice of pointers to Post. This should almost always be used instead of []Post.
type SchemaMigration ¶
type SchemaMigration struct { Version int64 `boil:"version" json:"version" toml:"version" yaml:"version"` Dirty bool `boil:"dirty" json:"dirty" toml:"dirty" yaml:"dirty"` R *schemaMigrationR `boil:"-" json:"-" toml:"-" yaml:"-"` L schemaMigrationL `boil:"-" json:"-" toml:"-" yaml:"-"` }
SchemaMigration is an object representing the database table.
func FindSchemaMigration ¶
func FindSchemaMigration(ctx context.Context, exec boil.ContextExecutor, version int64, selectCols ...string) (*SchemaMigration, error)
FindSchemaMigration retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.
func (*SchemaMigration) Delete ¶
func (o *SchemaMigration) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)
Delete deletes a single SchemaMigration record with an executor. Delete will match against the primary key column to find the record to delete.
func (*SchemaMigration) Exists ¶
func (o *SchemaMigration) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error)
Exists checks if the SchemaMigration row exists.
func (*SchemaMigration) Insert ¶
func (o *SchemaMigration) 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 (*SchemaMigration) Reload ¶
func (o *SchemaMigration) Reload(ctx context.Context, exec boil.ContextExecutor) error
Reload refetches the object from the database using the primary keys with an executor.
func (*SchemaMigration) Update ¶
func (o *SchemaMigration) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
Update uses an executor to update the SchemaMigration. 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 (*SchemaMigration) Upsert ¶
func (o *SchemaMigration) 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 SchemaMigrationSlice ¶
type SchemaMigrationSlice []*SchemaMigration
SchemaMigrationSlice is an alias for a slice of pointers to SchemaMigration. This should almost always be used instead of []SchemaMigration.
func (SchemaMigrationSlice) DeleteAll ¶
func (o SchemaMigrationSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error)
DeleteAll deletes all rows in the slice, using an executor.
func (*SchemaMigrationSlice) ReloadAll ¶
func (o *SchemaMigrationSlice) 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 (SchemaMigrationSlice) UpdateAll ¶
func (o SchemaMigrationSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error)
UpdateAll updates all rows with the specified column values, using an executor.