mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-12 19:14:23 +00:00
423b86a03b
* feat: reread events * feat: sequence and timestamo on search requests * feat: sequence and timestamo on search requests * fix: better naming * fix: log errors * fix: read sequence before search request
28 lines
813 B
Go
28 lines
813 B
Go
package view
|
|
|
|
import (
|
|
"github.com/caos/zitadel/internal/view/repository"
|
|
)
|
|
|
|
const (
|
|
sequencesTable = "adminapi.current_sequences"
|
|
)
|
|
|
|
func (v *View) saveCurrentSequence(viewName string, sequence uint64) error {
|
|
return repository.SaveCurrentSequence(v.Db, sequencesTable, viewName, sequence)
|
|
}
|
|
|
|
func (v *View) latestSequence(viewName string) (*repository.CurrentSequence, error) {
|
|
return repository.LatestSequence(v.Db, sequencesTable, viewName)
|
|
}
|
|
|
|
func (v *View) AllCurrentSequences(db string) ([]*repository.CurrentSequence, error) {
|
|
return repository.AllCurrentSequences(v.Db, db+".current_sequences")
|
|
}
|
|
|
|
func (v *View) ClearView(db, viewName string) error {
|
|
truncateView := db + "." + viewName
|
|
sequenceTable := db + ".current_sequences"
|
|
return repository.ClearView(v.Db, truncateView, sequenceTable)
|
|
}
|