models

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2017 License: GPL-3.0 Imports: 8 Imported by: 0

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'.

Index

Constants

This section is empty.

Variables

View Source
var XOLog = func(string, ...interface{}) {}

XOLog provides the log func used by generated queries.

Functions

This section is empty.

Types

type LocalIdentity

type LocalIdentity struct {
	UserID   uuid.UUID `json:"user_id"`  // user_id
	Password string    `json:"password"` // password
	// contains filtered or unexported fields
}

LocalIdentity represents a row from 'public.local_identities'.

func LocalIdentityByUserID

func LocalIdentityByUserID(db XODB, userID uuid.UUID) (*LocalIdentity, error)

LocalIdentityByUserID retrieves a row from 'public.local_identities' as a LocalIdentity.

Generated from index 'local_identities_pkey'.

func (*LocalIdentity) Delete

func (li *LocalIdentity) Delete(db XODB) error

Delete deletes the LocalIdentity from the database.

func (*LocalIdentity) Deleted

func (li *LocalIdentity) Deleted() bool

Deleted provides information if the LocalIdentity has been deleted from the database.

func (*LocalIdentity) Exists

func (li *LocalIdentity) Exists() bool

Exists determines if the LocalIdentity exists in the database.

func (*LocalIdentity) Insert

func (li *LocalIdentity) Insert(db XODB) error

Insert inserts the LocalIdentity to the database.

func (*LocalIdentity) Save

func (li *LocalIdentity) Save(db XODB) error

Save saves the LocalIdentity to the database.

func (*LocalIdentity) Update

func (li *LocalIdentity) Update(db XODB) error

Update updates the LocalIdentity in the database.

func (*LocalIdentity) Upsert

func (li *LocalIdentity) Upsert(db XODB) error

Upsert performs an upsert for LocalIdentity.

NOTE: PostgreSQL 9.5+ only

func (*LocalIdentity) User

func (li *LocalIdentity) User(db XODB) (*User, error)

User returns the User associated with the LocalIdentity's UserID (user_id).

Generated from foreign key 'local_identities_user_id_fkey'.

type ScannerValuer

type ScannerValuer interface {
	sql.Scanner
	driver.Valuer
}

ScannerValuer is the common interface for types that implement both the database/sql.Scanner and sql/driver.Valuer interfaces.

type Slice

type Slice []ScannerValuer

Slice is a slice of ScannerValuers.

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.

func (StringSlice) Value

func (ss StringSlice) Value() (driver.Value, error)

Value satisfies the driver.Valuer interface for StringSlice.

type User

type User struct {
	ID     uuid.UUID `json:"id"`     // id
	Name   string    `json:"name"`   // name
	Email  string    `json:"email"`  // email
	Active bool      `json:"active"` // active
	// contains filtered or unexported fields
}

User represents a row from 'public.users'.

func UserByEmail

func UserByEmail(db XODB, email string) (*User, error)

UserByEmail retrieves a row from 'public.users' as a User.

Generated from index 'users_email'.

func UserByID

func UserByID(db XODB, id uuid.UUID) (*User, error)

UserByID retrieves a row from 'public.users' as a User.

Generated from index 'users_pkey'.

func (*User) Delete

func (u *User) Delete(db XODB) error

Delete deletes the User from the database.

func (*User) Deleted

func (u *User) Deleted() bool

Deleted provides information if the User has been deleted from the database.

func (*User) Exists

func (u *User) Exists() bool

Exists determines if the User exists in the database.

func (*User) Insert

func (u *User) Insert(db XODB) error

Insert inserts the User to the database.

func (*User) Save

func (u *User) Save(db XODB) error

Save saves the User to the database.

func (*User) Update

func (u *User) Update(db XODB) error

Update updates the User in the database.

func (*User) Upsert

func (u *User) Upsert(db XODB) error

Upsert performs an upsert for User.

NOTE: PostgreSQL 9.5+ only

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.

Jump to

Keyboard shortcuts

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