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'.
Package models contains the types for schema 'public'.
Index ¶
Constants ¶
const ( // FictionBookType is the book_type for 'FICTION'. FictionBookType = BookType(1) // NonfictionBookType is the book_type for 'NONFICTION'. NonfictionBookType = BookType(2) )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Author ¶
type Author struct { AuthorID int // author_id Isbn string // isbn Name string // name Subject string // subject // contains filtered or unexported fields }
Author represents a row from public.authors.
func AuthorByAuthorID ¶
AuthorByAuthorID retrieves a row from public.authors as a Author.
Looks up using index authors_pkey.
func AuthorByIsbn ¶
AuthorByIsbn retrieves a row from public.authors as a Author.
Looks up using index authors_isbn_key.
func AuthorsByName ¶
AuthorsByName retrieves rows from public.authors, each as a Author.
Looks up using index authors_name_idx.
func (*Author) Deleted ¶
Deleted provides information if the Author has been deleted from the database.
type Book ¶
type Book struct { BookID int // book_id AuthorID int // author_id Title string // title Booktype BookType // booktype Year int // year // contains filtered or unexported fields }
Book represents a row from public.books.
func BookByBookID ¶
BookByBookID retrieves a row from public.books as a Book.
Looks up using index books_pkey.
func BooksByTitle ¶
BooksByTitle retrieves rows from public.books, each as a Book.
Looks up using index books_title_idx.
type BookType ¶
type BookType uint16
BookType is the 'book_type' enum type.
func (BookType) MarshalText ¶
MarshalText marshals BookType into text.
func (*BookType) UnmarshalText ¶
UnmarshalText unmarshals BookType from text.
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 public.
This should work with database/sql.DB and database/sql.Tx.