Documentation ¶
Index ¶
- func DeleteExercicesByIDs(tx DB, ids ...int64) ([]int64, error)
- func DeleteQuestionsByIDs(tx DB, ids ...int64) ([]int64, error)
- func DeleteQuestionsByNeedExercices(tx DB, needExercices_ ...int64) ([]int64, error)
- func DeleteTable1sByEx1s(tx DB, ex1s_ ...RepasID) ([]int64, error)
- func DeleteTable1sByEx2s(tx DB, ex2s_ ...RepasID) ([]int64, error)
- func DeleteTable1sByIDs(tx DB, ids ...int64) ([]int64, error)
- func DeleteTable1sByLs(tx DB, ls_ ...int64) ([]int64, error)
- func DeleteTable1sByOthers(tx DB, others_ ...RepasID) ([]int64, error)
- func DeleteWithOptionalTimesByIDs(tx DB, ids ...int64) ([]int64, error)
- func IdExerciceArrayToPQ(ids []IdExercice) pq.Int64Array
- func IdProgressionArrayToPQ(ids []IdProgression) pq.Int64Array
- func InsertExerciceQuestion(db DB, item ExerciceQuestion) error
- func InsertLink(db DB, item Link) error
- func InsertManyExerciceQuestions(tx *sql.Tx, items ...ExerciceQuestion) error
- func InsertManyLinks(tx *sql.Tx, items ...Link) error
- func InsertManyProgressionQuestions(tx *sql.Tx, items ...ProgressionQuestion) error
- func InsertManyQuestionTags(tx *sql.Tx, items ...QuestionTag) error
- func InsertProgressionQuestion(db DB, item ProgressionQuestion) error
- func InsertQuestionTag(db DB, item QuestionTag) error
- func Newint64SetFrom(ids []int64) int64Set
- func RepasIDArrayToPQ(ids []RepasID) pq.Int64Array
- func Scanint64Array(rs *sql.Rows) ([]int64, error)
- type Composite
- type DB
- type DifficultyTag
- type EnumArray
- type Exercice
- type ExerciceQuestion
- type ExerciceQuestions
- func DeleteExerciceQuestionsByIdExercices(tx DB, idExercices_ ...int64) (ExerciceQuestions, error)
- func DeleteExerciceQuestionsByIdQuestionAndBareme(tx DB, idQuestion int64, bareme int16) (item ExerciceQuestions, err error)
- func DeleteExerciceQuestionsByIdQuestions(tx DB, idQuestions_ ...int64) (ExerciceQuestions, error)
- func ScanExerciceQuestions(rs *sql.Rows) (ExerciceQuestions, error)
- func SelectAllExerciceQuestions(db DB) (ExerciceQuestions, error)
- func SelectExerciceQuestionsByIdExercices(tx DB, idExercices_ ...int64) (ExerciceQuestions, error)
- func SelectExerciceQuestionsByIdQuestionAndBareme(tx DB, idQuestion int64, bareme int16) (item ExerciceQuestions, err error)
- func SelectExerciceQuestionsByIdQuestions(tx DB, idQuestions_ ...int64) (ExerciceQuestions, error)
- type Exercices
- type FixedArray
- type IDInvalid
- type IdExercice
- type IdExerciceSet
- type IdProgression
- type IdProgressionSet
- type Link
- type Links
- type LocalEnum
- type Map
- type Progression
- func DeleteProgressionById(tx DB, id IdProgression) (Progression, error)
- func ScanProgression(row *sql.Row) (Progression, error)
- func SelectProgression(tx DB, id IdProgression) (Progression, error)
- func SelectProgressionByIdAndIdExercice(tx DB, id IdProgression, idExercice int64) (item Progression, found bool, err error)
- type ProgressionQuestion
- type ProgressionQuestions
- func DeleteProgressionQuestionsByIdExercices(tx DB, idExercices_ ...IdExercice) (ProgressionQuestions, error)
- func DeleteProgressionQuestionsByIdProgressions(tx DB, idProgressions_ ...IdProgression) (ProgressionQuestions, error)
- func ScanProgressionQuestions(rs *sql.Rows) (ProgressionQuestions, error)
- func SelectAllProgressionQuestions(db DB) (ProgressionQuestions, error)
- func SelectProgressionQuestionsByIdExercices(tx DB, idExercices_ ...IdExercice) (ProgressionQuestions, error)
- func SelectProgressionQuestionsByIdProgressions(tx DB, idProgressions_ ...IdProgression) (ProgressionQuestions, error)
- func (items ProgressionQuestions) ByIdExercice() map[IdExercice]ProgressionQuestions
- func (items ProgressionQuestions) ByIdProgression() map[IdProgression]ProgressionQuestions
- func (items ProgressionQuestions) IdExercices() []IdExercice
- func (items ProgressionQuestions) IdProgressions() []IdProgression
- type Progressions
- type Question
- type QuestionTag
- type QuestionTags
- type Questions
- type Repas
- type RepasID
- type RepasIDSet
- type Repass
- type Strings
- type Table1
- type Table1s
- func ScanTable1s(rs *sql.Rows) (Table1s, error)
- func SelectAllTable1s(db DB) (Table1s, error)
- func SelectTable1s(tx DB, ids ...int64) (Table1s, error)
- func SelectTable1sByEx1s(tx DB, ex1s_ ...RepasID) (Table1s, error)
- func SelectTable1sByEx2s(tx DB, ex2s_ ...RepasID) (Table1s, error)
- func SelectTable1sByLs(tx DB, ls_ ...int64) (Table1s, error)
- func SelectTable1sByOthers(tx DB, others_ ...RepasID) (Table1s, error)
- type WithOptionalTime
- type WithOptionalTimes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteExercicesByIDs ¶
Deletes the Exercice in the database and returns the ids.
func DeleteQuestionsByIDs ¶
Deletes the Question in the database and returns the ids.
func DeleteTable1sByIDs ¶
Deletes the Table1 in the database and returns the ids.
func DeleteWithOptionalTimesByIDs ¶
Deletes the WithOptionalTime in the database and returns the ids.
func IdExerciceArrayToPQ ¶
func IdExerciceArrayToPQ(ids []IdExercice) pq.Int64Array
func IdProgressionArrayToPQ ¶
func IdProgressionArrayToPQ(ids []IdProgression) pq.Int64Array
func InsertExerciceQuestion ¶
func InsertExerciceQuestion(db DB, item ExerciceQuestion) error
func InsertLink ¶
func InsertManyExerciceQuestions ¶
func InsertManyExerciceQuestions(tx *sql.Tx, items ...ExerciceQuestion) error
Insert the links ExerciceQuestion in the database. It is a no-op if 'items' is empty.
func InsertManyLinks ¶
Insert the links Link in the database. It is a no-op if 'items' is empty.
func InsertManyProgressionQuestions ¶
func InsertManyProgressionQuestions(tx *sql.Tx, items ...ProgressionQuestion) error
Insert the links ProgressionQuestion in the database. It is a no-op if 'items' is empty.
func InsertManyQuestionTags ¶
func InsertManyQuestionTags(tx *sql.Tx, items ...QuestionTag) error
Insert the links QuestionTag in the database. It is a no-op if 'items' is empty.
func InsertProgressionQuestion ¶
func InsertProgressionQuestion(db DB, item ProgressionQuestion) error
func InsertQuestionTag ¶
func InsertQuestionTag(db DB, item QuestionTag) error
func Newint64SetFrom ¶
func Newint64SetFrom(ids []int64) int64Set
func RepasIDArrayToPQ ¶
func RepasIDArrayToPQ(ids []RepasID) pq.Int64Array
Types ¶
type DB ¶
type DB interface { Exec(query string, args ...interface{}) (sql.Result, error) Query(query string, args ...interface{}) (*sql.Rows, error) QueryRow(query string, args ...interface{}) *sql.Row Prepare(query string) (*sql.Stmt, error) }
DB groups transaction like objects, and is implemented by *sql.DB and *sql.Tx
type DifficultyTag ¶
type DifficultyTag string
DifficultyTag are special question tags used to indicate the difficulty of one question. It is used to select question among implicit groups
type EnumArray ¶
type EnumArray []testsource.EnumUInt
type Exercice ¶
type Exercice struct { Id int64 Title string // displayed to the students Description string // used internally by the teachers // Parameters are parameters shared by all the questions, // which are added to the individual ones. // It will be empty for parallel exercices Parameters Map Flow testsource.EnumInt // IdTeacher is the owner of the exercice IdTeacher int64 `json:"id_teacher"` Public bool }
Exercice is the data structure for a full exercice, composed of a list of questions. There are two kinds of exercice :
- parallel : all the questions are independant
- progression : the questions are linked together by a shared Parameters set
func DeleteExerciceById ¶
Deletes the Exercice and returns the item
func SelectExercice ¶
SelectExercice returns the entry matching 'id'.
type ExerciceQuestion ¶
type ExerciceQuestion struct { IdExercice int64 `json:"id_exercice" gomacro-sql-foreign:"Exercice" gomacro-sql-on-delete:"CASCADE"` IdQuestion int64 `json:"id_question" gomacro-sql-foreign:"Question"` Bareme int16 `json:"bareme"` Index int `json:"-" sql:"index"` }
ExerciceQuestion models an ordered list of questions. All link items should be updated at once to preserve `Index` invariants gomacro:SQL ADD PRIMARY KEY (IdExercice, Index) gomacro:SQL _SELECT KEY(IdQuestion, Bareme)
func ScanExerciceQuestion ¶
func ScanExerciceQuestion(row *sql.Row) (ExerciceQuestion, error)
func SelectExerciceQuestionByIdExerciceAndIndex ¶
func SelectExerciceQuestionByIdExerciceAndIndex(tx DB, idExercice int64, index int) (item ExerciceQuestion, found bool, err error)
SelectExerciceQuestionByIdExerciceAndIndex return zero or one item, thanks to a UNIQUE SQL constraint.
func (ExerciceQuestion) Delete ¶
func (item ExerciceQuestion) Delete(tx DB) error
Delete the link ExerciceQuestion from the database. Only the foreign keys IdExercice, IdQuestion fields are used in 'item'.
type ExerciceQuestions ¶
type ExerciceQuestions []ExerciceQuestion
func DeleteExerciceQuestionsByIdExercices ¶
func DeleteExerciceQuestionsByIdExercices(tx DB, idExercices_ ...int64) (ExerciceQuestions, error)
func DeleteExerciceQuestionsByIdQuestionAndBareme ¶
func DeleteExerciceQuestionsByIdQuestionAndBareme(tx DB, idQuestion int64, bareme int16) (item ExerciceQuestions, err error)
DeleteExerciceQuestionsByIdQuestionAndBareme deletes the item matching the given fields, returning the deleted items.
func DeleteExerciceQuestionsByIdQuestions ¶
func DeleteExerciceQuestionsByIdQuestions(tx DB, idQuestions_ ...int64) (ExerciceQuestions, error)
func ScanExerciceQuestions ¶
func ScanExerciceQuestions(rs *sql.Rows) (ExerciceQuestions, error)
func SelectAllExerciceQuestions ¶
func SelectAllExerciceQuestions(db DB) (ExerciceQuestions, error)
SelectAll returns all the items in the exercice_questions table.
func SelectExerciceQuestionsByIdExercices ¶
func SelectExerciceQuestionsByIdExercices(tx DB, idExercices_ ...int64) (ExerciceQuestions, error)
func SelectExerciceQuestionsByIdQuestionAndBareme ¶
func SelectExerciceQuestionsByIdQuestionAndBareme(tx DB, idQuestion int64, bareme int16) (item ExerciceQuestions, err error)
SelectExerciceQuestionsByIdQuestionAndBareme selects the items matching the given fields.
func SelectExerciceQuestionsByIdQuestions ¶
func SelectExerciceQuestionsByIdQuestions(tx DB, idQuestions_ ...int64) (ExerciceQuestions, error)
func (ExerciceQuestions) ByIdExercice ¶
func (items ExerciceQuestions) ByIdExercice() map[int64]ExerciceQuestions
ByIdExercice returns a map with 'IdExercice' as keys.
func (ExerciceQuestions) ByIdQuestion ¶
func (items ExerciceQuestions) ByIdQuestion() map[int64]ExerciceQuestions
ByIdQuestion returns a map with 'IdQuestion' as keys.
func (ExerciceQuestions) IdExercices ¶
func (items ExerciceQuestions) IdExercices() []int64
IdExercices returns the list of ids of IdExercice contained in this link table. They are not garanteed to be distinct.
func (ExerciceQuestions) IdQuestions ¶
func (items ExerciceQuestions) IdQuestions() []int64
IdQuestions returns the list of ids of IdQuestion contained in this link table. They are not garanteed to be distinct.
type Exercices ¶
func SelectAllExercices ¶
SelectAll returns all the items in the exercices table.
func SelectExercices ¶
SelectExercices returns the entry matching the given 'ids'.
type FixedArray ¶
type FixedArray [5]int32
func (*FixedArray) Scan ¶
func (s *FixedArray) Scan(src interface{}) error
type IdExercice ¶
type IdExercice int64
func ScanIdExerciceArray ¶
func ScanIdExerciceArray(rs *sql.Rows) ([]IdExercice, error)
ScanIdExerciceArray scans the result of a query returning a list of ID's.
type IdExerciceSet ¶
type IdExerciceSet map[IdExercice]bool
func NewIdExerciceSetFrom ¶
func NewIdExerciceSetFrom(ids []IdExercice) IdExerciceSet
func (IdExerciceSet) Add ¶
func (s IdExerciceSet) Add(id IdExercice)
func (IdExerciceSet) Has ¶
func (s IdExerciceSet) Has(id IdExercice) bool
func (IdExerciceSet) Keys ¶
func (s IdExerciceSet) Keys() []IdExercice
type IdProgression ¶
type IdProgression int64
func DeleteProgressionsByIDs ¶
func DeleteProgressionsByIDs(tx DB, ids ...IdProgression) ([]IdProgression, error)
Deletes the Progression in the database and returns the ids.
func ScanIdProgressionArray ¶
func ScanIdProgressionArray(rs *sql.Rows) ([]IdProgression, error)
ScanIdProgressionArray scans the result of a query returning a list of ID's.
type IdProgressionSet ¶
type IdProgressionSet map[IdProgression]bool
func NewIdProgressionSetFrom ¶
func NewIdProgressionSetFrom(ids []IdProgression) IdProgressionSet
func (IdProgressionSet) Add ¶
func (s IdProgressionSet) Add(id IdProgression)
func (IdProgressionSet) Has ¶
func (s IdProgressionSet) Has(id IdProgression) bool
func (IdProgressionSet) Keys ¶
func (s IdProgressionSet) Keys() []IdProgression
type Links ¶
type Links []Link
func SelectAllLinks ¶
SelectAll returns all the items in the links table.
type Progression ¶
type Progression struct { Id IdProgression IdExercice int64 `json:"id_exercice" gomacro-sql-on-delete:"CASCADE"` }
Progression is the table storing the student progression for one exercice. Note that this data structure may also be used in memory, for instance for the editor loopback. gomacro:SQL ADD UNIQUE(Id, IdExercice)
func DeleteProgressionById ¶
func DeleteProgressionById(tx DB, id IdProgression) (Progression, error)
Deletes the Progression and returns the item
func ScanProgression ¶
func ScanProgression(row *sql.Row) (Progression, error)
func SelectProgression ¶
func SelectProgression(tx DB, id IdProgression) (Progression, error)
SelectProgression returns the entry matching 'id'.
func SelectProgressionByIdAndIdExercice ¶
func SelectProgressionByIdAndIdExercice(tx DB, id IdProgression, idExercice int64) (item Progression, found bool, err error)
SelectProgressionByIdAndIdExercice return zero or one item, thanks to a UNIQUE SQL constraint.
func (Progression) Insert ¶
func (item Progression) Insert(tx DB) (out Progression, err error)
Insert one Progression in the database and returns the item with id filled.
func (Progression) Update ¶
func (item Progression) Update(tx DB) (out Progression, err error)
Update Progression in the database and returns the new version.
type ProgressionQuestion ¶
type ProgressionQuestion struct { IdProgression IdProgression `json:"id_progression" gomacro-sql-on-delete:"CASCADE"` IdExercice IdExercice `json:"id_exercice" gomacro-sql-on-delete:"CASCADE"` Index int `json:"index"` // in the question list History EnumArray `json:"history"` }
We enforce consistency with the additional `id_exercice` field gomacro:SQL ADD UNIQUE(IdProgression, Index) gomacro:SQL ADD FOREIGN KEY (IdExercice, Index) REFERENCES exercice_questions ON DELETE CASCADE gomacro:SQL ADD FOREIGN KEY (IdProgression, IdExercice) REFERENCES progressions (Id, IdExercice) ON DELETE CASCADE
func ScanProgressionQuestion ¶
func ScanProgressionQuestion(row *sql.Row) (ProgressionQuestion, error)
func SelectProgressionQuestionByIdProgressionAndIndex ¶
func SelectProgressionQuestionByIdProgressionAndIndex(tx DB, idProgression IdProgression, index int) (item ProgressionQuestion, found bool, err error)
SelectProgressionQuestionByIdProgressionAndIndex return zero or one item, thanks to a UNIQUE SQL constraint.
func (ProgressionQuestion) Delete ¶
func (item ProgressionQuestion) Delete(tx DB) error
Delete the link ProgressionQuestion from the database. Only the foreign keys IdProgression, IdExercice fields are used in 'item'.
type ProgressionQuestions ¶
type ProgressionQuestions []ProgressionQuestion
func DeleteProgressionQuestionsByIdExercices ¶
func DeleteProgressionQuestionsByIdExercices(tx DB, idExercices_ ...IdExercice) (ProgressionQuestions, error)
func DeleteProgressionQuestionsByIdProgressions ¶
func DeleteProgressionQuestionsByIdProgressions(tx DB, idProgressions_ ...IdProgression) (ProgressionQuestions, error)
func ScanProgressionQuestions ¶
func ScanProgressionQuestions(rs *sql.Rows) (ProgressionQuestions, error)
func SelectAllProgressionQuestions ¶
func SelectAllProgressionQuestions(db DB) (ProgressionQuestions, error)
SelectAll returns all the items in the progression_questions table.
func SelectProgressionQuestionsByIdExercices ¶
func SelectProgressionQuestionsByIdExercices(tx DB, idExercices_ ...IdExercice) (ProgressionQuestions, error)
func SelectProgressionQuestionsByIdProgressions ¶
func SelectProgressionQuestionsByIdProgressions(tx DB, idProgressions_ ...IdProgression) (ProgressionQuestions, error)
func (ProgressionQuestions) ByIdExercice ¶
func (items ProgressionQuestions) ByIdExercice() map[IdExercice]ProgressionQuestions
ByIdExercice returns a map with 'IdExercice' as keys.
func (ProgressionQuestions) ByIdProgression ¶
func (items ProgressionQuestions) ByIdProgression() map[IdProgression]ProgressionQuestions
ByIdProgression returns a map with 'IdProgression' as keys.
func (ProgressionQuestions) IdExercices ¶
func (items ProgressionQuestions) IdExercices() []IdExercice
IdExercices returns the list of ids of IdExercice contained in this link table. They are not garanteed to be distinct.
func (ProgressionQuestions) IdProgressions ¶
func (items ProgressionQuestions) IdProgressions() []IdProgression
IdProgressions returns the list of ids of IdProgression contained in this link table. They are not garanteed to be distinct.
type Progressions ¶
type Progressions map[IdProgression]Progression
func ScanProgressions ¶
func ScanProgressions(rs *sql.Rows) (Progressions, error)
func SelectAllProgressions ¶
func SelectAllProgressions(db DB) (Progressions, error)
SelectAll returns all the items in the progressions table.
func SelectProgressions ¶
func SelectProgressions(tx DB, ids ...IdProgression) (Progressions, error)
SelectProgressions returns the entry matching the given 'ids'.
func (Progressions) IDs ¶
func (m Progressions) IDs() []IdProgression
type Question ¶
type Question struct { Id int64 `json:"id"` Page testsource.ComplexStruct `json:"page"` Public bool `json:"public"` // in practice only true for admins IdTeacher int64 `json:"id_teacher"` Description string `json:"description"` // NeedExercice is not null if the question cannot be instantiated (or edited) // on its own NeedExercice sql.NullInt64 `json:"need_exercice" gomacro-sql-foreign:"Exercice"` }
Question is a standalone question, used for instance in games.
func DeleteQuestionById ¶
Deletes the Question and returns the item
func SelectQuestion ¶
SelectQuestion returns the entry matching 'id'.
type QuestionTag ¶
type QuestionTag struct { Tag string `json:"tag"` IdQuestion int64 ` gomacro-sql-foreign:"Question" gomacro-sql-on-delete:"CASCADE" json:"id_question"` }
gomacro:SQL ADD UNIQUE(IdQuestion, Tag) gomacro:SQL CREATE UNIQUE INDEX index_name ON QuestionTag (Tag)
func ScanQuestionTag ¶
func ScanQuestionTag(row *sql.Row) (QuestionTag, error)
func SelectQuestionTagByIdQuestionAndTag ¶
func SelectQuestionTagByIdQuestionAndTag(tx DB, idQuestion int64, tag string) (item QuestionTag, found bool, err error)
SelectQuestionTagByIdQuestionAndTag return zero or one item, thanks to a UNIQUE SQL constraint.
func (QuestionTag) Delete ¶
func (item QuestionTag) Delete(tx DB) error
Delete the link QuestionTag from the database. Only the foreign keys IdQuestion fields are used in 'item'.
type QuestionTags ¶
type QuestionTags []QuestionTag
func DeleteQuestionTagsByIdQuestions ¶
func DeleteQuestionTagsByIdQuestions(tx DB, idQuestions_ ...int64) (QuestionTags, error)
func ScanQuestionTags ¶
func ScanQuestionTags(rs *sql.Rows) (QuestionTags, error)
func SelectAllQuestionTags ¶
func SelectAllQuestionTags(db DB) (QuestionTags, error)
SelectAll returns all the items in the question_tags table.
func SelectQuestionTagsByIdQuestions ¶
func SelectQuestionTagsByIdQuestions(tx DB, idQuestions_ ...int64) (QuestionTags, error)
func (QuestionTags) ByIdQuestion ¶
func (items QuestionTags) ByIdQuestion() map[int64]QuestionTags
ByIdQuestion returns a map with 'IdQuestion' as keys.
func (QuestionTags) IdQuestions ¶
func (items QuestionTags) IdQuestions() []int64
IdQuestions returns the list of ids of IdQuestion contained in this link table. They are not garanteed to be distinct.
type Questions ¶
func SelectAllQuestions ¶
SelectAll returns all the items in the questions table.
func SelectQuestions ¶
SelectQuestions returns the entry matching the given 'ids'.
type Repas ¶
gomacro:SQL ADD CHECK (V = #[LocalEnum.A] OR V = #[LocalEnum.B])
func DeleteRepasById ¶
Deletes the Repas and returns the item
func SelectRepas ¶
SelectRepas returns the entry matching 'id'.
type RepasID ¶
type RepasID int64
func DeleteRepassByIDs ¶
Deletes the Repas in the database and returns the ids.
type RepasIDSet ¶
func NewRepasIDSetFrom ¶
func NewRepasIDSetFrom(ids []RepasID) RepasIDSet
func (RepasIDSet) Add ¶
func (s RepasIDSet) Add(id RepasID)
func (RepasIDSet) Has ¶
func (s RepasIDSet) Has(id RepasID) bool
func (RepasIDSet) Keys ¶
func (s RepasIDSet) Keys() []RepasID
type Repass ¶
func SelectAllRepass ¶
SelectAll returns all the items in the repass table.
func SelectRepass ¶
SelectRepass returns the entry matching the given 'ids'.
type Table1 ¶
type Table1 struct { Id int64 Ex1 RepasID Ex2 RepasID L sql.NullInt64 `gomacro-sql-foreign:"Link"` Other optionalID `gomacro-sql-foreign:"Repas"` F FixedArray Strings Strings Cp Composite External testsource.Comp }
func DeleteTable1ById ¶
Deletes the Table1 and returns the item
func SelectTable1 ¶
SelectTable1 returns the entry matching 'id'.
type Table1s ¶
func SelectAllTable1s ¶
SelectAll returns all the items in the table1s table.
func SelectTable1s ¶
SelectTable1s returns the entry matching the given 'ids'.
func (Table1s) Ex1s ¶
Ex1s returns the list of ids of Ex1 contained in this table. They are not garanteed to be distinct.
type WithOptionalTime ¶
func DeleteWithOptionalTimeById ¶
func DeleteWithOptionalTimeById(tx DB, id int64) (WithOptionalTime, error)
Deletes the WithOptionalTime and returns the item
func ScanWithOptionalTime ¶
func ScanWithOptionalTime(row *sql.Row) (WithOptionalTime, error)
func SelectWithOptionalTime ¶
func SelectWithOptionalTime(tx DB, id int64) (WithOptionalTime, error)
SelectWithOptionalTime returns the entry matching 'id'.
func (WithOptionalTime) Insert ¶
func (item WithOptionalTime) Insert(tx DB) (out WithOptionalTime, err error)
Insert one WithOptionalTime in the database and returns the item with id filled.
func (WithOptionalTime) Update ¶
func (item WithOptionalTime) Update(tx DB) (out WithOptionalTime, err error)
Update WithOptionalTime in the database and returns the new version.
type WithOptionalTimes ¶
type WithOptionalTimes map[int64]WithOptionalTime
func ScanWithOptionalTimes ¶
func ScanWithOptionalTimes(rs *sql.Rows) (WithOptionalTimes, error)
func SelectAllWithOptionalTimes ¶
func SelectAllWithOptionalTimes(db DB) (WithOptionalTimes, error)
SelectAll returns all the items in the with_optional_times table.
func SelectWithOptionalTimes ¶
func SelectWithOptionalTimes(tx DB, ids ...int64) (WithOptionalTimes, error)
SelectWithOptionalTimes returns the entry matching the given 'ids'.
func (WithOptionalTimes) IDs ¶
func (m WithOptionalTimes) IDs() []int64