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
- Variables
- func GenerateID(db XODB, v0 int) (int64, error)
- type Class
- type ClassroomRole
- type GorpMigration
- func (gm *GorpMigration) Delete(db XODB) error
- func (gm *GorpMigration) Deleted() bool
- func (gm *GorpMigration) Exists() bool
- func (gm *GorpMigration) Insert(db XODB) error
- func (gm *GorpMigration) Save(db XODB) error
- func (gm *GorpMigration) Update(db XODB) error
- func (gm *GorpMigration) Upsert(db XODB) error
- type LocalIdentity
- func (li *LocalIdentity) Delete(db XODB) error
- func (li *LocalIdentity) Deleted() bool
- func (li *LocalIdentity) Exists() bool
- func (li *LocalIdentity) Insert(db XODB) error
- func (li *LocalIdentity) Save(db XODB) error
- func (li *LocalIdentity) Update(db XODB) error
- func (li *LocalIdentity) Upsert(db XODB) error
- type MultipleChoiceAnswer
- func (mca *MultipleChoiceAnswer) Delete(db XODB) error
- func (mca *MultipleChoiceAnswer) Deleted() bool
- func (mca *MultipleChoiceAnswer) Exists() bool
- func (mca *MultipleChoiceAnswer) Insert(db XODB) error
- func (mca *MultipleChoiceAnswer) MultipleChoiceQuestion(db XODB) (*MultipleChoiceQuestion, error)
- func (mca *MultipleChoiceAnswer) Save(db XODB) error
- func (mca *MultipleChoiceAnswer) Update(db XODB) error
- func (mca *MultipleChoiceAnswer) Upsert(db XODB) error
- type MultipleChoiceQuestion
- func (mcq *MultipleChoiceQuestion) Class(db XODB) (*Class, error)
- func (mcq *MultipleChoiceQuestion) Delete(db XODB) error
- func (mcq *MultipleChoiceQuestion) Deleted() bool
- func (mcq *MultipleChoiceQuestion) Exists() bool
- func (mcq *MultipleChoiceQuestion) Insert(db XODB) error
- func (mcq *MultipleChoiceQuestion) Profile(db XODB) (*Profile, error)
- func (mcq *MultipleChoiceQuestion) Save(db XODB) error
- func (mcq *MultipleChoiceQuestion) Unit(db XODB) (*Unit, error)
- func (mcq *MultipleChoiceQuestion) Update(db XODB) error
- func (mcq *MultipleChoiceQuestion) Upsert(db XODB) error
- type MultipleChoiceResponse
- func (mcr *MultipleChoiceResponse) Delete(db XODB) error
- func (mcr *MultipleChoiceResponse) Deleted() bool
- func (mcr *MultipleChoiceResponse) Exists() bool
- func (mcr *MultipleChoiceResponse) Insert(db XODB) error
- func (mcr *MultipleChoiceResponse) MultipleChoiceAnswer(db XODB) (*MultipleChoiceAnswer, error)
- func (mcr *MultipleChoiceResponse) MultipleChoiceQuestion(db XODB) (*MultipleChoiceQuestion, error)
- func (mcr *MultipleChoiceResponse) Save(db XODB) error
- func (mcr *MultipleChoiceResponse) Update(db XODB) error
- func (mcr *MultipleChoiceResponse) Upsert(db XODB) error
- type Profile
- func (p *Profile) Class(db XODB) (*Class, error)
- func (p *Profile) Delete(db XODB) error
- func (p *Profile) Deleted() bool
- func (p *Profile) Exists() bool
- func (p *Profile) Insert(db XODB) error
- func (p *Profile) Save(db XODB) error
- func (p *Profile) Update(db XODB) error
- func (p *Profile) Upsert(db XODB) error
- func (p *Profile) User(db XODB) (*User, error)
- type QuestionRating
- type ScannerValuer
- type ShortAnswerQuestion
- func (saq *ShortAnswerQuestion) Class(db XODB) (*Class, error)
- func (saq *ShortAnswerQuestion) Delete(db XODB) error
- func (saq *ShortAnswerQuestion) Deleted() bool
- func (saq *ShortAnswerQuestion) Exists() bool
- func (saq *ShortAnswerQuestion) Insert(db XODB) error
- func (saq *ShortAnswerQuestion) Save(db XODB) error
- func (saq *ShortAnswerQuestion) Unit(db XODB) (*Unit, error)
- func (saq *ShortAnswerQuestion) Update(db XODB) error
- func (saq *ShortAnswerQuestion) Upsert(db XODB) error
- type ShortAnswerResponse
- func (sar *ShortAnswerResponse) Delete(db XODB) error
- func (sar *ShortAnswerResponse) Deleted() bool
- func (sar *ShortAnswerResponse) Exists() bool
- func (sar *ShortAnswerResponse) Insert(db XODB) error
- func (sar *ShortAnswerResponse) Profile(db XODB) (*Profile, error)
- func (sar *ShortAnswerResponse) Save(db XODB) error
- func (sar *ShortAnswerResponse) ShortAnswerQuestion(db XODB) (*ShortAnswerQuestion, error)
- func (sar *ShortAnswerResponse) Update(db XODB) error
- func (sar *ShortAnswerResponse) Upsert(db XODB) error
- type Slice
- type StringSlice
- type TrueFalseQuestion
- func (tfq *TrueFalseQuestion) Class(db XODB) (*Class, error)
- func (tfq *TrueFalseQuestion) Delete(db XODB) error
- func (tfq *TrueFalseQuestion) Deleted() bool
- func (tfq *TrueFalseQuestion) Exists() bool
- func (tfq *TrueFalseQuestion) Insert(db XODB) error
- func (tfq *TrueFalseQuestion) Profile(db XODB) (*Profile, error)
- func (tfq *TrueFalseQuestion) Save(db XODB) error
- func (tfq *TrueFalseQuestion) Unit(db XODB) (*Unit, error)
- func (tfq *TrueFalseQuestion) Update(db XODB) error
- func (tfq *TrueFalseQuestion) Upsert(db XODB) error
- type TrueFalseResponse
- func (tfr *TrueFalseResponse) Delete(db XODB) error
- func (tfr *TrueFalseResponse) Deleted() bool
- func (tfr *TrueFalseResponse) Exists() bool
- func (tfr *TrueFalseResponse) Insert(db XODB) error
- func (tfr *TrueFalseResponse) Save(db XODB) error
- func (tfr *TrueFalseResponse) TrueFalseQuestionByAuthorID(db XODB) (*TrueFalseQuestion, error)
- func (tfr *TrueFalseResponse) TrueFalseQuestionByQuestionID(db XODB) (*TrueFalseQuestion, error)
- func (tfr *TrueFalseResponse) Update(db XODB) error
- func (tfr *TrueFalseResponse) Upsert(db XODB) error
- type Unit
- type User
- type XODB
Constants ¶
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 ¶
var XOLog = func(string, ...interface{}) {}
XOLog provides the log func used by generated queries.
Functions ¶
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 ¶
ClassByID retrieves a row from 'public.classes' as a Class.
Generated from index 'classes_pkey'.
func (*Class) Deleted ¶
Deleted provides information if the Class has been deleted from the database.
func (*Class) Unit ¶
Unit returns the Unit associated with the Class's CurrentUnit (current_unit).
Generated from foreign key 'classes_current_unit_fkey'.
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.
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 ¶
ProfileByID retrieves a row from 'public.profiles' as a Profile.
Generated from index 'profiles_pkey'.
func (*Profile) Class ¶
Class returns the Class associated with the Profile's ClassID (class_id).
Generated from foreign key 'profiles_class_fkey'.
func (*Profile) Deleted ¶
Deleted provides information if the Profile has been deleted from the database.
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'.
type ScannerValuer ¶
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 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 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 ¶
UnitByID retrieves a row from 'public.units' as a Unit.
Generated from index 'units_pkey'.
func (*Unit) Class ¶
Class returns the Class associated with the Unit's ClassID (class_id).
Generated from foreign key 'units_class_id_fkey'.
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 ¶
UserByID retrieves a row from 'public.users' as a User.
Generated from index 'users_pkey'.
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.
Source Files
¶
- class.xo.go
- classroomrole.xo.go
- gorpmigration.xo.go
- localidentity.xo.go
- multiplechoiceanswer.xo.go
- multiplechoicequestion.xo.go
- multiplechoiceresponse.xo.go
- profile.xo.go
- questionrating.xo.go
- shortanswerquestion.xo.go
- shortanswerresponse.xo.go
- sp_generateid.xo.go
- truefalsequestion.xo.go
- truefalseresponse.xo.go
- unit.xo.go
- user.xo.go
- xo_db.xo.go