Documentation
¶
Index ¶
- func CustomQuery1(db DB, newValue RepasID, selectV FixedArray) error
- func CustomQuery2(db DB, newValue FixedArray, selectV RepasID) error
- func CustomQueryArray(db DB, newValue string, ids []RepasID) error
- func CustomQueryRepas(db DB, newValue string) error
- func DeleteExercicesByIDs(tx DB, ids ...int64) ([]int64, error)
- func DeleteQuestionsByIDs(tx DB, ids ...int64) ([]int64, error)
- func DeleteTable1sByIDs(tx DB, ids ...int64) ([]int64, error)
- func DeleteWithOptionalTimesByIDs(tx DB, ids ...int64) ([]int64, error)
- func IdExerciceArrayToPQ(ids []IdExercice) pq.Int64Array
- func IdProgressionArrayToPQ(ids []IdProgression) pq.Int64Array
- func IdQuestionArrayToPQ(ids []IdQuestion) pq.Int64Array
- 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 Newint64SetFrom(ids []int64) int64Set
- func RepasIDArrayToPQ(ids []RepasID) pq.Int64Array
- func Scanint64Array(rs *sql.Rows) ([]int64, error)
- type Advance
- 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 IdQuestion
- type IdQuestionSet
- type Link
- type Links
- type LocalEnum
- type Map
- type OptAlias
- 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
- func DeleteQuestionsByNeedExercices(tx DB, needExercices_ ...int64) (Questions, error)
- func ScanQuestions(rs *sql.Rows) (Questions, error)
- func SelectAllQuestions(db DB) (Questions, error)
- func SelectQuestions(tx DB, ids ...int64) (Questions, error)
- func SelectQuestionsByNeedExercices(tx DB, needExercices_ ...int64) (Questions, error)
- type Repas
- type RepasID
- type RepasIDSet
- type Repass
- type Strings
- type Table1
- type Table1s
- func DeleteTable1sByEx1s(tx DB, ex1s_ ...RepasID) (Table1s, error)
- func DeleteTable1sByEx2s(tx DB, ex2s_ ...RepasID) (Table1s, error)
- func DeleteTable1sByLs(tx DB, ls_ ...int64) (Table1s, error)
- func DeleteTable1sByOptKeys(tx DB, optKeys_ ...IdQuestion) (Table1s, error)
- func DeleteTable1sByOthers(tx DB, others_ ...RepasID) (Table1s, error)
- 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 SelectTable1sByOptKeys(tx DB, optKeys_ ...IdQuestion) (Table1s, error)
- func SelectTable1sByOthers(tx DB, others_ ...RepasID) (Table1s, error)
- func (items Table1s) ByEx1() map[RepasID]Table1s
- func (items Table1s) ByEx2() map[RepasID]Table1s
- func (items Table1s) Ex1s() []RepasID
- func (items Table1s) Ex2s() []RepasID
- func (m Table1s) IDs() []int64
- func (items Table1s) Ls() []int64
- func (items Table1s) OptKeys() []IdQuestion
- func (items Table1s) Others() []RepasID
- type WithOptionalTime
- type WithOptionalTimes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CustomQuery1 ¶
func CustomQuery1(db DB, newValue RepasID, selectV FixedArray) error
func CustomQuery2 ¶
func CustomQuery2(db DB, newValue FixedArray, selectV RepasID) error
func CustomQueryRepas ¶
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 IdQuestionArrayToPQ ¶
func IdQuestionArrayToPQ(ids []IdQuestion) pq.Int64Array
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 Newint64SetFrom ¶
func Newint64SetFrom(ids []int64) int64Set
func RepasIDArrayToPQ ¶
func RepasIDArrayToPQ(ids []RepasID) pq.Int64Array
Types ¶
type Advance ¶
type Advance [10]testsource.EnumUInt
type DB ¶
type DB interface {
Exec(query string, args ...any) (sql.Result, error)
Query(query string, args ...any) (*sql.Rows, error)
QueryRow(query string, args ...any) *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'.
func (ExerciceQuestion) Insert ¶
func (item ExerciceQuestion) Insert(db DB) error
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 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 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 any) 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 IdQuestion ¶
type IdQuestion int64
func ScanIdQuestionArray ¶
func ScanIdQuestionArray(rs *sql.Rows) ([]IdQuestion, error)
ScanIdQuestionArray scans the result of a query returning a list of ID's.
type IdQuestionSet ¶
type IdQuestionSet map[IdQuestion]bool
func NewIdQuestionSetFrom ¶
func NewIdQuestionSetFrom(ids []IdQuestion) IdQuestionSet
func (IdQuestionSet) Add ¶
func (s IdQuestionSet) Add(id IdQuestion)
func (IdQuestionSet) Has ¶
func (s IdQuestionSet) Has(id IdQuestion) bool
func (IdQuestionSet) Keys ¶
func (s IdQuestionSet) Keys() []IdQuestion
type Link ¶
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'.
func (ProgressionQuestion) Insert ¶
func (item ProgressionQuestion) Insert(db DB) error
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 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 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'.
func (QuestionTag) Insert ¶
func (item QuestionTag) Insert(db DB) error
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 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'.
func (Questions) NeedExercices ¶
NeedExercices returns the list of non null NeedExercice contained in this table. They are not garanteed to be distinct.
type Repas ¶
gomacro:SQL ADD CHECK (V = #[LocalEnum.A] OR V = #[LocalEnum.B]) gomacro:QUERY CustomQueryRepas UPDATE Repas SET Order = $newValue$ WHERE V = #[LocalEnum.A] ; gomacro:QUERY CustomQueryArray UPDATE Repas SET Order = $newValue$ WHERE Id = ANY($ids$) ;
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
BoolArray ba
OptKey OptAlias `gomacro-sql-foreign:"Question"`
Advance Advance
// contains filtered or unexported fields
}
gomacro:QUERY CustomQuery1 UPDATE Table1 SET Ex1 = $newValue$ WHERE F = $selectV$ ; gomacro:QUERY CustomQuery2 UPDATE Table1 SET F = $newValue$ WHERE Ex1 = $selectV$ OR Ex2 = $selectV$;
func DeleteTable1ById ¶
Deletes the Table1 and returns the item
func SelectTable1 ¶
SelectTable1 returns the entry matching 'id'.
type Table1s ¶
func DeleteTable1sByOptKeys ¶
func DeleteTable1sByOptKeys(tx DB, optKeys_ ...IdQuestion) (Table1s, error)
func SelectAllTable1s ¶
SelectAll returns all the items in the table1s table.
func SelectTable1s ¶
SelectTable1s returns the entry matching the given 'ids'.
func SelectTable1sByOptKeys ¶
func SelectTable1sByOptKeys(tx DB, optKeys_ ...IdQuestion) (Table1s, error)
func (Table1s) Ex1s ¶
Ex1s returns the list of ids of Ex1 contained in this table. They are not garanteed to be distinct.
func (Table1s) Ex2s ¶
Ex2s returns the list of ids of Ex2 contained in this table. They are not garanteed to be distinct.
func (Table1s) Ls ¶
Ls returns the list of non null L contained in this table. They are not garanteed to be distinct.
func (Table1s) OptKeys ¶
func (items Table1s) OptKeys() []IdQuestion
OptKeys returns the list of non null OptKey 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