Documentation
¶
Index ¶
- Variables
- func AddAuthorHook(hookPoint boil.HookPoint, authorHook AuthorHook)
- func AddBookAuthorHook(hookPoint boil.HookPoint, bookAuthorHook BookAuthorHook)
- func AddBookHook(hookPoint boil.HookPoint, bookHook BookHook)
- func AddLendingHook(hookPoint boil.HookPoint, lendingHook LendingHook)
- func AuthorExists(ctx context.Context, exec boil.ContextExecutor, iD int64) (bool, error)
- func Authors(mods ...qm.QueryMod) authorQuery
- func BookAuthorExists(ctx context.Context, exec boil.ContextExecutor, iD int64) (bool, error)
- func BookAuthors(mods ...qm.QueryMod) bookAuthorQuery
- func BookExists(ctx context.Context, exec boil.ContextExecutor, iD string) (bool, error)
- func Books(mods ...qm.QueryMod) bookQuery
- func LendingExists(ctx context.Context, exec boil.ContextExecutor, iD int64) (bool, error)
- func Lendings(mods ...qm.QueryMod) lendingQuery
- func NewQuery(mods ...qm.QueryMod) *queries.Query
- type Author
- func (o *Author) AddBookAuthors(ctx context.Context, exec boil.ContextExecutor, insert bool, ...) error
- func (o *Author) BookAuthors(mods ...qm.QueryMod) bookAuthorQuery
- func (o *Author) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)
- func (o *Author) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error
- 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 AuthorHook
- type AuthorSlice
- type Book
- func (o *Book) AddBookAuthors(ctx context.Context, exec boil.ContextExecutor, insert bool, ...) error
- func (o *Book) AddLendings(ctx context.Context, exec boil.ContextExecutor, insert bool, ...) error
- func (o *Book) BookAuthors(mods ...qm.QueryMod) bookAuthorQuery
- func (o *Book) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)
- func (o *Book) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error
- func (o *Book) Lendings(mods ...qm.QueryMod) lendingQuery
- func (o *Book) Reload(ctx context.Context, exec boil.ContextExecutor) error
- func (o *Book) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
- func (o *Book) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, ...) error
- type BookAuthor
- func (o *BookAuthor) Author(mods ...qm.QueryMod) authorQuery
- func (o *BookAuthor) Book(mods ...qm.QueryMod) bookQuery
- func (o *BookAuthor) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)
- func (o *BookAuthor) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error
- func (o *BookAuthor) Reload(ctx context.Context, exec boil.ContextExecutor) error
- func (o *BookAuthor) SetAuthor(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Author) error
- func (o *BookAuthor) SetBook(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Book) error
- func (o *BookAuthor) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
- func (o *BookAuthor) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, ...) error
- type BookAuthorHook
- type BookAuthorSlice
- type BookHook
- type BookSlice
- type Lending
- func (o *Lending) Book(mods ...qm.QueryMod) bookQuery
- func (o *Lending) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)
- func (o *Lending) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error
- func (o *Lending) Reload(ctx context.Context, exec boil.ContextExecutor) error
- func (o *Lending) SetBook(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Book) error
- func (o *Lending) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
- func (o *Lending) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, ...) error
- type LendingHook
- type LendingSlice
- type M
Constants ¶
This section is empty.
Variables ¶
var AuthorColumns = struct { ID string Name string }{ ID: "id", Name: "name", }
var AuthorRels = struct { BookAuthors string }{ BookAuthors: "BookAuthors", }
AuthorRels is where relationship names are stored.
var AuthorWhere = struct { ID whereHelperint64 Name whereHelperstring }{ ID: whereHelperint64{/* contains filtered or unexported fields */}, Name: whereHelperstring{/* contains filtered or unexported fields */}, }
var BookAuthorColumns = struct { ID string BooksID string AuthorsID string }{ ID: "id", BooksID: "books_id", AuthorsID: "authors_id", }
var BookAuthorRels = struct { Book string Author string }{ Book: "Book", Author: "Author", }
BookAuthorRels is where relationship names are stored.
var BookAuthorWhere = struct { ID whereHelperint64 BooksID whereHelperstring AuthorsID whereHelperint64 }{ ID: whereHelperint64{/* contains filtered or unexported fields */}, BooksID: whereHelperstring{/* contains filtered or unexported fields */}, AuthorsID: whereHelperint64{/* contains filtered or unexported fields */}, }
var BookColumns = struct { ID string Title string Publisher string PublishedAt string Isbn13 string ImageURL string CreatedAt string UpdatedAt string }{ ID: "id", Title: "title", Publisher: "publisher", PublishedAt: "published_at", Isbn13: "isbn13", ImageURL: "image_url", CreatedAt: "created_at", UpdatedAt: "updated_at", }
var BookRels = struct { BookAuthors string Lendings string }{ BookAuthors: "BookAuthors", Lendings: "Lendings", }
BookRels is where relationship names are stored.
var BookWhere = struct { ID whereHelperstring Title whereHelperstring Publisher whereHelperstring PublishedAt whereHelpertime_Time Isbn13 whereHelperstring ImageURL whereHelpernull_String CreatedAt whereHelpertime_Time UpdatedAt whereHelpertime_Time }{ ID: whereHelperstring{/* contains filtered or unexported fields */}, Title: whereHelperstring{/* contains filtered or unexported fields */}, Publisher: whereHelperstring{/* contains filtered or unexported fields */}, PublishedAt: whereHelpertime_Time{/* contains filtered or unexported fields */}, Isbn13: whereHelperstring{/* contains filtered or unexported fields */}, ImageURL: whereHelpernull_String{/* contains filtered or unexported fields */}, CreatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */}, UpdatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */}, }
var ErrSyncFail = errors.New("record: 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 LendingColumns = struct { ID string BookID string UserID string LentAt string ReturnedAt string }{ ID: "id", BookID: "book_id", UserID: "user_id", LentAt: "lent_at", ReturnedAt: "returned_at", }
var LendingRels = struct { Book string }{ Book: "Book", }
LendingRels is where relationship names are stored.
var LendingWhere = struct { ID whereHelperint64 BookID whereHelperstring UserID whereHelperint64 LentAt whereHelpertime_Time ReturnedAt whereHelpernull_Time }{ ID: whereHelperint64{/* contains filtered or unexported fields */}, BookID: whereHelperstring{/* contains filtered or unexported fields */}, UserID: whereHelperint64{/* contains filtered or unexported fields */}, LentAt: whereHelpertime_Time{/* contains filtered or unexported fields */}, ReturnedAt: whereHelpernull_Time{/* contains filtered or unexported fields */}, }
var TableNames = struct { Authors string BookAuthors string Books string Lendings string }{ Authors: "authors", BookAuthors: "book_authors", Books: "books", Lendings: "lendings", }
Functions ¶
func AddAuthorHook ¶
func AddAuthorHook(hookPoint boil.HookPoint, authorHook AuthorHook)
AddAuthorHook registers your hook function for all future operations.
func AddBookAuthorHook ¶
func AddBookAuthorHook(hookPoint boil.HookPoint, bookAuthorHook BookAuthorHook)
AddBookAuthorHook registers your hook function for all future operations.
func AddBookHook ¶
AddBookHook registers your hook function for all future operations.
func AddLendingHook ¶
func AddLendingHook(hookPoint boil.HookPoint, lendingHook LendingHook)
AddLendingHook registers your hook function for all future operations.
func AuthorExists ¶
AuthorExists checks if the Author row exists.
func BookAuthorExists ¶
BookAuthorExists checks if the BookAuthor row exists.
func BookAuthors ¶
BookAuthors retrieves all the records using an executor.
func BookExists ¶
BookExists checks if the Book row exists.
func LendingExists ¶
LendingExists checks if the Lending row exists.
Types ¶
type Author ¶
type Author struct { ID int64 `boil:"id" json:"id" toml:"id" yaml:"id"` 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 int64, 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) AddBookAuthors ¶
func (o *Author) AddBookAuthors(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*BookAuthor) error
AddBookAuthors adds the given related objects to the existing relationships of the author, optionally inserting them as new records. Appends related to o.R.BookAuthors. Sets related.R.Author appropriately.
func (*Author) BookAuthors ¶
BookAuthors retrieves all the book_author's BookAuthors with an executor.
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 AuthorHook ¶
AuthorHook is the signature for custom Author hook methods
type AuthorSlice ¶
type AuthorSlice []*Author
AuthorSlice is an alias for a slice of pointers to Author. This should generally be used opposed to []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 Book ¶
type Book struct { ID string `boil:"id" json:"id" toml:"id" yaml:"id"` Title string `boil:"title" json:"title" toml:"title" yaml:"title"` Publisher string `boil:"publisher" json:"publisher" toml:"publisher" yaml:"publisher"` PublishedAt time.Time `boil:"published_at" json:"published_at" toml:"published_at" yaml:"published_at"` Isbn13 string `boil:"isbn13" json:"isbn13" toml:"isbn13" yaml:"isbn13"` ImageURL null.String `boil:"image_url" json:"image_url,omitempty" toml:"image_url" yaml:"image_url,omitempty"` 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 *bookR `boil:"-" json:"-" toml:"-" yaml:"-"` L bookL `boil:"-" json:"-" toml:"-" yaml:"-"` }
Book is an object representing the database table.
func FindBook ¶
func FindBook(ctx context.Context, exec boil.ContextExecutor, iD string, selectCols ...string) (*Book, error)
FindBook retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.
func (*Book) AddBookAuthors ¶
func (o *Book) AddBookAuthors(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*BookAuthor) error
AddBookAuthors adds the given related objects to the existing relationships of the book, optionally inserting them as new records. Appends related to o.R.BookAuthors. Sets related.R.Book appropriately.
func (*Book) AddLendings ¶
func (o *Book) AddLendings(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Lending) error
AddLendings adds the given related objects to the existing relationships of the book, optionally inserting them as new records. Appends related to o.R.Lendings. Sets related.R.Book appropriately.
func (*Book) BookAuthors ¶
BookAuthors retrieves all the book_author's BookAuthors with an executor.
func (*Book) Delete ¶
Delete deletes a single Book record with an executor. Delete will match against the primary key column to find the record to delete.
func (*Book) Insert ¶
Insert a single record using an executor. See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts.
func (*Book) Reload ¶
Reload refetches the object from the database using the primary keys with an executor.
func (*Book) Update ¶
func (o *Book) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
Update uses an executor to update the Book. 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 (*Book) Upsert ¶
func (o *Book) 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 BookAuthor ¶
type BookAuthor struct { ID int64 `boil:"id" json:"id" toml:"id" yaml:"id"` BooksID string `boil:"books_id" json:"books_id" toml:"books_id" yaml:"books_id"` AuthorsID int64 `boil:"authors_id" json:"authors_id" toml:"authors_id" yaml:"authors_id"` R *bookAuthorR `boil:"-" json:"-" toml:"-" yaml:"-"` L bookAuthorL `boil:"-" json:"-" toml:"-" yaml:"-"` }
BookAuthor is an object representing the database table.
func FindBookAuthor ¶
func FindBookAuthor(ctx context.Context, exec boil.ContextExecutor, iD int64, selectCols ...string) (*BookAuthor, error)
FindBookAuthor retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.
func (*BookAuthor) Author ¶
func (o *BookAuthor) Author(mods ...qm.QueryMod) authorQuery
Author pointed to by the foreign key.
func (*BookAuthor) Book ¶
func (o *BookAuthor) Book(mods ...qm.QueryMod) bookQuery
Book pointed to by the foreign key.
func (*BookAuthor) Delete ¶
func (o *BookAuthor) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)
Delete deletes a single BookAuthor record with an executor. Delete will match against the primary key column to find the record to delete.
func (*BookAuthor) Insert ¶
func (o *BookAuthor) 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 (*BookAuthor) Reload ¶
func (o *BookAuthor) Reload(ctx context.Context, exec boil.ContextExecutor) error
Reload refetches the object from the database using the primary keys with an executor.
func (*BookAuthor) SetAuthor ¶
func (o *BookAuthor) SetAuthor(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Author) error
SetAuthor of the bookAuthor to the related item. Sets o.R.Author to related. Adds o to related.R.BookAuthors.
func (*BookAuthor) SetBook ¶
func (o *BookAuthor) SetBook(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Book) error
SetBook of the bookAuthor to the related item. Sets o.R.Book to related. Adds o to related.R.BookAuthors.
func (*BookAuthor) Update ¶
func (o *BookAuthor) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
Update uses an executor to update the BookAuthor. 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 (*BookAuthor) Upsert ¶
func (o *BookAuthor) 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 BookAuthorHook ¶
type BookAuthorHook func(context.Context, boil.ContextExecutor, *BookAuthor) error
BookAuthorHook is the signature for custom BookAuthor hook methods
type BookAuthorSlice ¶
type BookAuthorSlice []*BookAuthor
BookAuthorSlice is an alias for a slice of pointers to BookAuthor. This should generally be used opposed to []BookAuthor.
func (BookAuthorSlice) DeleteAll ¶
func (o BookAuthorSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error)
DeleteAll deletes all rows in the slice, using an executor.
func (*BookAuthorSlice) ReloadAll ¶
func (o *BookAuthorSlice) 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 (BookAuthorSlice) UpdateAll ¶
func (o BookAuthorSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error)
UpdateAll updates all rows with the specified column values, using an executor.
type BookSlice ¶
type BookSlice []*Book
BookSlice is an alias for a slice of pointers to Book. This should generally be used opposed to []Book.
type Lending ¶
type Lending struct { ID int64 `boil:"id" json:"id" toml:"id" yaml:"id"` BookID string `boil:"book_id" json:"book_id" toml:"book_id" yaml:"book_id"` UserID int64 `boil:"user_id" json:"user_id" toml:"user_id" yaml:"user_id"` LentAt time.Time `boil:"lent_at" json:"lent_at" toml:"lent_at" yaml:"lent_at"` ReturnedAt null.Time `boil:"returned_at" json:"returned_at,omitempty" toml:"returned_at" yaml:"returned_at,omitempty"` R *lendingR `boil:"-" json:"-" toml:"-" yaml:"-"` L lendingL `boil:"-" json:"-" toml:"-" yaml:"-"` }
Lending is an object representing the database table.
func FindLending ¶
func FindLending(ctx context.Context, exec boil.ContextExecutor, iD int64, selectCols ...string) (*Lending, error)
FindLending retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.
func (*Lending) Delete ¶
Delete deletes a single Lending record with an executor. Delete will match against the primary key column to find the record to delete.
func (*Lending) Insert ¶
func (o *Lending) 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 (*Lending) Reload ¶
Reload refetches the object from the database using the primary keys with an executor.
func (*Lending) SetBook ¶
func (o *Lending) SetBook(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Book) error
SetBook of the lending to the related item. Sets o.R.Book to related. Adds o to related.R.Lendings.
func (*Lending) Update ¶
func (o *Lending) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
Update uses an executor to update the Lending. 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 (*Lending) Upsert ¶
func (o *Lending) 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 LendingHook ¶
LendingHook is the signature for custom Lending hook methods
type LendingSlice ¶
type LendingSlice []*Lending
LendingSlice is an alias for a slice of pointers to Lending. This should generally be used opposed to []Lending.
func (LendingSlice) DeleteAll ¶
func (o LendingSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error)
DeleteAll deletes all rows in the slice, using an executor.
func (*LendingSlice) ReloadAll ¶
func (o *LendingSlice) 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 (LendingSlice) UpdateAll ¶
func (o LendingSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error)
UpdateAll updates all rows with the specified column values, using an executor.