schema

package
v0.0.0-...-8401909 Latest Latest
Warning

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

Go to latest
Published: May 4, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package schema contains the database schema, migrations and seeding data.

Index

Constants

View Source
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

func InsertAcctViewsForGlobalDB(ctx context.Context, client *kivik.Client, dbName string) error

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

func InsertAssetViewsForGlobalDB(ctx context.Context, client *kivik.Client, dbName string) error

InsertAssetViewsForGlobalDB creates a the latest view for the asset design document. It stores asset data.

func InsertBlockViewForGlobalDB

func InsertBlockViewForGlobalDB(ctx context.Context, client *kivik.Client, dbName string) error

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

func InsertBlockViewsForGlobalDB(ctx context.Context, client *kivik.Client, dbName string) error

InsertBlockViewsForGlobalDB creates a the latest view for the block design document. It stores block data.

func InsertLatestViewForBlocksDB

func InsertLatestViewForBlocksDB(ctx context.Context, client *kivik.Client, dbName string) error

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.

func InsertTransactionViewsForGlobalDB

func InsertTransactionViewsForGlobalDB(ctx context.Context, client *kivik.Client, dbName string) error

InsertTransactionViewsForGlobalDB creates a the latest view for the transaction design document. It stores transaction data.

func Migrate

func Migrate(ctx context.Context, db *kivik.Client, dbName string) error

Migrate attempts to bring the schema for db up to date with the migrations defined in this package.

Types

This section is empty.

Jump to

Keyboard shortcuts

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