authors

package
Version: v0.0.0-...-37c7f33 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const TableName = "authors"

TableName is the primary table that this particular gnormed file deals with.

Variables

View Source
var (
	IDCol   generated.UuidUUIDField = "id"
	NameCol generated.StringField   = "name"
)

Field values for every column in Authors.

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

func CountQuery(ctx context.Context, db gnorm.DB, where gnorm.WhereClause) (int, error)

CountQuery retrieve one row from 'authors'.

func Delete

func Delete(ctx context.Context,
	db generated.DB,
	id uuid.UUID,
) (int64, error)

Delete deletes the Row from the database. Returns the number of items deleted.

func DeleteAll

func DeleteAll(ctx context.Context, db generated.DB) (int64, error)

DeleteAll deletes all Rows from the database and returns the number of rows deleted.

func DeleteWhere

func DeleteWhere(ctx context.Context, db generated.DB, where generated.WhereClause) (int64, error)

DeleteWhere deletes Rows from the database and returns the number of rows deleted.

func Inc

Inc increments the value of a single column on an existing row in the database.

func Insert

func Insert(ctx context.Context, db generated.DB, r *Row) error

Insert inserts the row into the database.

func InsertIgnore

func InsertIgnore(ctx context.Context, db gnorm.DB, r *Row, constraint string) error

InsertIgnore inserts the row into the database but ignores conflicts

func Set

Set sets a single column on an existing row in the database.

func Upsert

func Upsert(ctx context.Context, db generated.DB, r *Row) error

Upsert performs an insert-or-update in one DB call for Authors. Unlike insert, upsert requires that you have set any IDs on the row you're upserting. NOTE: PostgreSQL 9.5+ only

Types

type Row

type Row struct {
	ID   uuid.UUID // id (PK)
	Name string    // name
}

Row represents a row from 'authors'.

func All

func All(ctx context.Context, db generated.DB) ([]*Row, error)

All retrieves all rows from 'authors' as a slice of Row.

func Find

func Find(ctx context.Context, db generated.DB,
	id uuid.UUID,
) (*Row, error)

Find retrieves a row from 'authors' by its primary key(s).

func First

func First(ctx context.Context, db generated.DB, where generated.WhereClause, orderby generated.OrderBy) (*Row, error)

First retrieve one row from 'authors' when sorted by orderby.

func One

func One(ctx context.Context, db generated.DB, where generated.WhereClause) (*Row, error)

One retrieve one row from 'authors'.

func Query

func Query(ctx context.Context, db generated.DB, where generated.WhereClause) ([]*Row, error)

Query retrieves rows from 'authors' as a slice of Row.

func QueryOrder

func QueryOrder(ctx context.Context, db generated.DB, where generated.WhereClause, orderby generated.OrderBy) ([]*Row, error)

QueryOrder retrieves rows from 'authors' as a slice of Row in a particular order.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL