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

Function initChainDBConnection

api/models/models.go:42–53  ·  view source on GitHub ↗
(dbFile string)

Source from the content-addressed store, hash-verified

40}
41
42func initChainDBConnection(dbFile string) (err error) {
43 chaindb, err = OpenSQLiteDBAsGorp(dbFile, "ro", 100, 30)
44 if err != nil {
45 return err
46 }
47
48 // register tables
49 chaindb.AddTableWithName(Block{}, "indexed_blocks").SetKeys(false, "Height")
50 chaindb.AddTableWithName(Transaction{}, "indexed_transactions").SetKeys(false, "BlockHeight", "TxIndex")
51
52 return nil
53}

Callers 1

InitModelsFunction · 0.85

Calls 1

OpenSQLiteDBAsGorpFunction · 0.85

Tested by

no test coverage detected