record

package
v0.0.0-...-303d6f2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AuthorColumns = struct {
	ID   string
	Name string
}{
	ID:   "id",
	Name: "name",
}
View Source
var AuthorRels = struct {
	BookAuthors string
}{
	BookAuthors: "BookAuthors",
}

AuthorRels is where relationship names are stored.

View Source
var AuthorWhere = struct {
	ID   whereHelperint64
	Name whereHelperstring
}{
	ID:   whereHelperint64{/* contains filtered or unexported fields */},
	Name: whereHelperstring{/* contains filtered or unexported fields */},
}
View Source
var BookAuthorColumns = struct {
	ID        string
	BooksID   string
	AuthorsID string
}{
	ID:        "id",
	BooksID:   "books_id",
	AuthorsID: "authors_id",
}
View Source
var BookAuthorRels = struct {
	Book   string
	Author string
}{
	Book:   "Book",
	Author: "Author",
}

BookAuthorRels is where relationship names are stored.

View Source
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 */},
}
View Source
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",
}
View Source
var BookRels = struct {
	BookAuthors string
	Lendings    string
}{
	BookAuthors: "BookAuthors",
	Lendings:    "Lendings",
}

BookRels is where relationship names are stored.

View Source
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 */},
}
View Source
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.

View Source
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",
}
View Source
var LendingRels = struct {
	Book string
}{
	Book: "Book",
}

LendingRels is where relationship names are stored.

View Source
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 */},
}
View Source
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

func AddBookHook(hookPoint boil.HookPoint, bookHook BookHook)

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

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

AuthorExists checks if the Author row exists.

func Authors

func Authors(mods ...qm.QueryMod) authorQuery

Authors retrieves all the records using an executor.

func BookAuthorExists

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

BookAuthorExists checks if the BookAuthor row exists.

func BookAuthors

func BookAuthors(mods ...qm.QueryMod) bookAuthorQuery

BookAuthors retrieves all the records using an executor.

func BookExists

func BookExists(ctx context.Context, exec boil.ContextExecutor, iD string) (bool, error)

BookExists checks if the Book row exists.

func Books

func Books(mods ...qm.QueryMod) bookQuery

Books retrieves all the records using an executor.

func LendingExists

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

LendingExists checks if the Lending row exists.

func Lendings

func Lendings(mods ...qm.QueryMod) lendingQuery

Lendings 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

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

func (o *Author) BookAuthors(mods ...qm.QueryMod) bookAuthorQuery

BookAuthors retrieves all the book_author's BookAuthors with an executor.

func (*Author) Delete

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

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

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

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

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

type AuthorHook func(context.Context, boil.ContextExecutor, *Author) error

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

func (o *Book) BookAuthors(mods ...qm.QueryMod) bookAuthorQuery

BookAuthors retrieves all the book_author's BookAuthors with an executor.

func (*Book) Delete

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

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

func (o *Book) 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 (*Book) Lendings

func (o *Book) Lendings(mods ...qm.QueryMod) lendingQuery

Lendings retrieves all the lending's Lendings with an executor.

func (*Book) Reload

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

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 BookHook

type BookHook func(context.Context, boil.ContextExecutor, *Book) error

BookHook is the signature for custom Book hook methods

type BookSlice

type BookSlice []*Book

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

func (BookSlice) DeleteAll

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

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

func (*BookSlice) ReloadAll

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

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

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

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

func (o *Lending) Book(mods ...qm.QueryMod) bookQuery

Book pointed to by the foreign key.

func (*Lending) Delete

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

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

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

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

type LendingHook func(context.Context, boil.ContextExecutor, *Lending) error

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.

type M

type M map[string]interface{}

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

Jump to

Keyboard shortcuts

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