Esempio n. 1
0
        public long GetTransactionSourceOutputRowsToUpdate()
        {
            const string sqlCountRowsToUpdateCommand = @"SELECT COUNT(1) FROM TransactionInput WHERE SourceTransactionOutputId = -1";

            return(AdoNetLayer.ConvertDbValue <int>(this.adoNetLayer.ExecuteScalar(sqlCountRowsToUpdateCommand)));
        }
Esempio n. 2
0
 public bool IsSchemaSetup()
 {
     return(AdoNetLayer.ConvertDbValue <int>(this.adoNetLayer.ExecuteScalar(
                                                 "SELECT CASE WHEN EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'dbo' AND TABLE_NAME = 'BtcDbSettings') THEN 1 ELSE 0 END AS IsSchemaSetup")) == 1);
 }
Esempio n. 3
0
 public string GetLastKnownBlockchainFileName()
 {
     return(AdoNetLayer.ConvertDbValue <string>(this.adoNetLayer.ExecuteScalar("SELECT TOP 1 BlockchainFileName FROM BlockchainFile ORDER BY BlockchainFileId DESC")));
 }
Esempio n. 4
0
 public bool IsDatabaseEmpty()
 {
     return(AdoNetLayer.ConvertDbValue <int>(this.adoNetLayer.ExecuteScalar("SELECT CASE WHEN EXISTS (SELECT 1 FROM Block) THEN 0 ELSE 1 END AS IsEmpty")) == 1);
 }