Performance optimizations for database libraries.

This commit is contained in:
Alex Shvartzkop
2024-02-23 17:22:20 +00:00
committed by dsa-t
parent 3e26e7b646
commit e68df8e1d1
8 changed files with 106 additions and 54 deletions
+4 -2
View File
@@ -448,7 +448,7 @@ bool DATABASE_CONNECTION::SelectOne( const std::string& aTable,
{
aResult[column] = fmt::format( "{:G}", results.get<double>( i ) );
}
catch( nanodbc::null_access_error& e )
catch( nanodbc::null_access_error& )
{
// Column was empty (null)
aResult[column] = std::string();
@@ -498,6 +498,8 @@ bool DATABASE_CONNECTION::SelectAll( const std::string& aTable, const std::strin
{
wxLogTrace( traceDatabase, wxT( "SelectAll: `%s` - cache hit" ), aTable );
aResults.reserve( cacheEntry.size() );
for( auto &[ key, row ] : cacheEntry )
aResults.emplace_back( row );
@@ -605,7 +607,7 @@ bool DATABASE_CONNECTION::SelectAll( const std::string& aTable, const std::strin
{
result[column] = fmt::format( "{:G}", results.get<double>( j ) );
}
catch( nanodbc::null_access_error& e )
catch( nanodbc::null_access_error& )
{
// Column was empty (null)
result[column] = std::string();