model

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2019 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetSchema

func SetSchema(s string)

Types

type DataRepository

type DataRepository struct {
	DB *database.RxDbClient
}

func (*DataRepository) ConcurrentFetchFromRecords

func (rep *DataRepository) ConcurrentFetchFromRecords(batchSize int, f func(list []entity.TransitDataRecord) bool) error

func (*DataRepository) ConcurrentFetchFromTechRecords

func (rep *DataRepository) ConcurrentFetchFromTechRecords(batchSize int, f func(list []entity.TransitDataRecord) 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) GetRecordsByIdList added in v1.1.1

func (rep *DataRepository) GetRecordsByIdList(listId []string, techRecord bool) ([]entity.TransitDataRecord, error)

func (*DataRepository) UseRecordsCursor

func (rep *DataRepository) UseRecordsCursor(batchSize int, f func(list []entity.TransitDataRecord) bool) error

func (*DataRepository) UseTechRecordsCursor

func (rep *DataRepository) UseTechRecordsCursor(batchSize int, f func(list []entity.TransitDataRecord) bool) error

Jump to

Keyboard shortcuts

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