Documentation
¶
Index ¶
- func SetSchema(s string)
- type DataRepository
- func (rep *DataRepository) ConcurrentFetchFromRecords(batchSize int, f func(list []entity.DataRecord) bool) error
- func (rep *DataRepository) ConcurrentFetchFromTechRecords(batchSize int, f func(list []entity.DataRecord) bool) error
- func (rep *DataRepository) CountRecords() (int, error)
- func (rep *DataRepository) CountTechRecords() (int, error)
- func (rep *DataRepository) GetMaxVersionFromRecords() (int, error)
- func (rep *DataRepository) GetMaxVersionFromTechRecords() (int, error)
- func (rep *DataRepository) UnloadRecordById(listId []string, techRecord bool) ([]entity.DataRecord, error)
- func (rep *DataRepository) UseRecordsCursor(batchSize int, f func(list []entity.DataRecord) bool) error
- func (rep *DataRepository) UseTechRecordsCursor(batchSize int, f func(list []entity.DataRecord) bool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DataRepository ¶
type DataRepository struct {
DB *database.RxDbClient
}
func (*DataRepository) ConcurrentFetchFromRecords ¶
func (rep *DataRepository) ConcurrentFetchFromRecords(batchSize int, f func(list []entity.DataRecord) bool) error
func (*DataRepository) ConcurrentFetchFromTechRecords ¶
func (rep *DataRepository) ConcurrentFetchFromTechRecords(batchSize int, f func(list []entity.DataRecord) bool) error
func (*DataRepository) CountRecords ¶
func (rep *DataRepository) CountRecords() (int, error)
can be optimized with estimate
SELECT
((reltuples/relpages) * (
pg_relation_size('data_records') /
(current_setting('block_size')::integer)
))::integer
FROM pg_class where relname = 'data_records';
func (*DataRepository) CountTechRecords ¶
func (rep *DataRepository) CountTechRecords() (int, error)
func (*DataRepository) GetMaxVersionFromRecords ¶
func (rep *DataRepository) GetMaxVersionFromRecords() (int, error)
func (*DataRepository) GetMaxVersionFromTechRecords ¶
func (rep *DataRepository) GetMaxVersionFromTechRecords() (int, error)
func (*DataRepository) UnloadRecordById ¶
func (rep *DataRepository) UnloadRecordById(listId []string, techRecord bool) ([]entity.DataRecord, error)
func (*DataRepository) UseRecordsCursor ¶
func (rep *DataRepository) UseRecordsCursor(batchSize int, f func(list []entity.DataRecord) bool) error
func (*DataRepository) UseTechRecordsCursor ¶
func (rep *DataRepository) UseTechRecordsCursor(batchSize int, f func(list []entity.DataRecord) bool) error
Click to show internal directories.
Click to hide internal directories.