models

package
v0.0.0-...-feac9d9 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2017 License: MIT Imports: 9 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'.

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

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 Category

type Category struct {
	Snowflake   int64          `json:"snowflake"`   // snowflake
	CreatedAt   *time.Time     `json:"created_at"`  // created_at
	DeletedAt   pq.NullTime    `json:"deleted_at"`  // deleted_at
	Title       string         `json:"title"`       // title
	Description sql.NullString `json:"description"` // description
	Color       sql.NullInt64  `json:"color"`       // color
	// contains filtered or unexported fields
}

Category represents a row from 'public.categories'.

func CategoriesByTitle

func CategoriesByTitle(db XODB, title string) ([]*Category, error)

CategoriesByTitle retrieves a row from 'public.categories' as a Category.

Generated from index 'categories_title_index'.

func CategoryBySnowflake

func CategoryBySnowflake(db XODB, snowflake int64) (*Category, error)

CategoryBySnowflake retrieves a row from 'public.categories' as a Category.

Generated from index 'categories_pkey'.

func CategoryByTitle

func CategoryByTitle(db XODB, title string) (*Category, error)

CategoryByTitle retrieves a row from 'public.categories' as a Category.

Generated from index 'categories_title_key'.

func (*Category) Delete

func (c *Category) Delete(db XODB) error

Delete deletes the Category from the database.

func (*Category) Deleted

func (c *Category) Deleted() bool

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

func (*Category) Exists

func (c *Category) Exists() bool

Exists determines if the Category exists in the database.

func (*Category) Insert

func (c *Category) Insert(db XODB) error

Insert inserts the Category to the database.

func (*Category) Save

func (c *Category) Save(db XODB) error

Save saves the Category to the database.

func (*Category) Update

func (c *Category) Update(db XODB) error

Update updates the Category in the database.

func (*Category) Upsert

func (c *Category) Upsert(db XODB) error

Upsert performs an upsert for Category.

NOTE: PostgreSQL 9.5+ only

type Group

type Group struct {
	Snowflake  int64         `json:"snowflake"`  // snowflake
	CreatedAt  *time.Time    `json:"created_at"` // created_at
	DeletedAt  pq.NullTime   `json:"deleted_at"` // deleted_at
	Name       string        `json:"name"`       // name
	Permission []byte        `json:"permission"` // permission
	ParentID   sql.NullInt64 `json:"parent_id"`  // parent_id
	// contains filtered or unexported fields
}

Group represents a row from 'public.groups'.

func GroupByName

func GroupByName(db XODB, name string) (*Group, error)

GroupByName retrieves a row from 'public.groups' as a Group.

Generated from index 'groups_name_key'.

func GroupBySnowflake

func GroupBySnowflake(db XODB, snowflake int64) (*Group, error)

GroupBySnowflake retrieves a row from 'public.groups' as a Group.

Generated from index 'groups_pkey'.

func GroupsByName

func GroupsByName(db XODB, name string) ([]*Group, error)

GroupsByName retrieves a row from 'public.groups' as a Group.

Generated from index 'groups_name_index'.

func GroupsByParentID

func GroupsByParentID(db XODB, parentID sql.NullInt64) ([]*Group, error)

GroupsByParentID retrieves a row from 'public.groups' as a Group.

Generated from index 'groups_parent_index'.

func (*Group) Delete

func (g *Group) Delete(db XODB) error

Delete deletes the Group from the database.

func (*Group) Deleted

func (g *Group) Deleted() bool

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

func (*Group) Exists

func (g *Group) Exists() bool

Exists determines if the Group exists in the database.

func (*Group) Group

func (g *Group) Group(db XODB) (*Group, error)

Group returns the Group associated with the Group's ParentID (parent_id).

Generated from foreign key 'groups_parent_id_fkey'.

func (*Group) Insert

func (g *Group) Insert(db XODB) error

Insert inserts the Group to the database.

func (*Group) Save

func (g *Group) Save(db XODB) error

Save saves the Group to the database.

func (*Group) Update

func (g *Group) Update(db XODB) error

Update updates the Group in the database.

func (*Group) Upsert

func (g *Group) Upsert(db XODB) error

Upsert performs an upsert for Group.

NOTE: PostgreSQL 9.5+ only

type Login

type Login struct {
	Snowflake  int64       `json:"snowflake"`  // snowflake
	CreatedAt  *time.Time  `json:"created_at"` // created_at
	DeletedAt  pq.NullTime `json:"deleted_at"` // deleted_at
	UserID     int64       `json:"user_id"`    // user_id
	Type       int         `json:"type"`       // type
	Data       []byte      `json:"data"`       // data
	Identifier string      `json:"identifier"` // identifier
	// contains filtered or unexported fields
}

Login represents a row from 'public.logins'.

func LoginByIdentifier

func LoginByIdentifier(db XODB, identifier string) (*Login, error)

LoginByIdentifier retrieves a row from 'public.logins' as a Login.

Generated from index 'logins_identifier_key'.

func LoginBySnowflake

func LoginBySnowflake(db XODB, snowflake int64) (*Login, error)

LoginBySnowflake retrieves a row from 'public.logins' as a Login.

Generated from index 'logins_pkey'.

func LoginsByIdentifier

func LoginsByIdentifier(db XODB, identifier string) ([]*Login, error)

LoginsByIdentifier retrieves a row from 'public.logins' as a Login.

Generated from index 'logins_identifier_index'.

func LoginsByType

func LoginsByType(db XODB, typ int) ([]*Login, error)

LoginsByType retrieves a row from 'public.logins' as a Login.

Generated from index 'logins_type_index'.

func LoginsByUserID

func LoginsByUserID(db XODB, userID int64) ([]*Login, error)

LoginsByUserID retrieves a row from 'public.logins' as a Login.

Generated from index 'logins_login_user_index'.

func (*Login) Delete

func (l *Login) Delete(db XODB) error

Delete deletes the Login from the database.

func (*Login) Deleted

func (l *Login) Deleted() bool

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

func (*Login) Exists

func (l *Login) Exists() bool

Exists determines if the Login exists in the database.

func (*Login) Insert

func (l *Login) Insert(db XODB) error

Insert inserts the Login to the database.

func (*Login) Save

func (l *Login) Save(db XODB) error

Save saves the Login to the database.

func (*Login) Update

func (l *Login) Update(db XODB) error

Update updates the Login in the database.

func (*Login) Upsert

func (l *Login) Upsert(db XODB) error

Upsert performs an upsert for Login.

NOTE: PostgreSQL 9.5+ only

func (*Login) User

func (l *Login) User(db XODB) (*User, error)

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

Generated from foreign key 'logins_user_id_fkey'.

type PrivateMessage

type PrivateMessage struct {
	Snowflake  int64         `json:"snowflake"`   // snowflake
	CreatedAt  *time.Time    `json:"created_at"`  // created_at
	DeletedAt  pq.NullTime   `json:"deleted_at"`  // deleted_at
	Title      string        `json:"title"`       // title
	Body       string        `json:"body"`        // body
	SenderID   int64         `json:"sender_id"`   // sender_id
	ReceiverID int64         `json:"receiver_id"` // receiver_id
	ParentID   sql.NullInt64 `json:"parent_id"`   // parent_id
	// contains filtered or unexported fields
}

PrivateMessage represents a row from 'public.private_messages'.

func PrivateMessageBySnowflake

func PrivateMessageBySnowflake(db XODB, snowflake int64) (*PrivateMessage, error)

PrivateMessageBySnowflake retrieves a row from 'public.private_messages' as a PrivateMessage.

Generated from index 'private_messages_pkey'.

func PrivateMessagesByParentID

func PrivateMessagesByParentID(db XODB, parentID sql.NullInt64) ([]*PrivateMessage, error)

PrivateMessagesByParentID retrieves a row from 'public.private_messages' as a PrivateMessage.

Generated from index 'private_messages_parent_index'.

func PrivateMessagesBySenderID

func PrivateMessagesBySenderID(db XODB, senderID int64) ([]*PrivateMessage, error)

PrivateMessagesBySenderID retrieves a row from 'public.private_messages' as a PrivateMessage.

Generated from index 'private_messages_sender_index'.

func PrivateMessagesBySenderIDReceiverID

func PrivateMessagesBySenderIDReceiverID(db XODB, senderID int64, receiverID int64) ([]*PrivateMessage, error)

PrivateMessagesBySenderIDReceiverID retrieves a row from 'public.private_messages' as a PrivateMessage.

Generated from index 'private_messages_compair_index'.

func (*PrivateMessage) Delete

func (pm *PrivateMessage) Delete(db XODB) error

Delete deletes the PrivateMessage from the database.

func (*PrivateMessage) Deleted

func (pm *PrivateMessage) Deleted() bool

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

func (*PrivateMessage) Exists

func (pm *PrivateMessage) Exists() bool

Exists determines if the PrivateMessage exists in the database.

func (*PrivateMessage) Insert

func (pm *PrivateMessage) Insert(db XODB) error

Insert inserts the PrivateMessage to the database.

func (*PrivateMessage) PrivateMessage

func (pm *PrivateMessage) PrivateMessage(db XODB) (*PrivateMessage, error)

PrivateMessage returns the PrivateMessage associated with the PrivateMessage's ParentID (parent_id).

Generated from foreign key 'private_messages_parent_id_fkey'.

func (*PrivateMessage) Save

func (pm *PrivateMessage) Save(db XODB) error

Save saves the PrivateMessage to the database.

func (*PrivateMessage) Update

func (pm *PrivateMessage) Update(db XODB) error

Update updates the PrivateMessage in the database.

func (*PrivateMessage) Upsert

func (pm *PrivateMessage) Upsert(db XODB) error

Upsert performs an upsert for PrivateMessage.

NOTE: PostgreSQL 9.5+ only

func (*PrivateMessage) UserByReceiverID

func (pm *PrivateMessage) UserByReceiverID(db XODB) (*User, error)

UserByReceiverID returns the User associated with the PrivateMessage's ReceiverID (receiver_id).

Generated from foreign key 'private_messages_receiver_id_fkey'.

func (*PrivateMessage) UserBySenderID

func (pm *PrivateMessage) UserBySenderID(db XODB) (*User, error)

UserBySenderID returns the User associated with the PrivateMessage's SenderID (sender_id).

Generated from foreign key 'private_messages_sender_id_fkey'.

type RelTopicCategory

type RelTopicCategory struct {
	TopicID    int64       `json:"topic_id"`    // topic_id
	CategoryID int64       `json:"category_id"` // category_id
	CreatedAt  *time.Time  `json:"created_at"`  // created_at
	DeletedAt  pq.NullTime `json:"deleted_at"`  // deleted_at
	// contains filtered or unexported fields
}

RelTopicCategory represents a row from 'public.rel_topic_categories'.

func RelTopicCategoriesByCategoryID

func RelTopicCategoriesByCategoryID(db XODB, categoryID int64) ([]*RelTopicCategory, error)

RelTopicCategoriesByCategoryID retrieves a row from 'public.rel_topic_categories' as a RelTopicCategory.

Generated from index 'rel_topic_categories_category_index'.

func RelTopicCategoriesByTopicID

func RelTopicCategoriesByTopicID(db XODB, topicID int64) ([]*RelTopicCategory, error)

RelTopicCategoriesByTopicID retrieves a row from 'public.rel_topic_categories' as a RelTopicCategory.

Generated from index 'rel_topic_categories_topic_index'.

func RelTopicCategoryByTopicIDCategoryID

func RelTopicCategoryByTopicIDCategoryID(db XODB, topicID int64, categoryID int64) (*RelTopicCategory, error)

RelTopicCategoryByTopicIDCategoryID retrieves a row from 'public.rel_topic_categories' as a RelTopicCategory.

Generated from index 'rel_topic_categories_pkey'.

func (*RelTopicCategory) Category

func (rtc *RelTopicCategory) Category(db XODB) (*Category, error)

Category returns the Category associated with the RelTopicCategory's CategoryID (category_id).

Generated from foreign key 'rel_topic_categories_category_id_fkey'.

func (*RelTopicCategory) Delete

func (rtc *RelTopicCategory) Delete(db XODB) error

Delete deletes the RelTopicCategory from the database.

func (*RelTopicCategory) Deleted

func (rtc *RelTopicCategory) Deleted() bool

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

func (*RelTopicCategory) Exists

func (rtc *RelTopicCategory) Exists() bool

Exists determines if the RelTopicCategory exists in the database.

func (*RelTopicCategory) Insert

func (rtc *RelTopicCategory) Insert(db XODB) error

Insert inserts the RelTopicCategory to the database.

func (*RelTopicCategory) Save

func (rtc *RelTopicCategory) Save(db XODB) error

Save saves the RelTopicCategory to the database.

func (*RelTopicCategory) Topic

func (rtc *RelTopicCategory) Topic(db XODB) (*Topic, error)

Topic returns the Topic associated with the RelTopicCategory's TopicID (topic_id).

Generated from foreign key 'rel_topic_categories_topic_id_fkey'.

func (*RelTopicCategory) Update

func (rtc *RelTopicCategory) Update(db XODB) error

Update updates the RelTopicCategory in the database.

func (*RelTopicCategory) Upsert

func (rtc *RelTopicCategory) Upsert(db XODB) error

Upsert performs an upsert for RelTopicCategory.

NOTE: PostgreSQL 9.5+ only

type RelUserGroup

type RelUserGroup struct {
	UserID    int64       `json:"user_id"`    // user_id
	GroupID   int64       `json:"group_id"`   // group_id
	CreatedAt *time.Time  `json:"created_at"` // created_at
	DeletedAt pq.NullTime `json:"deleted_at"` // deleted_at
	// contains filtered or unexported fields
}

RelUserGroup represents a row from 'public.rel_user_groups'.

func RelUserGroupByUserIDGroupID

func RelUserGroupByUserIDGroupID(db XODB, userID int64, groupID int64) (*RelUserGroup, error)

RelUserGroupByUserIDGroupID retrieves a row from 'public.rel_user_groups' as a RelUserGroup.

Generated from index 'rel_user_groups_pkey'.

func RelUserGroupsByGroupID

func RelUserGroupsByGroupID(db XODB, groupID int64) ([]*RelUserGroup, error)

RelUserGroupsByGroupID retrieves a row from 'public.rel_user_groups' as a RelUserGroup.

Generated from index 'rel_user_groups_group_index'.

func RelUserGroupsByUserID

func RelUserGroupsByUserID(db XODB, userID int64) ([]*RelUserGroup, error)

RelUserGroupsByUserID retrieves a row from 'public.rel_user_groups' as a RelUserGroup.

Generated from index 'rel_user_groups_user_index'.

func (*RelUserGroup) Delete

func (rug *RelUserGroup) Delete(db XODB) error

Delete deletes the RelUserGroup from the database.

func (*RelUserGroup) Deleted

func (rug *RelUserGroup) Deleted() bool

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

func (*RelUserGroup) Exists

func (rug *RelUserGroup) Exists() bool

Exists determines if the RelUserGroup exists in the database.

func (*RelUserGroup) Group

func (rug *RelUserGroup) Group(db XODB) (*Group, error)

Group returns the Group associated with the RelUserGroup's GroupID (group_id).

Generated from foreign key 'rel_user_groups_group_id_fkey'.

func (*RelUserGroup) Insert

func (rug *RelUserGroup) Insert(db XODB) error

Insert inserts the RelUserGroup to the database.

func (*RelUserGroup) Save

func (rug *RelUserGroup) Save(db XODB) error

Save saves the RelUserGroup to the database.

func (*RelUserGroup) Update

func (rug *RelUserGroup) Update(db XODB) error

Update updates the RelUserGroup in the database.

func (*RelUserGroup) Upsert

func (rug *RelUserGroup) Upsert(db XODB) error

Upsert performs an upsert for RelUserGroup.

NOTE: PostgreSQL 9.5+ only

func (*RelUserGroup) User

func (rug *RelUserGroup) User(db XODB) (*User, error)

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

Generated from foreign key 'rel_user_groups_user_id_fkey'.

type Reply

type Reply struct {
	Snowflake int64         `json:"snowflake"`  // snowflake
	CreatedAt *time.Time    `json:"created_at"` // created_at
	DeletedAt pq.NullTime   `json:"deleted_at"` // deleted_at
	AuthorID  sql.NullInt64 `json:"author_id"`  // author_id
	Body      string        `json:"body"`       // body
	ParentID  sql.NullInt64 `json:"parent_id"`  // parent_id
	TopicID   int64         `json:"topic_id"`   // topic_id
	// contains filtered or unexported fields
}

Reply represents a row from 'public.replies'.

func RepliesByAuthorID

func RepliesByAuthorID(db XODB, authorID sql.NullInt64) ([]*Reply, error)

RepliesByAuthorID retrieves a row from 'public.replies' as a Reply.

Generated from index 'replies_author_index'.

func RepliesByParentID

func RepliesByParentID(db XODB, parentID sql.NullInt64) ([]*Reply, error)

RepliesByParentID retrieves a row from 'public.replies' as a Reply.

Generated from index 'replies_parent_index'.

func RepliesByTopicID

func RepliesByTopicID(db XODB, topicID int64) ([]*Reply, error)

RepliesByTopicID retrieves a row from 'public.replies' as a Reply.

Generated from index 'replies_topic_index'.

func ReplyBySnowflake

func ReplyBySnowflake(db XODB, snowflake int64) (*Reply, error)

ReplyBySnowflake retrieves a row from 'public.replies' as a Reply.

Generated from index 'replies_pkey'.

func (*Reply) Delete

func (r *Reply) Delete(db XODB) error

Delete deletes the Reply from the database.

func (*Reply) Deleted

func (r *Reply) Deleted() bool

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

func (*Reply) Exists

func (r *Reply) Exists() bool

Exists determines if the Reply exists in the database.

func (*Reply) Insert

func (r *Reply) Insert(db XODB) error

Insert inserts the Reply to the database.

func (*Reply) Reply

func (r *Reply) Reply(db XODB) (*Reply, error)

Reply returns the Reply associated with the Reply's ParentID (parent_id).

Generated from foreign key 'replies_parent_id_fkey'.

func (*Reply) Save

func (r *Reply) Save(db XODB) error

Save saves the Reply to the database.

func (*Reply) Topic

func (r *Reply) Topic(db XODB) (*Topic, error)

Topic returns the Topic associated with the Reply's TopicID (topic_id).

Generated from foreign key 'replies_topic_id_fkey'.

func (*Reply) Update

func (r *Reply) Update(db XODB) error

Update updates the Reply in the database.

func (*Reply) Upsert

func (r *Reply) Upsert(db XODB) error

Upsert performs an upsert for Reply.

NOTE: PostgreSQL 9.5+ only

func (*Reply) User

func (r *Reply) User(db XODB) (*User, error)

User returns the User associated with the Reply's AuthorID (author_id).

Generated from foreign key 'replies_author_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 Topic

type Topic struct {
	Snowflake int64         `json:"snowflake"`  // snowflake
	CreatedAt *time.Time    `json:"created_at"` // created_at
	DeletedAt pq.NullTime   `json:"deleted_at"` // deleted_at
	AuthorID  sql.NullInt64 `json:"author_id"`  // author_id
	Title     string        `json:"title"`      // title
	Body      string        `json:"body"`       // body
	Revision  int64         `json:"revision"`   // revision
	// contains filtered or unexported fields
}

Topic represents a row from 'public.topics'.

func TopicBySnowflake

func TopicBySnowflake(db XODB, snowflake int64) (*Topic, error)

TopicBySnowflake retrieves a row from 'public.topics' as a Topic.

Generated from index 'topics_pkey'.

func TopicBySnowflakeRevision

func TopicBySnowflakeRevision(db XODB, snowflake int64, revision int64) (*Topic, error)

TopicBySnowflakeRevision retrieves a row from 'public.topics' as a Topic.

Generated from index 'topics_snowflake_revision_key'.

func TopicsByAuthorID

func TopicsByAuthorID(db XODB, authorID sql.NullInt64) ([]*Topic, error)

TopicsByAuthorID retrieves a row from 'public.topics' as a Topic.

Generated from index 'topics_author_index'.

func TopicsByRevision

func TopicsByRevision(db XODB, revision int64) ([]*Topic, error)

TopicsByRevision retrieves a row from 'public.topics' as a Topic.

Generated from index 'topics_revision_index'.

func TopicsBySnowflakeRevision

func TopicsBySnowflakeRevision(db XODB, snowflake int64, revision int64) ([]*Topic, error)

TopicsBySnowflakeRevision retrieves a row from 'public.topics' as a Topic.

Generated from index 'topics_id_revision_index'.

func (*Topic) Delete

func (t *Topic) Delete(db XODB) error

Delete deletes the Topic from the database.

func (*Topic) Deleted

func (t *Topic) Deleted() bool

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

func (*Topic) Exists

func (t *Topic) Exists() bool

Exists determines if the Topic exists in the database.

func (*Topic) Insert

func (t *Topic) Insert(db XODB) error

Insert inserts the Topic to the database.

func (*Topic) Save

func (t *Topic) Save(db XODB) error

Save saves the Topic to the database.

func (*Topic) Update

func (t *Topic) Update(db XODB) error

Update updates the Topic in the database.

func (*Topic) Upsert

func (t *Topic) Upsert(db XODB) error

Upsert performs an upsert for Topic.

NOTE: PostgreSQL 9.5+ only

func (*Topic) User

func (t *Topic) User(db XODB) (*User, error)

User returns the User associated with the Topic's AuthorID (author_id).

Generated from foreign key 'topics_author_id_fkey'.

type User

type User struct {
	Snowflake int64          `json:"snowflake"`  // snowflake
	CreatedAt *time.Time     `json:"created_at"` // created_at
	DeletedAt pq.NullTime    `json:"deleted_at"` // deleted_at
	Username  string         `json:"username"`   // username
	Email     sql.NullString `json:"email"`      // email
	Avatar    []byte         `json:"avatar"`     // avatar
	// contains filtered or unexported fields
}

User represents a row from 'public.users'.

func UserByEmail

func UserByEmail(db XODB, email sql.NullString) (*User, error)

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

Generated from index 'users_email_key'.

func UserBySnowflake

func UserBySnowflake(db XODB, snowflake int64) (*User, error)

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

Generated from index 'users_pkey'.

func UserByUsername

func UserByUsername(db XODB, username string) (*User, error)

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

Generated from index 'users_username_key'.

func UsersByEmail

func UsersByEmail(db XODB, email sql.NullString) ([]*User, error)

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

Generated from index 'users_email_index'.

func UsersByUsername

func UsersByUsername(db XODB, username string) ([]*User, error)

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

Generated from index 'users_username_index'.

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