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 ¶
- Variables
- type Category
- type Group
- type Login
- func LoginByIdentifier(db XODB, identifier string) (*Login, error)
- func LoginBySnowflake(db XODB, snowflake int64) (*Login, error)
- func LoginsByIdentifier(db XODB, identifier string) ([]*Login, error)
- func LoginsByType(db XODB, typ int) ([]*Login, error)
- func LoginsByUserID(db XODB, userID int64) ([]*Login, error)
- type PrivateMessage
- func PrivateMessageBySnowflake(db XODB, snowflake int64) (*PrivateMessage, error)
- func PrivateMessagesByParentID(db XODB, parentID sql.NullInt64) ([]*PrivateMessage, error)
- func PrivateMessagesBySenderID(db XODB, senderID int64) ([]*PrivateMessage, error)
- func PrivateMessagesBySenderIDReceiverID(db XODB, senderID int64, receiverID int64) ([]*PrivateMessage, error)
- func (pm *PrivateMessage) Delete(db XODB) error
- func (pm *PrivateMessage) Deleted() bool
- func (pm *PrivateMessage) Exists() bool
- func (pm *PrivateMessage) Insert(db XODB) error
- func (pm *PrivateMessage) PrivateMessage(db XODB) (*PrivateMessage, error)
- func (pm *PrivateMessage) Save(db XODB) error
- func (pm *PrivateMessage) Update(db XODB) error
- func (pm *PrivateMessage) Upsert(db XODB) error
- func (pm *PrivateMessage) UserByReceiverID(db XODB) (*User, error)
- func (pm *PrivateMessage) UserBySenderID(db XODB) (*User, error)
- type RelTopicCategory
- func (rtc *RelTopicCategory) Category(db XODB) (*Category, error)
- func (rtc *RelTopicCategory) Delete(db XODB) error
- func (rtc *RelTopicCategory) Deleted() bool
- func (rtc *RelTopicCategory) Exists() bool
- func (rtc *RelTopicCategory) Insert(db XODB) error
- func (rtc *RelTopicCategory) Save(db XODB) error
- func (rtc *RelTopicCategory) Topic(db XODB) (*Topic, error)
- func (rtc *RelTopicCategory) Update(db XODB) error
- func (rtc *RelTopicCategory) Upsert(db XODB) error
- type RelUserGroup
- func (rug *RelUserGroup) Delete(db XODB) error
- func (rug *RelUserGroup) Deleted() bool
- func (rug *RelUserGroup) Exists() bool
- func (rug *RelUserGroup) Group(db XODB) (*Group, error)
- func (rug *RelUserGroup) Insert(db XODB) error
- func (rug *RelUserGroup) Save(db XODB) error
- func (rug *RelUserGroup) Update(db XODB) error
- func (rug *RelUserGroup) Upsert(db XODB) error
- func (rug *RelUserGroup) User(db XODB) (*User, error)
- type Reply
- func (r *Reply) Delete(db XODB) error
- func (r *Reply) Deleted() bool
- func (r *Reply) Exists() bool
- func (r *Reply) Insert(db XODB) error
- func (r *Reply) Reply(db XODB) (*Reply, error)
- func (r *Reply) Save(db XODB) error
- func (r *Reply) Topic(db XODB) (*Topic, error)
- func (r *Reply) Update(db XODB) error
- func (r *Reply) Upsert(db XODB) error
- func (r *Reply) User(db XODB) (*User, error)
- type ScannerValuer
- type Slice
- type StringSlice
- type Topic
- func TopicBySnowflake(db XODB, snowflake int64) (*Topic, error)
- func TopicBySnowflakeRevision(db XODB, snowflake int64, revision int64) (*Topic, error)
- func TopicsByAuthorID(db XODB, authorID sql.NullInt64) ([]*Topic, error)
- func TopicsByRevision(db XODB, revision int64) ([]*Topic, error)
- func TopicsBySnowflakeRevision(db XODB, snowflake int64, revision int64) ([]*Topic, error)
- type User
- func UserByEmail(db XODB, email sql.NullString) (*User, error)
- func UserBySnowflake(db XODB, snowflake int64) (*User, error)
- func UserByUsername(db XODB, username string) (*User, error)
- func UsersByEmail(db XODB, email sql.NullString) ([]*User, error)
- func UsersByUsername(db XODB, username string) ([]*User, error)
- type XODB
Constants ¶
This section is empty.
Variables ¶
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 ¶
CategoriesByTitle retrieves a row from 'public.categories' as a Category.
Generated from index 'categories_title_index'.
func CategoryBySnowflake ¶
CategoryBySnowflake retrieves a row from 'public.categories' as a Category.
Generated from index 'categories_pkey'.
func CategoryByTitle ¶
CategoryByTitle retrieves a row from 'public.categories' as a Category.
Generated from index 'categories_title_key'.
func (*Category) Deleted ¶
Deleted provides information if the Category has been deleted from the database.
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 ¶
GroupByName retrieves a row from 'public.groups' as a Group.
Generated from index 'groups_name_key'.
func GroupBySnowflake ¶
GroupBySnowflake retrieves a row from 'public.groups' as a Group.
Generated from index 'groups_pkey'.
func GroupsByName ¶
GroupsByName retrieves a row from 'public.groups' as a Group.
Generated from index 'groups_name_index'.
func GroupsByParentID ¶
GroupsByParentID retrieves a row from 'public.groups' as a Group.
Generated from index 'groups_parent_index'.
func (*Group) Deleted ¶
Deleted provides information if the Group has been deleted from the database.
func (*Group) Group ¶
Group returns the Group associated with the Group's ParentID (parent_id).
Generated from foreign key 'groups_parent_id_fkey'.
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 ¶
LoginByIdentifier retrieves a row from 'public.logins' as a Login.
Generated from index 'logins_identifier_key'.
func LoginBySnowflake ¶
LoginBySnowflake retrieves a row from 'public.logins' as a Login.
Generated from index 'logins_pkey'.
func LoginsByIdentifier ¶
LoginsByIdentifier retrieves a row from 'public.logins' as a Login.
Generated from index 'logins_identifier_index'.
func LoginsByType ¶
LoginsByType retrieves a row from 'public.logins' as a Login.
Generated from index 'logins_type_index'.
func LoginsByUserID ¶
LoginsByUserID retrieves a row from 'public.logins' as a Login.
Generated from index 'logins_login_user_index'.
func (*Login) Deleted ¶
Deleted provides information if the Login has been deleted from the database.
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
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 ¶
RepliesByAuthorID retrieves a row from 'public.replies' as a Reply.
Generated from index 'replies_author_index'.
func RepliesByParentID ¶
RepliesByParentID retrieves a row from 'public.replies' as a Reply.
Generated from index 'replies_parent_index'.
func RepliesByTopicID ¶
RepliesByTopicID retrieves a row from 'public.replies' as a Reply.
Generated from index 'replies_topic_index'.
func ReplyBySnowflake ¶
ReplyBySnowflake retrieves a row from 'public.replies' as a Reply.
Generated from index 'replies_pkey'.
func (*Reply) Deleted ¶
Deleted provides information if the Reply has been deleted from the database.
func (*Reply) Reply ¶
Reply returns the Reply associated with the Reply's ParentID (parent_id).
Generated from foreign key 'replies_parent_id_fkey'.
func (*Reply) Topic ¶
Topic returns the Topic associated with the Reply's TopicID (topic_id).
Generated from foreign key 'replies_topic_id_fkey'.
type ScannerValuer ¶
ScannerValuer is the common interface for types that implement both the database/sql.Scanner and sql/driver.Valuer interfaces.
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.
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 ¶
TopicBySnowflake retrieves a row from 'public.topics' as a Topic.
Generated from index 'topics_pkey'.
func TopicBySnowflakeRevision ¶
TopicBySnowflakeRevision retrieves a row from 'public.topics' as a Topic.
Generated from index 'topics_snowflake_revision_key'.
func TopicsByAuthorID ¶
TopicsByAuthorID retrieves a row from 'public.topics' as a Topic.
Generated from index 'topics_author_index'.
func TopicsByRevision ¶
TopicsByRevision retrieves a row from 'public.topics' as a Topic.
Generated from index 'topics_revision_index'.
func TopicsBySnowflakeRevision ¶
TopicsBySnowflakeRevision retrieves a row from 'public.topics' as a Topic.
Generated from index 'topics_id_revision_index'.
func (*Topic) Deleted ¶
Deleted provides information if the Topic has been deleted from the database.
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 ¶
UserBySnowflake retrieves a row from 'public.users' as a User.
Generated from index 'users_pkey'.
func UserByUsername ¶
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 ¶
UsersByUsername retrieves a row from 'public.users' as a User.
Generated from index 'users_username_index'.
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.