AnalyzeAllTables performs an ANALYZE on all tables after setting default_statistics_target for the transaction.
AnalyzeTable performs an ANALYZE on the specified table after setting default_statistics_target for the transaction.
CheckColumnDataType gets the data type of specified table column .
CheckCurrentTimeZone queries for the currently set postgres time zone.
CheckDefaultTimeZone queries for the default postgres time zone.
No description provided by the author
Connect opens a connection to a PostgreSQL database.
No description provided by the author
No description provided by the author
No description provided by the author
CreateTable creates one of the known tables by name.
CreateTableLegacy creates one of the known tables by name.
CreateTables creates all tables required by dcrdata if they do not already exist.
CreateTablesLegacy creates all tables required by dcrdata if they do not already exist.
DBBestBlock retrieves the best block hash and height from the meta table.
DBVersion retrieves the database version from the meta table.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
DeleteBestBlock removes all data for the best block in the DB from every table via DeleteBlockData.
DeleteBlockData removes all data for the specified block from every table.
DeleteBlocks removes all data for the N best blocks in the DB from every table via repeated calls to DeleteBestBlock.
DeleteDuplicateAgendas deletes rows in agendas with duplicate names leaving the one row with the lowest id.
DeleteDuplicateAgendaVotes deletes rows in agenda_votes with duplicate votes-row-id and agendas-row-id leaving the one row with the lowest id.
DeleteDuplicateMisses deletes rows in misses with duplicate tx-block hashes, leaving the one row with the lowest id.
DeleteDuplicateTickets deletes rows in tickets with duplicate tx-block hashes, leaving the one row with the lowest id.
DeleteDuplicateTxns deletes rows in transactions with duplicate tx-block hashes, leaving the one row with the lowest id.
DeleteDuplicateVins deletes rows in vin with duplicate tx information, leaving the one row with the lowest id.
DeleteDuplicateVinsCockroach deletes rows in vin with duplicate tx information, leaving the one row with the lowest id.
DeleteDuplicateVotes deletes rows in votes with duplicate tx-block hashes, leaving the one row with the lowest id.
DeleteDuplicateVouts deletes rows in vouts with duplicate tx information, leaving the one row with the lowest id.
DeleteDuplicateVoutsCockroach deletes rows in vouts with duplicate tx information, leaving the one row with the highest id.
DisableLog disables all library log output.
DropTables drops all of the tables internally recognized tables.
DropTestingTable drops only the "testing" table.
ExistsIndex checks if the specified index name exists.
IBDComplete indicates whether initial block download was completed according to the meta.ibd_complete flag.
IndexAddressTableOnAddress creates the index for the addresses table over address.
IndexAddressTableOnTxHash creates the index for the addresses table over transaction hash.
IndexAddressTableOnVoutID creates the index for the addresses table over vout row ID.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
IndexBlockTimeOnTableAddress creates the index for the addresses table over block time.
IndexMatchingTxHashOnTableAddress creates the index for the addresses table over matching transaction hash.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
IndexVotesTableOnBlockTime improves the speed of "Vote Choices By Block" agendas chart query.
No description provided by the author
No description provided by the author
IndexVotesTableOnHeight improves the speed of "Cumulative Vote Choices" agendas chart query.
No description provided by the author
IndexVoutTableOnTxHashIdx creates the index for the addresses table over transaction hash and index.
InsertAddressRow inserts an AddressRow (input or output), returning the row ID in the addresses table of the inserted data.
InsertAddressRows inserts multiple transaction inputs or outputs for certain addresses ([]AddressRow).
InsertAddressRowsDbTx is like InsertAddressRows, except that it takes a sql.Tx.
InsertBlock inserts the specified dbtypes.Block as with the given valid/mainchain status.
InsertBlockPrevNext inserts a new row of the block_chain table.
InsertProposal adds the proposal details per commit to the proposal table.
InsertProposalVote add the proposal votes entries to the proposal_votes table.
InsertSpendingAddressRow inserts a new spending tx row, and updates any corresponding funding tx row.
InsertTickets takes a slice of *dbtypes.Tx and corresponding DB row IDs for transactions, extracts the tickets, and inserts the tickets into the database.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
InsertVin either inserts, attempts to insert, or upserts the given vin data into the vins table.
InsertVins is like InsertVin, except that it operates on a slice of vin data.
InsertVinsDbTxn is like InsertVins, except that it takes a sql.Tx.
InsertVinsStmt is like InsertVins, except that it takes a sql.Stmt.
InsertVotes takes a slice of *dbtypes.Tx, which must contain all the stake transactions in a block, extracts the votes, and inserts the votes into the database.
InsertVout either inserts, attempts to insert, or upserts the given vout data into the vouts table.
InsertVouts is like InsertVout, except that it operates on a slice of vout data.
InsertVoutsDbTxn is like InsertVouts, except that it takes a sql.Tx.
InsertVoutsStmt is like InsertVouts, except that it takes a sql.Stmt.
IsRetryError checks if an error is a retryError type.
IsUniqueIndex checks if the given index name is defined as UNIQUE.
MakeCsvAddressRows converts an AddressRow slice into a [][]string, including column headers, suitable for saving to CSV.
No description provided by the author
NewChainDB constructs a ChainDB for the given connection and Decred network parameters.
NewChainDBRPC contains ChainDB and RPC client parameters.
NewChainDBWithCancel constructs a cancellation-capable ChainDB for the given connection and Decred network parameters.
NewDatabaseVersion returns a new DatabaseVersion with the version major.minor.patch.
NewTableVersion returns a new TableVersion with the version major.minor.patch.
NewTicketTxnIDGetter constructs a new TicketTxnIDGetter with an empty cache.
RetrieveAddressBalance gets the numbers of spent and unspent outpoints for the given address, the total amounts spent and unspent, the number of distinct spending transactions, and the fraction spent to and received from stake-related transactions.
No description provided by the author
RetrieveAddressDbUTXOs gets the unspent transaction outputs (UTXOs) paying to the specified address as a []*dbtypes.AddressTxnOutput.
No description provided by the author
RetrieveAddressIDsByOutpoint gets all address row IDs, addresses, and values for a given outpoint.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
RetrieveAddressTxnsOrdered will get all transactions for addresses provided and return them sorted by time in descending order.
No description provided by the author
RetrieveAddressUTXOs gets the unspent transaction outputs (UTXOs) paying to the specified address as a []*apitypes.AddressTxnOutput.
RetrieveAllAddressMergedTxns retrieves all merged rows of the address table pertaining to the given address.
RetrieveAllAddressTxns retrieves all rows of the address table pertaining to the given address.
RetrieveAllMainchainAddressTxns retrieves all non-merged and valid_mainchain rows of the address table pertaining to the given address.
RetrieveAllRevokes gets for all ticket revocations the row IDs (primary keys), transaction hashes, block heights.
RetrieveAllVinDbIDs gets every row ID (the primary keys) for the vins table.
RetrieveAllVotesDbIDsHeightsTicketDbIDs gets for all votes the row IDs (primary keys) in the votes table, the block heights, and the row IDs in the tickets table of the spent tickets.
RetrieveBestBlock gets the best block height and hash (main chain only).
RetrieveBestBlockHeight gets the best block height and hash (main chain only).
RetrieveBestBlockHeightAny gets the best block height, including side chains.
RetrieveBlockChainDbID retrieves the row id in the block_chain table of the block with the given hash, if it exists (be sure to check error against sql.ErrNoRows!).
RetrieveBlockFlags retrieves the block's is_valid and is_mainchain flags.
RetrieveBlockHash retrieves the hash of the block at the given height, if it exists (be sure to check error against sql.ErrNoRows!).
RetrieveBlockHeight retrieves the height of the block with the given hash, if it exists (be sure to check error against sql.ErrNoRows!).
RetrieveBlocksHashesAll retrieve the hash of every block in the blocks table, ordered by their row ID.
RetrieveBlockStatus retrieves the block chain status for the block with the specified hash.
RetrieveBlockSummaryByTimeRange retrieves the slice of block summaries for the given time range.
RetrieveBlockTimeByHeight retrieves time hash of the main chain block at the given height, if it exists (be sure to check error against sql.ErrNoRows!).
RetrieveBlockVoteCount gets the number of votes mined in a block.
RetrieveDbTxByHash retrieves a row of the transactions table corresponding to the given transaction hash.
RetrieveDbTxsByHash retrieves all the rows of the transactions table, including the primary keys/ids, for the given transaction hash.
RetrieveDisapprovedBlocks retrieves the block chain status for all blocks that had their regular transactions invalidated by stakeholder disapproval.
RetrieveFullTxByHash gets all data from the transactions table for the transaction specified by its hash.
RetrieveFundingOutpointByTxIn gets the previous outpoint for a transaction input specified by transaction hash and input index.
RetrieveFundingOutpointByVinID gets the previous outpoint for a transaction input specified by row ID in the vins table.
RetrieveFundingOutpointIndxByVinID gets the transaction output index of the previous outpoint for a transaction input specified by row ID in the vins table.
RetrieveFundingTxByTxIn gets the transaction hash of the previous outpoint for a transaction input specified by hash and input index.
RetrieveFundingTxByVinDbID gets the transaction hash of the previous outpoint for a transaction input specified by row ID in the vins table.
TODO: this does not appear correct.
RetrieveMissedVotesInBlock gets a list of ticket hashes that were called to vote in the given block, but missed their vote.
RetrieveMissesForTicket gets all of the blocks in which the ticket was called to place a vote on the previous block.
RetrieveMissForTicket gets the mainchain block in which the ticket was called to place a vote on the previous block.
RetrievePGVersion retrieves the version of the connected PostgreSQL server.
No description provided by the author
No description provided by the author
No description provided by the author
RetrievePreviousHashByBlockHash retrieves the previous block hash for the given block from the blocks table.
RetrieveSideChainBlocks retrieves the block chain status for all known side chain blocks.
RetrieveSideChainTips retrieves the block chain status for all known side chain tip blocks.
RetrieveSpendingTxByTxOut gets any spending transaction input info for a previous outpoint specified by funding transaction hash and vout number.
RetrieveSpendingTxByVinID gets the spending transaction input (hash, vin number, and tx tree) for the transaction input specified by row ID in the vins table.
RetrieveSpendingTxsByFundingTx gets info on all spending transaction inputs for the given funding transaction specified by DB row ID.
RetrieveSpendingTxsByFundingTxWithBlockHeight will retrieve all transactions, indexes and block heights funded by a specific transaction.
RetrieveSysSettingsConfFile retrieves settings that are set by a configuration file (rather than default, environment variable, etc.).
RetrieveSysSettingsPerformance retrieves performance-related settings.
RetrieveSysSettingsServer a key server configuration settings (config_file, data_directory, max_connections, dynamic_shared_memory_type, max_files_per_process, port, unix_socket_directories), which may be helpful in debugging connectivity issues or other DB errors.
RetrieveSysSettingSyncCommit retrieves the synchronous_commit setting.
RetrieveTicketIDByHashNoCancel gets the db row ID (primary key) in the tickets table for the given ticket hash.
RetrieveTicketIDsByHashes gets the db row IDs (primary keys) in the tickets table for the given ticket purchase transaction hashes.
RetrieveTicketInfoByHash retrieves the ticket spend and pool statuses as well as the purchase and spending block info and spending txid.
RetrieveTicketStatusByHash gets the spend status and ticket pool status for the given ticket hash.
No description provided by the author
No description provided by the author
RetrieveTxnsBlocks retrieves for the specified transaction hash the following data for each block containing the transactions: block_hash, block_index, is_valid, is_mainchain.
RetrieveTxnsVinsByBlock retrieves for all the transactions in the specified block the vin_db_ids arrays, is_valid, and is_mainchain.
RetrieveTxnsVinsVoutsByBlock retrieves for all the transactions in the specified block the vin_db_ids and vout_db_ids arrays.
RetrieveTxsBestBlockMainchain returns the best mainchain block's height from the transactions table.
RetrieveTxsBlocksAboveHeight returns all distinct mainchain block heights and hashes referenced in the transactions table above the given height.
RetrieveTxsByBlockHash retrieves all transactions in a given block.
RetrieveUnspentTickets gets all unspent tickets.
RetrieveUTXOs gets the entire UTXO set from the vouts and vins tables.
RetrieveVinByID gets from the vins table for the provided row ID.
RetrieveVinsByIDs retrieves vin details for the rows of the vins table specified by the provided row IDs.
No description provided by the author
RetrieveVoutsByIDs retrieves vout details for the rows of the vouts table specified by the provided row IDs.
No description provided by the author
No description provided by the author
SetDBBestBlock sets the best block hash and height in the meta table.
SetIBDComplete set the ibd_complete (Initial Block Download complete) flag in the meta table.
SetMainchainByBlockHash is used to set the is_mainchain flag for the given block.
SetPoolStatusForTickets sets the ticket pool status for the tickets specified by db row ID.
SetPoolStatusForTicketsByHash sets the ticket pool status for the tickets specified by ticket purchase transaction hash.
SetSpendingForFundingOP updates funding rows of the addresses table with the provided spending transaction output info.
SetSpendingForTickets sets the spend type, spend height, spending transaction row IDs (in the table relevant to the spend type), and ticket pool status for the given tickets specified by their db row IDs.
SetSpendingForVinDbID updates rows of the addresses table with spending information from the row of the vins table specified by vinDbID.
SetSpendingForVinDbIDs updates rows of the addresses table with spending information from the rows of the vins table specified by vinDbIDs.
SetSynchronousCommit sets the synchronous_commit setting.
TableExists checks if the specified table exists.
TableUpgradesRequired builds a list of table upgrade information for each of the supported auxiliary db tables.
TableVersionCompatible indicates if the table versions are compatible (equal), and if not, what is the required action (rebuild, upgrade, or reindex).
TableVersions retrieve and maps the tables names in the auxiliary db to their current table versions.
TicketPoolData is a thread-safe way to access the ticketpool graphs data stored in the cache.
UpdateAddressesMainchainByIDs sets the valid_mainchain column for the addresses specified by their vin (spending) or vout (funding) row IDs.
UpdateBlockNext sets the next block's hash for the specified row of the block_chain table specified by DB row ID.
UpdateBlockNextByHash sets the next block's hash for the block in the block_chain table specified by hash.
UpdateBlockNextByNextHash sets the next block's hash for the block in the block_chain table with a current next_hash specified by hash.
UpdateLastAddressesValid sets valid_mainchain as specified by isValid for addresses table rows pertaining to regular (non-stake) transactions found in the given block.
UpdateLastBlockValid updates the is_valid column of the block specified by the row id for the blocks table.
UpdateLastVins updates the is_valid and is_mainchain columns in the vins table for all of the transactions in the block specified by the given block hash.
UpdateTicketPoolData updates the ticket pool cache with the latest data fetched.
UpdateTicketsMainchain sets the is_mainchain column for the tickets in the specified block.
UpdateTransactionsMainchain sets the is_mainchain column for the transactions in the specified block.
UpdateTransactionsValid sets the is_valid column of the transactions table for the regular (non-stake) transactions in the specified block.
UpdateVotesMainchain sets the is_mainchain column for the votes in the specified block.
UpgradeDatabase attempts to upgrade the given sql.DB with help from the BlockGetter.
UseLogger uses a specified Logger to output package logging info.