Documentation ¶
Index ¶
- Constants
- Variables
- func AppendInt64(ctx context.Context, db generated.DB, name string, value interface{}, ...) (int64, error)
- func CountQuery(ctx context.Context, db gnorm.DB, where gnorm.WhereClause) (int, error)
- func Delete(ctx context.Context, db generated.DB, id int) (int64, error)
- func DeleteAll(ctx context.Context, db generated.DB) (int64, error)
- func DeleteWhere(ctx context.Context, db generated.DB, where generated.WhereClause) (int64, error)
- func Inc(ctx context.Context, db generated.DB, inc generated.Where, ...) (int64, error)
- func Insert(ctx context.Context, db generated.DB, r *Row) error
- func InsertIgnore(ctx context.Context, db gnorm.DB, r *Row, constraint string) error
- func Set(ctx context.Context, db generated.DB, set generated.Where, ...) (int64, error)
- func Upsert(ctx context.Context, db generated.DB, r *Row) error
- type Row
- func All(ctx context.Context, db generated.DB) ([]*Row, error)
- func Find(ctx context.Context, db generated.DB, id int) (*Row, error)
- func First(ctx context.Context, db generated.DB, where generated.WhereClause, ...) (*Row, error)
- func One(ctx context.Context, db generated.DB, where generated.WhereClause) (*Row, error)
- func Query(ctx context.Context, db generated.DB, where generated.WhereClause) ([]*Row, error)
- func QueryOrder(ctx context.Context, db generated.DB, where generated.WhereClause, ...) ([]*Row, error)
Constants ¶
View Source
const TableName = "books"
TableName is the primary table that this particular gnormed file deals with.
Variables ¶
View Source
var ( AuthorIDCol generated.UuidUUIDField = "author_id" AvailableCol generated.TimeTimeField = "available" BooktypeCol enum.BookTypeField = "booktype" IDCol generated.IntField = "id" IsbnCol generated.StringField = "isbn" PagesCol generated.IntField = "pages" SummaryCol generated.SqlNullStringField = "summary" TitleCol generated.StringField = "title" )
Field values for every column in Books.
Functions ¶
func AppendInt64 ¶
func AppendInt64(ctx context.Context, db generated.DB, name string, value interface{}, where generated.WhereClause) (int64, error)
AppendInt64 adds a value to a field
func CountQuery ¶
CountQuery retrieve one row from 'books'.
func DeleteAll ¶
DeleteAll deletes all Rows from the database and returns the number of rows deleted.
func DeleteWhere ¶
DeleteWhere deletes Rows from the database and returns the number of rows deleted.
func Inc ¶
func Inc(ctx context.Context, db generated.DB, inc generated.Where, where generated.WhereClause) (int64, error)
Inc increments the value of a single column on an existing row in the database.
func InsertIgnore ¶
InsertIgnore inserts the row into the database but ignores conflicts
Types ¶
type Row ¶
type Row struct { ID int // id (PK) AuthorID uuid.UUID // author_id Available time.Time // available Booktype enum.BookType // booktype Isbn string // isbn Pages int // pages Summary sql.NullString // summary Title string // title }
Row represents a row from 'books'.
func First ¶
func First(ctx context.Context, db generated.DB, where generated.WhereClause, orderby generated.OrderBy) (*Row, error)
First retrieve one row from 'books' when sorted by orderby.
Click to show internal directories.
Click to hide internal directories.