models

package
v0.0.0-...-d42fbf4 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2017 License: GPL-3.0 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'.

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

View Source
const (
	// ClassroomRoleStudent is the 'student' ClassroomRole.
	ClassroomRoleStudent = ClassroomRole(1)

	// ClassroomRoleModerator is the 'moderator' ClassroomRole.
	ClassroomRoleModerator = ClassroomRole(2)

	// ClassroomRoleTeacher is the 'teacher' ClassroomRole.
	ClassroomRoleTeacher = ClassroomRole(3)

	// ClassroomRoleAdministrator is the 'administrator' ClassroomRole.
	ClassroomRoleAdministrator = ClassroomRole(4)
)

Variables

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

XOLog provides the log func used by generated queries.

Functions

func GenerateID

func GenerateID(db XODB, v0 int) (int64, error)

GenerateID calls the stored procedure 'public.generate_id(integer) bigint' on db.

Types

type Class

type Class struct {
	ID          int64         `json:"id"`           // id
	Name        string        `json:"name"`         // name
	CurrentUnit sql.NullInt64 `json:"current_unit"` // current_unit
	// contains filtered or unexported fields
}

Class represents a row from 'public.classes'.

func ClassByID

func ClassByID(db XODB, id int64) (*Class, error)

ClassByID retrieves a row from 'public.classes' as a Class.

Generated from index 'classes_pkey'.

func (*Class) Delete

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

Delete deletes the Class from the database.

func (*Class) Deleted

func (c *Class) Deleted() bool

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

func (*Class) Exists

func (c *Class) Exists() bool

Exists determines if the Class exists in the database.

func (*Class) Insert

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

Insert inserts the Class to the database.

func (*Class) Save

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

Save saves the Class to the database.

func (*Class) Unit

func (c *Class) Unit(db XODB) (*Unit, error)

Unit returns the Unit associated with the Class's CurrentUnit (current_unit).

Generated from foreign key 'classes_current_unit_fkey'.

func (*Class) Update

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

Update updates the Class in the database.

func (*Class) Upsert

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

Upsert performs an upsert for Class.

NOTE: PostgreSQL 9.5+ only

type ClassroomRole

type ClassroomRole uint16

ClassroomRole is the 'classroom_role' enum type from schema 'public'.

func (ClassroomRole) MarshalText

func (cr ClassroomRole) MarshalText() ([]byte, error)

MarshalText marshals ClassroomRole into text.

func (*ClassroomRole) Scan

func (cr *ClassroomRole) Scan(src interface{}) error

Scan satisfies the database/sql.Scanner interface for ClassroomRole.

func (ClassroomRole) String

func (cr ClassroomRole) String() string

String returns the string value of the ClassroomRole.

func (*ClassroomRole) UnmarshalText

func (cr *ClassroomRole) UnmarshalText(text []byte) error

UnmarshalText unmarshals ClassroomRole from text.

func (ClassroomRole) Value

func (cr ClassroomRole) Value() (driver.Value, error)

Value satisfies the sql/driver.Valuer interface for ClassroomRole.

type GorpMigration

type GorpMigration struct {
	ID        string      `json:"id"`         // id
	AppliedAt pq.NullTime `json:"applied_at"` // applied_at
	// contains filtered or unexported fields
}

GorpMigration represents a row from 'public.gorp_migrations'.

func GorpMigrationByID

func GorpMigrationByID(db XODB, id string) (*GorpMigration, error)

GorpMigrationByID retrieves a row from 'public.gorp_migrations' as a GorpMigration.

Generated from index 'gorp_migrations_pkey'.

func (*GorpMigration) Delete

func (gm *GorpMigration) Delete(db XODB) error

Delete deletes the GorpMigration from the database.

func (*GorpMigration) Deleted

func (gm *GorpMigration) Deleted() bool

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

func (*GorpMigration) Exists

func (gm *GorpMigration) Exists() bool

Exists determines if the GorpMigration exists in the database.

func (*GorpMigration) Insert

func (gm *GorpMigration) Insert(db XODB) error

Insert inserts the GorpMigration to the database.

func (*GorpMigration) Save

func (gm *GorpMigration) Save(db XODB) error

Save saves the GorpMigration to the database.

func (*GorpMigration) Update

func (gm *GorpMigration) Update(db XODB) error

Update updates the GorpMigration in the database.

func (*GorpMigration) Upsert

func (gm *GorpMigration) Upsert(db XODB) error

Upsert performs an upsert for GorpMigration.

NOTE: PostgreSQL 9.5+ only

type LocalIdentity

type LocalIdentity struct {
	UserID   int64  `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 int64) (*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

type MultipleChoiceAnswer

type MultipleChoiceAnswer struct {
	ID         int64  `json:"id"`          // id
	QuestionID int64  `json:"question_id"` // question_id
	Answer     string `json:"answer"`      // answer
	Correct    bool   `json:"correct"`     // correct
	// contains filtered or unexported fields
}

MultipleChoiceAnswer represents a row from 'public.multiple_choice_answers'.

func MultipleChoiceAnswerByID

func MultipleChoiceAnswerByID(db XODB, id int64) (*MultipleChoiceAnswer, error)

MultipleChoiceAnswerByID retrieves a row from 'public.multiple_choice_answers' as a MultipleChoiceAnswer.

Generated from index 'multiple_choice_answers_pkey'.

func (*MultipleChoiceAnswer) Delete

func (mca *MultipleChoiceAnswer) Delete(db XODB) error

Delete deletes the MultipleChoiceAnswer from the database.

func (*MultipleChoiceAnswer) Deleted

func (mca *MultipleChoiceAnswer) Deleted() bool

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

func (*MultipleChoiceAnswer) Exists

func (mca *MultipleChoiceAnswer) Exists() bool

Exists determines if the MultipleChoiceAnswer exists in the database.

func (*MultipleChoiceAnswer) Insert

func (mca *MultipleChoiceAnswer) Insert(db XODB) error

Insert inserts the MultipleChoiceAnswer to the database.

func (*MultipleChoiceAnswer) MultipleChoiceQuestion

func (mca *MultipleChoiceAnswer) MultipleChoiceQuestion(db XODB) (*MultipleChoiceQuestion, error)

MultipleChoiceQuestion returns the MultipleChoiceQuestion associated with the MultipleChoiceAnswer's QuestionID (question_id).

Generated from foreign key 'multiple_choice_answers_question_id_fkey'.

func (*MultipleChoiceAnswer) Save

func (mca *MultipleChoiceAnswer) Save(db XODB) error

Save saves the MultipleChoiceAnswer to the database.

func (*MultipleChoiceAnswer) Update

func (mca *MultipleChoiceAnswer) Update(db XODB) error

Update updates the MultipleChoiceAnswer in the database.

func (*MultipleChoiceAnswer) Upsert

func (mca *MultipleChoiceAnswer) Upsert(db XODB) error

Upsert performs an upsert for MultipleChoiceAnswer.

NOTE: PostgreSQL 9.5+ only

type MultipleChoiceQuestion

type MultipleChoiceQuestion struct {
	ID            int64         `json:"id"`             // id
	ClassID       int64         `json:"class_id"`       // class_id
	AuthorID      sql.NullInt64 `json:"author_id"`      // author_id
	Question      string        `json:"question"`       // question
	PartialCredit bool          `json:"partial_credit"` // partial_credit
	Timestamp     time.Time     `json:"timestamp"`      // timestamp
	UnitID        int64         `json:"unit_id"`        // unit_id
	// contains filtered or unexported fields
}

MultipleChoiceQuestion represents a row from 'public.multiple_choice_questions'.

func MultipleChoiceQuestionByID

func MultipleChoiceQuestionByID(db XODB, id int64) (*MultipleChoiceQuestion, error)

MultipleChoiceQuestionByID retrieves a row from 'public.multiple_choice_questions' as a MultipleChoiceQuestion.

Generated from index 'multiple_choice_questions_pkey'.

func (*MultipleChoiceQuestion) Class

func (mcq *MultipleChoiceQuestion) Class(db XODB) (*Class, error)

Class returns the Class associated with the MultipleChoiceQuestion's ClassID (class_id).

Generated from foreign key 'multiple_choice_class_fkey'.

func (*MultipleChoiceQuestion) Delete

func (mcq *MultipleChoiceQuestion) Delete(db XODB) error

Delete deletes the MultipleChoiceQuestion from the database.

func (*MultipleChoiceQuestion) Deleted

func (mcq *MultipleChoiceQuestion) Deleted() bool

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

func (*MultipleChoiceQuestion) Exists

func (mcq *MultipleChoiceQuestion) Exists() bool

Exists determines if the MultipleChoiceQuestion exists in the database.

func (*MultipleChoiceQuestion) Insert

func (mcq *MultipleChoiceQuestion) Insert(db XODB) error

Insert inserts the MultipleChoiceQuestion to the database.

func (*MultipleChoiceQuestion) Profile

func (mcq *MultipleChoiceQuestion) Profile(db XODB) (*Profile, error)

Profile returns the Profile associated with the MultipleChoiceQuestion's AuthorID (author_id).

Generated from foreign key 'multiple_choice_author_fkey'.

func (*MultipleChoiceQuestion) Save

func (mcq *MultipleChoiceQuestion) Save(db XODB) error

Save saves the MultipleChoiceQuestion to the database.

func (*MultipleChoiceQuestion) Unit

func (mcq *MultipleChoiceQuestion) Unit(db XODB) (*Unit, error)

Unit returns the Unit associated with the MultipleChoiceQuestion's UnitID (unit_id).

Generated from foreign key 'multiple_choice_unit_id_fkey'.

func (*MultipleChoiceQuestion) Update

func (mcq *MultipleChoiceQuestion) Update(db XODB) error

Update updates the MultipleChoiceQuestion in the database.

func (*MultipleChoiceQuestion) Upsert

func (mcq *MultipleChoiceQuestion) Upsert(db XODB) error

Upsert performs an upsert for MultipleChoiceQuestion.

NOTE: PostgreSQL 9.5+ only

type MultipleChoiceResponse

type MultipleChoiceResponse struct {
	ID         int64         `json:"id"`          // id
	QuestionID sql.NullInt64 `json:"question_id"` // question_id
	AuthorID   int64         `json:"author_id"`   // author_id
	ResponseID int64         `json:"response_id"` // response_id
	// contains filtered or unexported fields
}

MultipleChoiceResponse represents a row from 'public.multiple_choice_responses'.

func MultipleChoiceResponseByID

func MultipleChoiceResponseByID(db XODB, id int64) (*MultipleChoiceResponse, error)

MultipleChoiceResponseByID retrieves a row from 'public.multiple_choice_responses' as a MultipleChoiceResponse.

Generated from index 'multiple_choice_responses_pkey'.

func (*MultipleChoiceResponse) Delete

func (mcr *MultipleChoiceResponse) Delete(db XODB) error

Delete deletes the MultipleChoiceResponse from the database.

func (*MultipleChoiceResponse) Deleted

func (mcr *MultipleChoiceResponse) Deleted() bool

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

func (*MultipleChoiceResponse) Exists

func (mcr *MultipleChoiceResponse) Exists() bool

Exists determines if the MultipleChoiceResponse exists in the database.

func (*MultipleChoiceResponse) Insert

func (mcr *MultipleChoiceResponse) Insert(db XODB) error

Insert inserts the MultipleChoiceResponse to the database.

func (*MultipleChoiceResponse) MultipleChoiceAnswer

func (mcr *MultipleChoiceResponse) MultipleChoiceAnswer(db XODB) (*MultipleChoiceAnswer, error)

MultipleChoiceAnswer returns the MultipleChoiceAnswer associated with the MultipleChoiceResponse's ResponseID (response_id).

Generated from foreign key 'multiple_choice_response_fkey'.

func (*MultipleChoiceResponse) MultipleChoiceQuestion

func (mcr *MultipleChoiceResponse) MultipleChoiceQuestion(db XODB) (*MultipleChoiceQuestion, error)

MultipleChoiceQuestion returns the MultipleChoiceQuestion associated with the MultipleChoiceResponse's QuestionID (question_id).

Generated from foreign key 'multiple_choice_question_fkey'.

func (*MultipleChoiceResponse) Save

func (mcr *MultipleChoiceResponse) Save(db XODB) error

Save saves the MultipleChoiceResponse to the database.

func (*MultipleChoiceResponse) Update

func (mcr *MultipleChoiceResponse) Update(db XODB) error

Update updates the MultipleChoiceResponse in the database.

func (*MultipleChoiceResponse) Upsert

func (mcr *MultipleChoiceResponse) Upsert(db XODB) error

Upsert performs an upsert for MultipleChoiceResponse.

NOTE: PostgreSQL 9.5+ only

type Profile

type Profile struct {
	ID      int64         `json:"id"`       // id
	UserID  int64         `json:"user_id"`  // user_id
	ClassID int64         `json:"class_id"` // class_id
	Role    ClassroomRole `json:"role"`     // role
	// contains filtered or unexported fields
}

Profile represents a row from 'public.profiles'.

func ProfileByID

func ProfileByID(db XODB, id int64) (*Profile, error)

ProfileByID retrieves a row from 'public.profiles' as a Profile.

Generated from index 'profiles_pkey'.

func (*Profile) Class

func (p *Profile) Class(db XODB) (*Class, error)

Class returns the Class associated with the Profile's ClassID (class_id).

Generated from foreign key 'profiles_class_fkey'.

func (*Profile) Delete

func (p *Profile) Delete(db XODB) error

Delete deletes the Profile from the database.

func (*Profile) Deleted

func (p *Profile) Deleted() bool

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

func (*Profile) Exists

func (p *Profile) Exists() bool

Exists determines if the Profile exists in the database.

func (*Profile) Insert

func (p *Profile) Insert(db XODB) error

Insert inserts the Profile to the database.

func (*Profile) Save

func (p *Profile) Save(db XODB) error

Save saves the Profile to the database.

func (*Profile) Update

func (p *Profile) Update(db XODB) error

Update updates the Profile in the database.

func (*Profile) Upsert

func (p *Profile) Upsert(db XODB) error

Upsert performs an upsert for Profile.

NOTE: PostgreSQL 9.5+ only

func (*Profile) User

func (p *Profile) User(db XODB) (*User, error)

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

Generated from foreign key 'profiles_user_id_fkey'.

type QuestionRating

type QuestionRating struct {
	AuthorID   int64 `json:"author_id"`   // author_id
	QuestionID int64 `json:"question_id"` // question_id
	Vote       bool  `json:"vote"`        // vote
}

QuestionRating represents a row from 'public.question_ratings'.

func QuestionRatingByQuestionIDAuthorID

func QuestionRatingByQuestionIDAuthorID(db XODB, questionID int64, authorID int64) (*QuestionRating, error)

QuestionRatingByQuestionIDAuthorID retrieves a row from 'public.question_ratings' as a QuestionRating.

Generated from index 'ratings_question_id_author_id_key'.

func (*QuestionRating) Profile

func (qr *QuestionRating) Profile(db XODB) (*Profile, error)

Profile returns the Profile associated with the QuestionRating's AuthorID (author_id).

Generated from foreign key 'ratings_rater_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 ShortAnswerQuestion

type ShortAnswerQuestion struct {
	ID            int64         `json:"id"`             // id
	ClassID       int64         `json:"class_id"`       // class_id
	AuthorID      sql.NullInt64 `json:"author_id"`      // author_id
	Prompt        string        `json:"prompt"`         // prompt
	MinimumLength sql.NullInt64 `json:"minimum_length"` // minimum_length
	MaximumLength sql.NullInt64 `json:"maximum_length"` // maximum_length
	UnitID        int64         `json:"unit_id"`        // unit_id
	Timestamp     time.Time     `json:"timestamp"`      // timestamp
	// contains filtered or unexported fields
}

ShortAnswerQuestion represents a row from 'public.short_answer_questions'.

func ShortAnswerQuestionByID

func ShortAnswerQuestionByID(db XODB, id int64) (*ShortAnswerQuestion, error)

ShortAnswerQuestionByID retrieves a row from 'public.short_answer_questions' as a ShortAnswerQuestion.

Generated from index 'short_answer_questions_pkey'.

func (*ShortAnswerQuestion) Class

func (saq *ShortAnswerQuestion) Class(db XODB) (*Class, error)

Class returns the Class associated with the ShortAnswerQuestion's ClassID (class_id).

Generated from foreign key 'short_answer_class_fkey'.

func (*ShortAnswerQuestion) Delete

func (saq *ShortAnswerQuestion) Delete(db XODB) error

Delete deletes the ShortAnswerQuestion from the database.

func (*ShortAnswerQuestion) Deleted

func (saq *ShortAnswerQuestion) Deleted() bool

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

func (*ShortAnswerQuestion) Exists

func (saq *ShortAnswerQuestion) Exists() bool

Exists determines if the ShortAnswerQuestion exists in the database.

func (*ShortAnswerQuestion) Insert

func (saq *ShortAnswerQuestion) Insert(db XODB) error

Insert inserts the ShortAnswerQuestion to the database.

func (*ShortAnswerQuestion) Save

func (saq *ShortAnswerQuestion) Save(db XODB) error

Save saves the ShortAnswerQuestion to the database.

func (*ShortAnswerQuestion) Unit

func (saq *ShortAnswerQuestion) Unit(db XODB) (*Unit, error)

Unit returns the Unit associated with the ShortAnswerQuestion's UnitID (unit_id).

Generated from foreign key 'short_answer_unit_id_fkey'.

func (*ShortAnswerQuestion) Update

func (saq *ShortAnswerQuestion) Update(db XODB) error

Update updates the ShortAnswerQuestion in the database.

func (*ShortAnswerQuestion) Upsert

func (saq *ShortAnswerQuestion) Upsert(db XODB) error

Upsert performs an upsert for ShortAnswerQuestion.

NOTE: PostgreSQL 9.5+ only

type ShortAnswerResponse

type ShortAnswerResponse struct {
	ID         int64          `json:"id"`          // id
	QuestionID sql.NullInt64  `json:"question_id"` // question_id
	AuthorID   int64          `json:"author_id"`   // author_id
	Response   sql.NullString `json:"response"`    // response
	// contains filtered or unexported fields
}

ShortAnswerResponse represents a row from 'public.short_answer_responses'.

func ShortAnswerResponseByID

func ShortAnswerResponseByID(db XODB, id int64) (*ShortAnswerResponse, error)

ShortAnswerResponseByID retrieves a row from 'public.short_answer_responses' as a ShortAnswerResponse.

Generated from index 'short_answer_responses_pkey'.

func (*ShortAnswerResponse) Delete

func (sar *ShortAnswerResponse) Delete(db XODB) error

Delete deletes the ShortAnswerResponse from the database.

func (*ShortAnswerResponse) Deleted

func (sar *ShortAnswerResponse) Deleted() bool

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

func (*ShortAnswerResponse) Exists

func (sar *ShortAnswerResponse) Exists() bool

Exists determines if the ShortAnswerResponse exists in the database.

func (*ShortAnswerResponse) Insert

func (sar *ShortAnswerResponse) Insert(db XODB) error

Insert inserts the ShortAnswerResponse to the database.

func (*ShortAnswerResponse) Profile

func (sar *ShortAnswerResponse) Profile(db XODB) (*Profile, error)

Profile returns the Profile associated with the ShortAnswerResponse's AuthorID (author_id).

Generated from foreign key 'short_answer_author_fkey'.

func (*ShortAnswerResponse) Save

func (sar *ShortAnswerResponse) Save(db XODB) error

Save saves the ShortAnswerResponse to the database.

func (*ShortAnswerResponse) ShortAnswerQuestion

func (sar *ShortAnswerResponse) ShortAnswerQuestion(db XODB) (*ShortAnswerQuestion, error)

ShortAnswerQuestion returns the ShortAnswerQuestion associated with the ShortAnswerResponse's QuestionID (question_id).

Generated from foreign key 'short_answer_question_fkey'.

func (*ShortAnswerResponse) Update

func (sar *ShortAnswerResponse) Update(db XODB) error

Update updates the ShortAnswerResponse in the database.

func (*ShortAnswerResponse) Upsert

func (sar *ShortAnswerResponse) Upsert(db XODB) error

Upsert performs an upsert for ShortAnswerResponse.

NOTE: PostgreSQL 9.5+ only

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 TrueFalseQuestion

type TrueFalseQuestion struct {
	ID            int64         `json:"id"`             // id
	ClassID       int64         `json:"class_id"`       // class_id
	AuthorID      sql.NullInt64 `json:"author_id"`      // author_id
	Question      string        `json:"question"`       // question
	CorrectAnswer bool          `json:"correct_answer"` // correct_answer
	UnitID        int64         `json:"unit_id"`        // unit_id
	Timestamp     time.Time     `json:"timestamp"`      // timestamp
	// contains filtered or unexported fields
}

TrueFalseQuestion represents a row from 'public.true_false_questions'.

func TrueFalseQuestionByID

func TrueFalseQuestionByID(db XODB, id int64) (*TrueFalseQuestion, error)

TrueFalseQuestionByID retrieves a row from 'public.true_false_questions' as a TrueFalseQuestion.

Generated from index 'true_false_questions_pkey'.

func (*TrueFalseQuestion) Class

func (tfq *TrueFalseQuestion) Class(db XODB) (*Class, error)

Class returns the Class associated with the TrueFalseQuestion's ClassID (class_id).

Generated from foreign key 'true_false_class_id_fkey'.

func (*TrueFalseQuestion) Delete

func (tfq *TrueFalseQuestion) Delete(db XODB) error

Delete deletes the TrueFalseQuestion from the database.

func (*TrueFalseQuestion) Deleted

func (tfq *TrueFalseQuestion) Deleted() bool

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

func (*TrueFalseQuestion) Exists

func (tfq *TrueFalseQuestion) Exists() bool

Exists determines if the TrueFalseQuestion exists in the database.

func (*TrueFalseQuestion) Insert

func (tfq *TrueFalseQuestion) Insert(db XODB) error

Insert inserts the TrueFalseQuestion to the database.

func (*TrueFalseQuestion) Profile

func (tfq *TrueFalseQuestion) Profile(db XODB) (*Profile, error)

Profile returns the Profile associated with the TrueFalseQuestion's AuthorID (author_id).

Generated from foreign key 'true_false_author_id_fkey'.

func (*TrueFalseQuestion) Save

func (tfq *TrueFalseQuestion) Save(db XODB) error

Save saves the TrueFalseQuestion to the database.

func (*TrueFalseQuestion) Unit

func (tfq *TrueFalseQuestion) Unit(db XODB) (*Unit, error)

Unit returns the Unit associated with the TrueFalseQuestion's UnitID (unit_id).

Generated from foreign key 'true_false_unit_id_fkey'.

func (*TrueFalseQuestion) Update

func (tfq *TrueFalseQuestion) Update(db XODB) error

Update updates the TrueFalseQuestion in the database.

func (*TrueFalseQuestion) Upsert

func (tfq *TrueFalseQuestion) Upsert(db XODB) error

Upsert performs an upsert for TrueFalseQuestion.

NOTE: PostgreSQL 9.5+ only

type TrueFalseResponse

type TrueFalseResponse struct {
	ID         int64         `json:"id"`          // id
	QuestionID int64         `json:"question_id"` // question_id
	AuthorID   sql.NullInt64 `json:"author_id"`   // author_id
	Response   bool          `json:"response"`    // response
	// contains filtered or unexported fields
}

TrueFalseResponse represents a row from 'public.true_false_responses'.

func TrueFalseResponseByID

func TrueFalseResponseByID(db XODB, id int64) (*TrueFalseResponse, error)

TrueFalseResponseByID retrieves a row from 'public.true_false_responses' as a TrueFalseResponse.

Generated from index 'true_false_responses_pkey'.

func (*TrueFalseResponse) Delete

func (tfr *TrueFalseResponse) Delete(db XODB) error

Delete deletes the TrueFalseResponse from the database.

func (*TrueFalseResponse) Deleted

func (tfr *TrueFalseResponse) Deleted() bool

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

func (*TrueFalseResponse) Exists

func (tfr *TrueFalseResponse) Exists() bool

Exists determines if the TrueFalseResponse exists in the database.

func (*TrueFalseResponse) Insert

func (tfr *TrueFalseResponse) Insert(db XODB) error

Insert inserts the TrueFalseResponse to the database.

func (*TrueFalseResponse) Save

func (tfr *TrueFalseResponse) Save(db XODB) error

Save saves the TrueFalseResponse to the database.

func (*TrueFalseResponse) TrueFalseQuestionByAuthorID

func (tfr *TrueFalseResponse) TrueFalseQuestionByAuthorID(db XODB) (*TrueFalseQuestion, error)

TrueFalseQuestionByAuthorID returns the TrueFalseQuestion associated with the TrueFalseResponse's AuthorID (author_id).

Generated from foreign key 'true_false_author_fkey'.

func (*TrueFalseResponse) TrueFalseQuestionByQuestionID

func (tfr *TrueFalseResponse) TrueFalseQuestionByQuestionID(db XODB) (*TrueFalseQuestion, error)

TrueFalseQuestionByQuestionID returns the TrueFalseQuestion associated with the TrueFalseResponse's QuestionID (question_id).

Generated from foreign key 'true_false_question_fkey'.

func (*TrueFalseResponse) Update

func (tfr *TrueFalseResponse) Update(db XODB) error

Update updates the TrueFalseResponse in the database.

func (*TrueFalseResponse) Upsert

func (tfr *TrueFalseResponse) Upsert(db XODB) error

Upsert performs an upsert for TrueFalseResponse.

NOTE: PostgreSQL 9.5+ only

type Unit

type Unit struct {
	ID      int64          `json:"id"`       // id
	ClassID int64          `json:"class_id"` // class_id
	Name    sql.NullString `json:"name"`     // name
	Weight  int            `json:"weight"`   // weight
	// contains filtered or unexported fields
}

Unit represents a row from 'public.units'.

func UnitByID

func UnitByID(db XODB, id int64) (*Unit, error)

UnitByID retrieves a row from 'public.units' as a Unit.

Generated from index 'units_pkey'.

func (*Unit) Class

func (u *Unit) Class(db XODB) (*Class, error)

Class returns the Class associated with the Unit's ClassID (class_id).

Generated from foreign key 'units_class_id_fkey'.

func (*Unit) Delete

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

Delete deletes the Unit from the database.

func (*Unit) Deleted

func (u *Unit) Deleted() bool

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

func (*Unit) Exists

func (u *Unit) Exists() bool

Exists determines if the Unit exists in the database.

func (*Unit) Insert

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

Insert inserts the Unit to the database.

func (*Unit) Save

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

Save saves the Unit to the database.

func (*Unit) Update

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

Update updates the Unit in the database.

func (*Unit) Upsert

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

Upsert performs an upsert for Unit.

NOTE: PostgreSQL 9.5+ only

type User

type User struct {
	ID    int64  `json:"id"`    // id
	Name  string `json:"name"`  // name
	Email string `json:"email"` // email
	// contains filtered or unexported fields
}

User represents a row from 'public.users'.

func UserByID

func UserByID(db XODB, id int64) (*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