MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / loadAndCacheShardChainProfiles

Function loadAndCacheShardChainProfiles

blockproducer/storage.go:594–618  ·  view source on GitHub ↗
(st xi.Storage, view *metaState)

Source from the content-addressed store, hash-verified

592}
593
594func loadAndCacheShardChainProfiles(st xi.Storage, view *metaState) (err error) {
595 var (
596 rows *sql.Rows
597 id string
598 enc []byte
599 )
600
601 if rows, err = st.Reader().Query(`SELECT "id", "encoded" FROM "shardChain"`); err != nil {
602 return
603 }
604 defer rows.Close()
605
606 for rows.Next() {
607 if err = rows.Scan(&id, &enc); err != nil {
608 return
609 }
610 var dec = &types.SQLChainProfile{}
611 if err = utils.DecodeMsgPack(enc, dec); err != nil {
612 return
613 }
614 view.readonly.databases[proto.DatabaseID(id)] = dec
615 }
616
617 return
618}
619
620func loadAndCacheProviders(st xi.Storage, view *metaState) (err error) {
621 var (

Callers 1

loadImmutableStateFunction · 0.85

Calls 7

DecodeMsgPackFunction · 0.92
DatabaseIDTypeAlias · 0.92
QueryMethod · 0.65
ReaderMethod · 0.65
CloseMethod · 0.65
NextMethod · 0.45
ScanMethod · 0.45

Tested by

no test coverage detected