Documentation ¶
Overview ¶
Package models contains the types for schema 'public'.
Package models contains the types for schema 'public'.
Package models contains the types for schema 'public'.
Package models contains the types for schema 'public'.
Index ¶
- Variables
- type Author
- type AuthorBookResult
- type Book
- func BookByAuthorID(db XODB, authorID int64) (*Book, error)
- func BookByIsbn(db XODB, isbn string) (*Book, error)
- func BooksByAuthorID(db XODB, authorID int64) ([]*Book, error)
- func BooksByTitle(db XODB, title string) ([]*Book, error)
- func BooksByTitleYear(db XODB, title string, year int64) ([]*Book, error)
- type ScannerValuer
- type Slice
- type StringSlice
- type XODB
Constants ¶
This section is empty.
Variables ¶
var XOLog = func(string, ...interface{}) {}
XOLog provides the log func used by generated queries.
Functions ¶
This section is empty.
Types ¶
type Author ¶
type Author struct { AuthorID int64 `json:"author_id"` // author_id Name string `json:"name"` // name // contains filtered or unexported fields }
Author represents a row from 'public.authors'.
func AuthorByAuthorID ¶
AuthorByAuthorID retrieves a row from 'public.authors' as a Author.
Generated from index 'primary'.
func AuthorsByName ¶
AuthorsByName retrieves a row from 'public.authors' as a Author.
Generated from index 'authors_name_idx'.
func (*Author) Deleted ¶
Deleted provides information if the Author has been deleted from the database.
type AuthorBookResult ¶
type AuthorBookResult struct { AuthorID int64 // author_id AuthorName string // author_name BookID int64 // book_id BookIsbn string // book_isbn BookTitle string // book_title BookTags string // book_tags }
AuthorBookResult is the result of a search.
func AuthorBookResultsByTags ¶
func AuthorBookResultsByTags(db XODB, tags string) ([]*AuthorBookResult, error)
AuthorBookResultsByTags runs a custom query, returning results as AuthorBookResult.
type Book ¶
type Book struct { BookID int64 `json:"book_id"` // book_id AuthorID int64 `json:"author_id"` // author_id Isbn string `json:"isbn"` // isbn Booktype string `json:"booktype"` // booktype Title string `json:"title"` // title Year int64 `json:"year"` // year Available time.Time `json:"available"` // available Tags string `json:"tags"` // tags // contains filtered or unexported fields }
Book represents a row from 'public.books'.
func BookByAuthorID ¶
BookByAuthorID retrieves a row from 'public.books' as a Book.
Generated from index 'primary'.
func BookByIsbn ¶
BookByIsbn retrieves a row from 'public.books' as a Book.
Generated from index 'books_isbn_key'.
func BooksByAuthorID ¶
BooksByAuthorID retrieves a row from 'public.books' as a Book.
Generated from index 'books_auto_index_fk_author_id_ref_authors'.
func BooksByTitle ¶
BooksByTitle retrieves a row from 'public.books' as a Book.
Generated from index 'books_title_lower_idx'.
func BooksByTitleYear ¶
BooksByTitleYear retrieves a row from 'public.books' as a Book.
Generated from index 'books_title_year_idx'.
func (*Book) Author ¶
Author returns the Author associated with the Book's AuthorID (author_id).
Generated from foreign key 'fk_author_id_ref_authors'.
type ScannerValuer ¶
ScannerValuer is the common interface for types that implement both the database/sql.Scanner and sql/driver.Valuer interfaces.
type StringSlice ¶
type StringSlice []string
StringSlice is a slice of strings.
func (*StringSlice) Scan ¶
func (ss *StringSlice) Scan(src interface{}) error
Scan satisfies the sql.Scanner interface for StringSlice.
type XODB ¶
type XODB interface { Exec(string, ...interface{}) (sql.Result, error) Query(string, ...interface{}) (*sql.Rows, error) QueryRow(string, ...interface{}) *sql.Row }
XODB is the common interface for database operations that can be used with types from schema 'public'.
This should work with database/sql.DB and database/sql.Tx.