Documentation ¶
Overview ¶
Package schema contains the database schema, migrations and seeding data.
Index ¶
- Constants
- func InsertAcctViewsForGlobalDB(ctx context.Context, client *kivik.Client, dbName string) error
- func InsertApplicationViewsForGlobalDB(ctx context.Context, client *kivik.Client, dbName string) error
- func InsertAssetViewsForGlobalDB(ctx context.Context, client *kivik.Client, dbName string) error
- func InsertBlockViewForGlobalDB(ctx context.Context, client *kivik.Client, dbName string) error
- func InsertBlockViewsForGlobalDB(ctx context.Context, client *kivik.Client, dbName string) error
- func InsertLatestViewForBlocksDB(ctx context.Context, client *kivik.Client, dbName string) error
- func InsertQueryViewForTransactionDB(ctx context.Context, client *kivik.Client, dbName string) error
- func InsertTransactionViewsForGlobalDB(ctx context.Context, client *kivik.Client, dbName string) error
- func Migrate(ctx context.Context, db *kivik.Client, dbName string) error
Constants ¶
const ( BlockDDoc = "_design/block" BlockViewByRoundNo = "blockByRoundNo" BlockViewByRoundCount = "blockByRoundNoCount" TransactionDDoc = "_design/txn" TransactionViewInLatest = "txnInLatest" TransactionViewByID = "txnById" TransactionViewByIDCount = "txnByIdCount" TransactionViewByAccount = "txnByAcct" TransactionViewByAccountCount = "txnByAcctCount" TransactionViewByAsset = "txnByAsset" TransactionViewByAssetCount = "txnByAssetCount" TransactionViewByApplication = "txnByApp" TransactionViewByApplicationCount = "txnByAppCount" AccountDDoc = "_design/acct" AccountViewByIDInLatest = "acctByLatest" AccountViewByIDInCount = "acctByCount" AssetDDoc = "_design/asset" AssetViewByIDInLatest = "assetByLatest" AssetViewByIDInCount = "assetByCount" ApplicationDDoc = "_design/app" ApplicationViewByIDInLatest = "appByLatest" ApplicationViewByIDInCount = "appByCount" )
Variables ¶
This section is empty.
Functions ¶
func InsertAcctViewsForGlobalDB ¶
InsertAcctViewsForGlobalDB creates a the latest view for the acct design document. It stores transaction data.
func InsertApplicationViewsForGlobalDB ¶
func InsertApplicationViewsForGlobalDB(ctx context.Context, client *kivik.Client, dbName string) error
InsertApplicationViewsForGlobalDB creates a the latest view for the app design document. It stores application data.
func InsertAssetViewsForGlobalDB ¶
InsertAssetViewsForGlobalDB creates a the latest view for the asset design document. It stores asset data.
func InsertBlockViewForGlobalDB ¶
InsertBlockViewForGlobalDB inserts a view that is specifically for blocks. It stores the block data in using the round number as ID, in the format of `block_ROUND_NO`.
func InsertBlockViewsForGlobalDB ¶
InsertBlockViewsForGlobalDB creates a the latest view for the block design document. It stores block data.
func InsertLatestViewForBlocksDB ¶
InsertLatestViewForBlocksDB inserts the latest view into the blocks database. If it exists, continue. Else, create it.
func InsertQueryViewForTransactionDB ¶
func InsertQueryViewForTransactionDB(ctx context.Context, client *kivik.Client, dbName string) error
InsertQueryViewForTransactionDB inserts the query view into the transactions databae. If it exists, continue. Else, create it.
Types ¶
This section is empty.