orm

package
v0.0.0-...-b6010e1 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2025 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

generated by stacks/gong/go/models/orm_file_per_struct_back_repo.go

generated by stacks/gong/go/models/orm_file_per_struct_back_repo.go

generated by stacks/gong/go/models/orm_file_per_struct_back_repo.go

do not modify, generated file

generated code - do not edit

generated code - do not edit

generated code - do not edit

generated code - do not edit

generated code - do not edit

Index

Constants

This section is empty.

Variables

View Source
var BackRepoFreqencyid_atBckpTime_newID map[uint]uint

this field is used during the restauration process. it stores the ID at the backup time and is used for renumbering

View Source
var BackRepoNoteid_atBckpTime_newID map[uint]uint

this field is used during the restauration process. it stores the ID at the backup time and is used for renumbering

View Source
var BackRepoPlayerid_atBckpTime_newID map[uint]uint

this field is used during the restauration process. it stores the ID at the backup time and is used for renumbering

View Source
var Freqency_Fields = []string{

	"ID",
	"Name",
}
View Source
var Note_Fields = []string{

	"ID",
	"Name",
	"Start",
	"Duration",
	"Velocity",
	"Info",
}
View Source
var Player_Fields = []string{

	"ID",
	"Name",
	"Status",
}

Functions

func CopyBackRepoToBackRepoData

func CopyBackRepoToBackRepoData(backRepo *BackRepoStruct, backRepoData *BackRepoData)

func GetID

func GetID[T models.Gongstruct](
	stage *models.StageStruct,
	backRepo *BackRepoStruct,
	instance *T) (id int)

func GetIDPointer

func GetIDPointer[T models.PointerToGongstruct](
	stage *models.StageStruct,
	backRepo *BackRepoStruct,
	instance T) (id int)

func GetInstanceDBFromInstance

func GetInstanceDBFromInstance[T models.Gongstruct, T2 GongstructDB](
	stage *models.StageStruct,
	backRepo *BackRepoStruct,
	instance *T) (ret *T2)

func GetReverseFieldOwner

func GetReverseFieldOwner[T models.Gongstruct](
	stage *models.StageStruct,
	backRepo *BackRepoStruct,
	instance *T,
	reverseField *models.ReverseField) (res any)

func GetReverseFieldOwnerName

func GetReverseFieldOwnerName(
	stage *models.StageStruct,
	backRepo *BackRepoStruct,
	instance any,
	reverseField *models.ReverseField) (res string)

Types

type BackRepoData

type BackRepoData struct {
	FreqencyAPIs []*FreqencyAPI

	NoteAPIs []*NoteAPI

	PlayerAPIs []*PlayerAPI

	// index of the web socket for this stack type (unique among all stack instances)
	GONG__Index int
}

type BackRepoFreqencyStruct

type BackRepoFreqencyStruct struct {
	// stores FreqencyDB according to their gorm ID
	Map_FreqencyDBID_FreqencyDB map[uint]*FreqencyDB

	// stores FreqencyDB ID according to Freqency address
	Map_FreqencyPtr_FreqencyDBID map[*models.Freqency]uint

	// stores Freqency according to their gorm ID
	Map_FreqencyDBID_FreqencyPtr map[uint]*models.Freqency
	// contains filtered or unexported fields
}

func (*BackRepoFreqencyStruct) Backup

func (backRepoFreqency *BackRepoFreqencyStruct) Backup(dirPath string)

Backup generates a json file from a slice of all FreqencyDB instances in the backrepo

func (*BackRepoFreqencyStruct) BackupXL

func (backRepoFreqency *BackRepoFreqencyStruct) BackupXL(file *xlsx.File)

Backup generates a json file from a slice of all FreqencyDB instances in the backrepo

func (*BackRepoFreqencyStruct) CheckoutPhaseOne

func (backRepoFreqency *BackRepoFreqencyStruct) CheckoutPhaseOne() (Error error)

BackRepoFreqency.CheckoutPhaseOne Checkouts all BackRepo instances to the Stage

Phase One will result in having instances on the stage aligned with the back repo pointers are not initialized yet (this is for phase two)

func (*BackRepoFreqencyStruct) CheckoutPhaseOneInstance

func (backRepoFreqency *BackRepoFreqencyStruct) CheckoutPhaseOneInstance(freqencyDB *FreqencyDB) (Error error)

CheckoutPhaseOneInstance takes a freqencyDB that has been found in the DB, updates the backRepo and stages the models version of the freqencyDB

func (*BackRepoFreqencyStruct) CheckoutPhaseTwo

func (backRepoFreqency *BackRepoFreqencyStruct) CheckoutPhaseTwo(backRepo *BackRepoStruct) (Error error)

BackRepoFreqency.CheckoutPhaseTwo Checkouts all staged instances of Freqency to the BackRepo Phase Two is the update of instance with the field in the database

func (*BackRepoFreqencyStruct) CheckoutPhaseTwoInstance

func (backRepoFreqency *BackRepoFreqencyStruct) CheckoutPhaseTwoInstance(backRepo *BackRepoStruct, freqencyDB *FreqencyDB) (Error error)

BackRepoFreqency.CheckoutPhaseTwoInstance Checkouts staged instances of Freqency to the BackRepo Phase Two is the update of instance with the field in the database

func (*BackRepoFreqencyStruct) CommitDeleteInstance

func (backRepoFreqency *BackRepoFreqencyStruct) CommitDeleteInstance(id uint) (Error error)

BackRepoFreqency.CommitDeleteInstance commits deletion of Freqency to the BackRepo

func (*BackRepoFreqencyStruct) CommitPhaseOne

func (backRepoFreqency *BackRepoFreqencyStruct) CommitPhaseOne(stage *models.StageStruct) (Error error)

BackRepoFreqency.CommitPhaseOne commits all staged instances of Freqency to the BackRepo Phase One is the creation of instance in the database if it is not yet done to get the unique ID for each staged instance

func (*BackRepoFreqencyStruct) CommitPhaseOneInstance

func (backRepoFreqency *BackRepoFreqencyStruct) CommitPhaseOneInstance(freqency *models.Freqency) (Error error)

BackRepoFreqency.CommitPhaseOneInstance commits freqency staged instances of Freqency to the BackRepo Phase One is the creation of instance in the database if it is not yet done to get the unique ID for each staged instance

func (*BackRepoFreqencyStruct) CommitPhaseTwo

func (backRepoFreqency *BackRepoFreqencyStruct) CommitPhaseTwo(backRepo *BackRepoStruct) (Error error)

BackRepoFreqency.CommitPhaseTwo commits all staged instances of Freqency to the BackRepo Phase Two is the update of instance with the field in the database

func (*BackRepoFreqencyStruct) CommitPhaseTwoInstance

func (backRepoFreqency *BackRepoFreqencyStruct) CommitPhaseTwoInstance(backRepo *BackRepoStruct, idx uint, freqency *models.Freqency) (Error error)

BackRepoFreqency.CommitPhaseTwoInstance commits {{structname }} of models.Freqency to the BackRepo Phase Two is the update of instance with the field in the database

func (*BackRepoFreqencyStruct) GetDB

func (backRepoFreqency *BackRepoFreqencyStruct) GetDB() db.DBInterface

func (*BackRepoFreqencyStruct) GetFreqencyDBFromFreqencyPtr

func (backRepoFreqency *BackRepoFreqencyStruct) GetFreqencyDBFromFreqencyPtr(freqency *models.Freqency) (freqencyDB *FreqencyDB)

GetFreqencyDBFromFreqencyPtr is a handy function to access the back repo instance from the stage instance

func (*BackRepoFreqencyStruct) GetStage

func (backRepoFreqency *BackRepoFreqencyStruct) GetStage() (stage *models.StageStruct)

func (*BackRepoFreqencyStruct) ResetReversePointers

func (backRepoFreqency *BackRepoFreqencyStruct) ResetReversePointers(backRepo *BackRepoStruct) (Error error)

BackRepoFreqency.ResetReversePointers commits all staged instances of Freqency to the BackRepo Phase Two is the update of instance with the field in the database

func (*BackRepoFreqencyStruct) ResetReversePointersInstance

func (backRepoFreqency *BackRepoFreqencyStruct) ResetReversePointersInstance(backRepo *BackRepoStruct, idx uint, freqency *models.Freqency) (Error error)

func (*BackRepoFreqencyStruct) RestorePhaseOne

func (backRepoFreqency *BackRepoFreqencyStruct) RestorePhaseOne(dirPath string)

RestorePhaseOne read the file "FreqencyDB.json" in dirPath that stores an array of FreqencyDB and stores it in the database the map BackRepoFreqencyid_atBckpTime_newID is updated accordingly

func (*BackRepoFreqencyStruct) RestorePhaseTwo

func (backRepoFreqency *BackRepoFreqencyStruct) RestorePhaseTwo()

RestorePhaseTwo uses all map BackRepo<Freqency>id_atBckpTime_newID to compute new index

func (*BackRepoFreqencyStruct) RestoreXLPhaseOne

func (backRepoFreqency *BackRepoFreqencyStruct) RestoreXLPhaseOne(file *xlsx.File)

RestoreXL from the "Freqency" sheet all FreqencyDB instances

type BackRepoNoteStruct

type BackRepoNoteStruct struct {
	// stores NoteDB according to their gorm ID
	Map_NoteDBID_NoteDB map[uint]*NoteDB

	// stores NoteDB ID according to Note address
	Map_NotePtr_NoteDBID map[*models.Note]uint

	// stores Note according to their gorm ID
	Map_NoteDBID_NotePtr map[uint]*models.Note
	// contains filtered or unexported fields
}

func (*BackRepoNoteStruct) Backup

func (backRepoNote *BackRepoNoteStruct) Backup(dirPath string)

Backup generates a json file from a slice of all NoteDB instances in the backrepo

func (*BackRepoNoteStruct) BackupXL

func (backRepoNote *BackRepoNoteStruct) BackupXL(file *xlsx.File)

Backup generates a json file from a slice of all NoteDB instances in the backrepo

func (*BackRepoNoteStruct) CheckoutPhaseOne

func (backRepoNote *BackRepoNoteStruct) CheckoutPhaseOne() (Error error)

BackRepoNote.CheckoutPhaseOne Checkouts all BackRepo instances to the Stage

Phase One will result in having instances on the stage aligned with the back repo pointers are not initialized yet (this is for phase two)

func (*BackRepoNoteStruct) CheckoutPhaseOneInstance

func (backRepoNote *BackRepoNoteStruct) CheckoutPhaseOneInstance(noteDB *NoteDB) (Error error)

CheckoutPhaseOneInstance takes a noteDB that has been found in the DB, updates the backRepo and stages the models version of the noteDB

func (*BackRepoNoteStruct) CheckoutPhaseTwo

func (backRepoNote *BackRepoNoteStruct) CheckoutPhaseTwo(backRepo *BackRepoStruct) (Error error)

BackRepoNote.CheckoutPhaseTwo Checkouts all staged instances of Note to the BackRepo Phase Two is the update of instance with the field in the database

func (*BackRepoNoteStruct) CheckoutPhaseTwoInstance

func (backRepoNote *BackRepoNoteStruct) CheckoutPhaseTwoInstance(backRepo *BackRepoStruct, noteDB *NoteDB) (Error error)

BackRepoNote.CheckoutPhaseTwoInstance Checkouts staged instances of Note to the BackRepo Phase Two is the update of instance with the field in the database

func (*BackRepoNoteStruct) CommitDeleteInstance

func (backRepoNote *BackRepoNoteStruct) CommitDeleteInstance(id uint) (Error error)

BackRepoNote.CommitDeleteInstance commits deletion of Note to the BackRepo

func (*BackRepoNoteStruct) CommitPhaseOne

func (backRepoNote *BackRepoNoteStruct) CommitPhaseOne(stage *models.StageStruct) (Error error)

BackRepoNote.CommitPhaseOne commits all staged instances of Note to the BackRepo Phase One is the creation of instance in the database if it is not yet done to get the unique ID for each staged instance

func (*BackRepoNoteStruct) CommitPhaseOneInstance

func (backRepoNote *BackRepoNoteStruct) CommitPhaseOneInstance(note *models.Note) (Error error)

BackRepoNote.CommitPhaseOneInstance commits note staged instances of Note to the BackRepo Phase One is the creation of instance in the database if it is not yet done to get the unique ID for each staged instance

func (*BackRepoNoteStruct) CommitPhaseTwo

func (backRepoNote *BackRepoNoteStruct) CommitPhaseTwo(backRepo *BackRepoStruct) (Error error)

BackRepoNote.CommitPhaseTwo commits all staged instances of Note to the BackRepo Phase Two is the update of instance with the field in the database

func (*BackRepoNoteStruct) CommitPhaseTwoInstance

func (backRepoNote *BackRepoNoteStruct) CommitPhaseTwoInstance(backRepo *BackRepoStruct, idx uint, note *models.Note) (Error error)

BackRepoNote.CommitPhaseTwoInstance commits {{structname }} of models.Note to the BackRepo Phase Two is the update of instance with the field in the database

func (*BackRepoNoteStruct) GetDB

func (backRepoNote *BackRepoNoteStruct) GetDB() db.DBInterface

func (*BackRepoNoteStruct) GetNoteDBFromNotePtr

func (backRepoNote *BackRepoNoteStruct) GetNoteDBFromNotePtr(note *models.Note) (noteDB *NoteDB)

GetNoteDBFromNotePtr is a handy function to access the back repo instance from the stage instance

func (*BackRepoNoteStruct) GetStage

func (backRepoNote *BackRepoNoteStruct) GetStage() (stage *models.StageStruct)

func (*BackRepoNoteStruct) ResetReversePointers

func (backRepoNote *BackRepoNoteStruct) ResetReversePointers(backRepo *BackRepoStruct) (Error error)

BackRepoNote.ResetReversePointers commits all staged instances of Note to the BackRepo Phase Two is the update of instance with the field in the database

func (*BackRepoNoteStruct) ResetReversePointersInstance

func (backRepoNote *BackRepoNoteStruct) ResetReversePointersInstance(backRepo *BackRepoStruct, idx uint, note *models.Note) (Error error)

func (*BackRepoNoteStruct) RestorePhaseOne

func (backRepoNote *BackRepoNoteStruct) RestorePhaseOne(dirPath string)

RestorePhaseOne read the file "NoteDB.json" in dirPath that stores an array of NoteDB and stores it in the database the map BackRepoNoteid_atBckpTime_newID is updated accordingly

func (*BackRepoNoteStruct) RestorePhaseTwo

func (backRepoNote *BackRepoNoteStruct) RestorePhaseTwo()

RestorePhaseTwo uses all map BackRepo<Note>id_atBckpTime_newID to compute new index

func (*BackRepoNoteStruct) RestoreXLPhaseOne

func (backRepoNote *BackRepoNoteStruct) RestoreXLPhaseOne(file *xlsx.File)

RestoreXL from the "Note" sheet all NoteDB instances

type BackRepoPlayerStruct

type BackRepoPlayerStruct struct {
	// stores PlayerDB according to their gorm ID
	Map_PlayerDBID_PlayerDB map[uint]*PlayerDB

	// stores PlayerDB ID according to Player address
	Map_PlayerPtr_PlayerDBID map[*models.Player]uint

	// stores Player according to their gorm ID
	Map_PlayerDBID_PlayerPtr map[uint]*models.Player
	// contains filtered or unexported fields
}

func (*BackRepoPlayerStruct) Backup

func (backRepoPlayer *BackRepoPlayerStruct) Backup(dirPath string)

Backup generates a json file from a slice of all PlayerDB instances in the backrepo

func (*BackRepoPlayerStruct) BackupXL

func (backRepoPlayer *BackRepoPlayerStruct) BackupXL(file *xlsx.File)

Backup generates a json file from a slice of all PlayerDB instances in the backrepo

func (*BackRepoPlayerStruct) CheckoutPhaseOne

func (backRepoPlayer *BackRepoPlayerStruct) CheckoutPhaseOne() (Error error)

BackRepoPlayer.CheckoutPhaseOne Checkouts all BackRepo instances to the Stage

Phase One will result in having instances on the stage aligned with the back repo pointers are not initialized yet (this is for phase two)

func (*BackRepoPlayerStruct) CheckoutPhaseOneInstance

func (backRepoPlayer *BackRepoPlayerStruct) CheckoutPhaseOneInstance(playerDB *PlayerDB) (Error error)

CheckoutPhaseOneInstance takes a playerDB that has been found in the DB, updates the backRepo and stages the models version of the playerDB

func (*BackRepoPlayerStruct) CheckoutPhaseTwo

func (backRepoPlayer *BackRepoPlayerStruct) CheckoutPhaseTwo(backRepo *BackRepoStruct) (Error error)

BackRepoPlayer.CheckoutPhaseTwo Checkouts all staged instances of Player to the BackRepo Phase Two is the update of instance with the field in the database

func (*BackRepoPlayerStruct) CheckoutPhaseTwoInstance

func (backRepoPlayer *BackRepoPlayerStruct) CheckoutPhaseTwoInstance(backRepo *BackRepoStruct, playerDB *PlayerDB) (Error error)

BackRepoPlayer.CheckoutPhaseTwoInstance Checkouts staged instances of Player to the BackRepo Phase Two is the update of instance with the field in the database

func (*BackRepoPlayerStruct) CommitDeleteInstance

func (backRepoPlayer *BackRepoPlayerStruct) CommitDeleteInstance(id uint) (Error error)

BackRepoPlayer.CommitDeleteInstance commits deletion of Player to the BackRepo

func (*BackRepoPlayerStruct) CommitPhaseOne

func (backRepoPlayer *BackRepoPlayerStruct) CommitPhaseOne(stage *models.StageStruct) (Error error)

BackRepoPlayer.CommitPhaseOne commits all staged instances of Player to the BackRepo Phase One is the creation of instance in the database if it is not yet done to get the unique ID for each staged instance

func (*BackRepoPlayerStruct) CommitPhaseOneInstance

func (backRepoPlayer *BackRepoPlayerStruct) CommitPhaseOneInstance(player *models.Player) (Error error)

BackRepoPlayer.CommitPhaseOneInstance commits player staged instances of Player to the BackRepo Phase One is the creation of instance in the database if it is not yet done to get the unique ID for each staged instance

func (*BackRepoPlayerStruct) CommitPhaseTwo

func (backRepoPlayer *BackRepoPlayerStruct) CommitPhaseTwo(backRepo *BackRepoStruct) (Error error)

BackRepoPlayer.CommitPhaseTwo commits all staged instances of Player to the BackRepo Phase Two is the update of instance with the field in the database

func (*BackRepoPlayerStruct) CommitPhaseTwoInstance

func (backRepoPlayer *BackRepoPlayerStruct) CommitPhaseTwoInstance(backRepo *BackRepoStruct, idx uint, player *models.Player) (Error error)

BackRepoPlayer.CommitPhaseTwoInstance commits {{structname }} of models.Player to the BackRepo Phase Two is the update of instance with the field in the database

func (*BackRepoPlayerStruct) GetDB

func (backRepoPlayer *BackRepoPlayerStruct) GetDB() db.DBInterface

func (*BackRepoPlayerStruct) GetPlayerDBFromPlayerPtr

func (backRepoPlayer *BackRepoPlayerStruct) GetPlayerDBFromPlayerPtr(player *models.Player) (playerDB *PlayerDB)

GetPlayerDBFromPlayerPtr is a handy function to access the back repo instance from the stage instance

func (*BackRepoPlayerStruct) GetStage

func (backRepoPlayer *BackRepoPlayerStruct) GetStage() (stage *models.StageStruct)

func (*BackRepoPlayerStruct) ResetReversePointers

func (backRepoPlayer *BackRepoPlayerStruct) ResetReversePointers(backRepo *BackRepoStruct) (Error error)

BackRepoPlayer.ResetReversePointers commits all staged instances of Player to the BackRepo Phase Two is the update of instance with the field in the database

func (*BackRepoPlayerStruct) ResetReversePointersInstance

func (backRepoPlayer *BackRepoPlayerStruct) ResetReversePointersInstance(backRepo *BackRepoStruct, idx uint, player *models.Player) (Error error)

func (*BackRepoPlayerStruct) RestorePhaseOne

func (backRepoPlayer *BackRepoPlayerStruct) RestorePhaseOne(dirPath string)

RestorePhaseOne read the file "PlayerDB.json" in dirPath that stores an array of PlayerDB and stores it in the database the map BackRepoPlayerid_atBckpTime_newID is updated accordingly

func (*BackRepoPlayerStruct) RestorePhaseTwo

func (backRepoPlayer *BackRepoPlayerStruct) RestorePhaseTwo()

RestorePhaseTwo uses all map BackRepo<Player>id_atBckpTime_newID to compute new index

func (*BackRepoPlayerStruct) RestoreXLPhaseOne

func (backRepoPlayer *BackRepoPlayerStruct) RestoreXLPhaseOne(file *xlsx.File)

RestoreXL from the "Player" sheet all PlayerDB instances

type BackRepoStruct

type BackRepoStruct struct {
	// insertion point for per struct back repo declarations
	BackRepoFreqency BackRepoFreqencyStruct

	BackRepoNote BackRepoNoteStruct

	BackRepoPlayer BackRepoPlayerStruct

	CommitFromBackNb uint // records commit increments when performed by the back

	PushFromFrontNb uint // records commit increments when performed by the front
	// contains filtered or unexported fields
}

BackRepoStruct supports callback functions

func NewBackRepo

func NewBackRepo(stage *models.StageStruct, filename string) (backRepo *BackRepoStruct)

func (*BackRepoStruct) Backup

func (backRepo *BackRepoStruct) Backup(stage *models.StageStruct, dirPath string)

Backup the BackRepoStruct

func (*BackRepoStruct) BackupXL

func (backRepo *BackRepoStruct) BackupXL(stage *models.StageStruct, dirPath string)

Backup in XL the BackRepoStruct

func (*BackRepoStruct) Checkout

func (backRepo *BackRepoStruct) Checkout(stage *models.StageStruct)

Checkout the database into the stage

func (*BackRepoStruct) CheckoutFreqency

func (backRepo *BackRepoStruct) CheckoutFreqency(freqency *models.Freqency)

CommitFreqency allows checkout of a single freqency (if already staged and with a BackRepo id)

func (*BackRepoStruct) CheckoutNote

func (backRepo *BackRepoStruct) CheckoutNote(note *models.Note)

CommitNote allows checkout of a single note (if already staged and with a BackRepo id)

func (*BackRepoStruct) CheckoutPlayer

func (backRepo *BackRepoStruct) CheckoutPlayer(player *models.Player)

CommitPlayer allows checkout of a single player (if already staged and with a BackRepo id)

func (*BackRepoStruct) Commit

func (backRepo *BackRepoStruct) Commit(stage *models.StageStruct)

Commit the BackRepoStruct inner variables and link to the database

func (*BackRepoStruct) CommitFreqency

func (backRepo *BackRepoStruct) CommitFreqency(freqency *models.Freqency)

CommitFreqency allows commit of a single freqency (if already staged)

func (*BackRepoStruct) CommitNote

func (backRepo *BackRepoStruct) CommitNote(note *models.Note)

CommitNote allows commit of a single note (if already staged)

func (*BackRepoStruct) CommitPlayer

func (backRepo *BackRepoStruct) CommitPlayer(player *models.Player)

CommitPlayer allows commit of a single player (if already staged)

func (*BackRepoStruct) GetLastCommitFromBackNb

func (backRepo *BackRepoStruct) GetLastCommitFromBackNb() uint

func (*BackRepoStruct) GetLastPushFromFrontNb

func (backRepo *BackRepoStruct) GetLastPushFromFrontNb() uint

func (*BackRepoStruct) GetStage

func (backRepo *BackRepoStruct) GetStage() (stage *models.StageStruct)

func (*BackRepoStruct) IncrementCommitFromBackNb

func (backRepo *BackRepoStruct) IncrementCommitFromBackNb() uint

func (*BackRepoStruct) IncrementPushFromFrontNb

func (backRepo *BackRepoStruct) IncrementPushFromFrontNb() uint

func (*BackRepoStruct) Restore

func (backRepo *BackRepoStruct) Restore(stage *models.StageStruct, dirPath string)

Restore the database into the back repo

func (*BackRepoStruct) RestoreXL

func (backRepo *BackRepoStruct) RestoreXL(stage *models.StageStruct, dirPath string)

Restore the database into the back repo

func (*BackRepoStruct) SubscribeToCommitNb

func (backRepoStruct *BackRepoStruct) SubscribeToCommitNb(ctx context.Context) <-chan int

type DBLite

type DBLite struct {
	// contains filtered or unexported fields
}

DBLite is an in-memory database implementation of DBInterface

func NewDBLite

func NewDBLite() *DBLite

NewDBLite creates a new instance of DBLite

func (*DBLite) Create

func (db *DBLite) Create(instanceDB any) (db.DBInterface, error)

Create inserts a new record into the database

func (*DBLite) Delete

func (db *DBLite) Delete(instanceDB any) (db.DBInterface, error)

Delete removes a record from the database

func (*DBLite) Find

func (db *DBLite) Find(instanceDBs any) (db.DBInterface, error)

Find retrieves all records of a type from the database

func (*DBLite) First

func (db *DBLite) First(instanceDB any, conds ...any) (db.DBInterface, error)

First retrieves the first record of a type from the database

func (*DBLite) Model

func (db *DBLite) Model(instanceDB any) (db.DBInterface, error)

Model is a placeholder in this implementation

func (*DBLite) Save

func (db *DBLite) Save(instanceDB any) (db.DBInterface, error)

Save updates or inserts a record into the database

func (*DBLite) Unscoped

func (db *DBLite) Unscoped() (db.DBInterface, error)

Unscoped sets the unscoped flag for soft-deletes (not used in this implementation)

func (*DBLite) Updates

func (db *DBLite) Updates(instanceDB any) (db.DBInterface, error)

Updates modifies an existing record in the database

type FreqencyAPI

type FreqencyAPI struct {
	gorm.Model

	models.Freqency_WOP

	// encoding of pointers
	// for API, it cannot be embedded
	FreqencyPointersEncoding FreqencyPointersEncoding
}

FreqencyAPI is the input in POST API

for POST, API, one needs the fields of the model as well as the fields from associations ("Has One" and "Has Many") that are generated to fullfill the ORM requirements for associations

swagger:model freqencyAPI

type FreqencyDB

type FreqencyDB struct {
	gorm.Model

	// Declation for basic field freqencyDB.Name
	Name_Data sql.NullString

	// encoding of pointers
	// for GORM serialization, it is necessary to embed to Pointer Encoding declaration
	FreqencyPointersEncoding
}

FreqencyDB describes a freqency in the database

It incorporates the GORM ID, basic fields from the model (because they can be serialized), the encoded version of pointers

swagger:model freqencyDB

func (*FreqencyDB) CopyBasicFieldsFromFreqency

func (freqencyDB *FreqencyDB) CopyBasicFieldsFromFreqency(freqency *models.Freqency)

CopyBasicFieldsFromFreqency

func (*FreqencyDB) CopyBasicFieldsFromFreqencyWOP

func (freqencyDB *FreqencyDB) CopyBasicFieldsFromFreqencyWOP(freqency *FreqencyWOP)

CopyBasicFieldsFromFreqencyWOP

func (*FreqencyDB) CopyBasicFieldsFromFreqency_WOP

func (freqencyDB *FreqencyDB) CopyBasicFieldsFromFreqency_WOP(freqency *models.Freqency_WOP)

CopyBasicFieldsFromFreqency_WOP

func (*FreqencyDB) CopyBasicFieldsToFreqency

func (freqencyDB *FreqencyDB) CopyBasicFieldsToFreqency(freqency *models.Freqency)

CopyBasicFieldsToFreqency

func (*FreqencyDB) CopyBasicFieldsToFreqencyWOP

func (freqencyDB *FreqencyDB) CopyBasicFieldsToFreqencyWOP(freqency *FreqencyWOP)

CopyBasicFieldsToFreqencyWOP

func (*FreqencyDB) CopyBasicFieldsToFreqency_WOP

func (freqencyDB *FreqencyDB) CopyBasicFieldsToFreqency_WOP(freqency *models.Freqency_WOP)

CopyBasicFieldsToFreqency_WOP

func (*FreqencyDB) DecodePointers

func (freqencyDB *FreqencyDB) DecodePointers(backRepo *BackRepoStruct, freqency *models.Freqency)

type FreqencyDBResponse

type FreqencyDBResponse struct {
	FreqencyDB
}

FreqencyDBResponse provides response swagger:response freqencyDBResponse

type FreqencyDBs

type FreqencyDBs []FreqencyDB

FreqencyDBs arrays freqencyDBs swagger:response freqencyDBsResponse

type FreqencyPointersEncoding

type FreqencyPointersEncoding struct {
}

FreqencyPointersEncoding encodes pointers to Struct and reverse pointers of slice of poitners to Struct

type FreqencyWOP

type FreqencyWOP struct {
	ID int `xlsx:"0"`

	Name string `xlsx:"1"`
}

FreqencyWOP is a Freqency without pointers (WOP is an acronym for "Without Pointers") it holds the same basic fields but pointers are encoded into uint

type GongstructDB

type GongstructDB interface {
}

type IntSlice

type IntSlice []int

func (*IntSlice) Scan

func (s *IntSlice) Scan(value interface{}) error

Scan makes IntSlice implement the sql.Scanner interface.

func (IntSlice) Value

func (s IntSlice) Value() (driver.Value, error)

Value makes IntSlice implement the driver.Valuer interface.

type NoteAPI

type NoteAPI struct {
	gorm.Model

	models.Note_WOP

	// encoding of pointers
	// for API, it cannot be embedded
	NotePointersEncoding NotePointersEncoding
}

NoteAPI is the input in POST API

for POST, API, one needs the fields of the model as well as the fields from associations ("Has One" and "Has Many") that are generated to fullfill the ORM requirements for associations

swagger:model noteAPI

type NoteDB

type NoteDB struct {
	gorm.Model

	// Declation for basic field noteDB.Name
	Name_Data sql.NullString

	// Declation for basic field noteDB.Start
	Start_Data sql.NullFloat64

	// Declation for basic field noteDB.Duration
	Duration_Data sql.NullFloat64

	// Declation for basic field noteDB.Velocity
	Velocity_Data sql.NullFloat64

	// Declation for basic field noteDB.Info
	Info_Data sql.NullString

	// encoding of pointers
	// for GORM serialization, it is necessary to embed to Pointer Encoding declaration
	NotePointersEncoding
}

NoteDB describes a note in the database

It incorporates the GORM ID, basic fields from the model (because they can be serialized), the encoded version of pointers

swagger:model noteDB

func (*NoteDB) CopyBasicFieldsFromNote

func (noteDB *NoteDB) CopyBasicFieldsFromNote(note *models.Note)

CopyBasicFieldsFromNote

func (*NoteDB) CopyBasicFieldsFromNoteWOP

func (noteDB *NoteDB) CopyBasicFieldsFromNoteWOP(note *NoteWOP)

CopyBasicFieldsFromNoteWOP

func (*NoteDB) CopyBasicFieldsFromNote_WOP

func (noteDB *NoteDB) CopyBasicFieldsFromNote_WOP(note *models.Note_WOP)

CopyBasicFieldsFromNote_WOP

func (*NoteDB) CopyBasicFieldsToNote

func (noteDB *NoteDB) CopyBasicFieldsToNote(note *models.Note)

CopyBasicFieldsToNote

func (*NoteDB) CopyBasicFieldsToNoteWOP

func (noteDB *NoteDB) CopyBasicFieldsToNoteWOP(note *NoteWOP)

CopyBasicFieldsToNoteWOP

func (*NoteDB) CopyBasicFieldsToNote_WOP

func (noteDB *NoteDB) CopyBasicFieldsToNote_WOP(note *models.Note_WOP)

CopyBasicFieldsToNote_WOP

func (*NoteDB) DecodePointers

func (noteDB *NoteDB) DecodePointers(backRepo *BackRepoStruct, note *models.Note)

type NoteDBResponse

type NoteDBResponse struct {
	NoteDB
}

NoteDBResponse provides response swagger:response noteDBResponse

type NoteDBs

type NoteDBs []NoteDB

NoteDBs arrays noteDBs swagger:response noteDBsResponse

type NotePointersEncoding

type NotePointersEncoding struct {

	// field Frequencies is a slice of pointers to another Struct (optional or 0..1)
	Frequencies IntSlice `gorm:"type:TEXT"`
}

NotePointersEncoding encodes pointers to Struct and reverse pointers of slice of poitners to Struct

type NoteWOP

type NoteWOP struct {
	ID int `xlsx:"0"`

	Name string `xlsx:"1"`

	Start float64 `xlsx:"2"`

	Duration float64 `xlsx:"3"`

	Velocity float64 `xlsx:"4"`

	Info string `xlsx:"5"`
}

NoteWOP is a Note without pointers (WOP is an acronym for "Without Pointers") it holds the same basic fields but pointers are encoded into uint

type PlayerAPI

type PlayerAPI struct {
	gorm.Model

	models.Player_WOP

	// encoding of pointers
	// for API, it cannot be embedded
	PlayerPointersEncoding PlayerPointersEncoding
}

PlayerAPI is the input in POST API

for POST, API, one needs the fields of the model as well as the fields from associations ("Has One" and "Has Many") that are generated to fullfill the ORM requirements for associations

swagger:model playerAPI

type PlayerDB

type PlayerDB struct {
	gorm.Model

	// Declation for basic field playerDB.Name
	Name_Data sql.NullString

	// Declation for basic field playerDB.Status
	Status_Data sql.NullString

	// encoding of pointers
	// for GORM serialization, it is necessary to embed to Pointer Encoding declaration
	PlayerPointersEncoding
}

PlayerDB describes a player in the database

It incorporates the GORM ID, basic fields from the model (because they can be serialized), the encoded version of pointers

swagger:model playerDB

func (*PlayerDB) CopyBasicFieldsFromPlayer

func (playerDB *PlayerDB) CopyBasicFieldsFromPlayer(player *models.Player)

CopyBasicFieldsFromPlayer

func (*PlayerDB) CopyBasicFieldsFromPlayerWOP

func (playerDB *PlayerDB) CopyBasicFieldsFromPlayerWOP(player *PlayerWOP)

CopyBasicFieldsFromPlayerWOP

func (*PlayerDB) CopyBasicFieldsFromPlayer_WOP

func (playerDB *PlayerDB) CopyBasicFieldsFromPlayer_WOP(player *models.Player_WOP)

CopyBasicFieldsFromPlayer_WOP

func (*PlayerDB) CopyBasicFieldsToPlayer

func (playerDB *PlayerDB) CopyBasicFieldsToPlayer(player *models.Player)

CopyBasicFieldsToPlayer

func (*PlayerDB) CopyBasicFieldsToPlayerWOP

func (playerDB *PlayerDB) CopyBasicFieldsToPlayerWOP(player *PlayerWOP)

CopyBasicFieldsToPlayerWOP

func (*PlayerDB) CopyBasicFieldsToPlayer_WOP

func (playerDB *PlayerDB) CopyBasicFieldsToPlayer_WOP(player *models.Player_WOP)

CopyBasicFieldsToPlayer_WOP

func (*PlayerDB) DecodePointers

func (playerDB *PlayerDB) DecodePointers(backRepo *BackRepoStruct, player *models.Player)

type PlayerDBResponse

type PlayerDBResponse struct {
	PlayerDB
}

PlayerDBResponse provides response swagger:response playerDBResponse

type PlayerDBs

type PlayerDBs []PlayerDB

PlayerDBs arrays playerDBs swagger:response playerDBsResponse

type PlayerPointersEncoding

type PlayerPointersEncoding struct {
}

PlayerPointersEncoding encodes pointers to Struct and reverse pointers of slice of poitners to Struct

type PlayerWOP

type PlayerWOP struct {
	ID int `xlsx:"0"`

	Name string `xlsx:"1"`

	Status models.Status `xlsx:"2"`
}

PlayerWOP is a Player without pointers (WOP is an acronym for "Without Pointers") it holds the same basic fields but pointers are encoded into uint

Directories

Path Synopsis
generated code - do not edit
generated code - do not edit

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL