mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-24 21:15:58 +00:00
Add support for detecting NULL entires to sqlite.
This commit is contained in:
@@ -120,6 +120,11 @@ bool SqliteDatabase::getNextRow()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool SqliteDatabase::getNull(int colIndex)
|
||||||
|
{
|
||||||
|
return(SQLITE_NULL == sqlite3_column_type(mCurrentStmt, colIndex));
|
||||||
|
}
|
||||||
|
|
||||||
char* SqliteDatabase::getStr(int colIndex,std::string& retStr)
|
char* SqliteDatabase::getStr(int colIndex,std::string& retStr)
|
||||||
{
|
{
|
||||||
retStr=(char*)sqlite3_column_text(mCurrentStmt, colIndex);
|
retStr=(char*)sqlite3_column_text(mCurrentStmt, colIndex);
|
||||||
@@ -172,4 +177,5 @@ void SqliteDatabase::escape(const unsigned char* start, int size, std::string& r
|
|||||||
|
|
||||||
}
|
}
|
||||||
retStr.push_back('\'');
|
retStr.push_back('\'');
|
||||||
}
|
}
|
||||||
|
// vim:ts=4
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ public:
|
|||||||
// will return false if there are no more rows
|
// will return false if there are no more rows
|
||||||
bool getNextRow();
|
bool getNextRow();
|
||||||
|
|
||||||
|
bool getNull(int colIndex);
|
||||||
char* getStr(int colIndex,std::string& retStr);
|
char* getStr(int colIndex,std::string& retStr);
|
||||||
int32 getInt(int colIndex);
|
int32 getInt(int colIndex);
|
||||||
float getFloat(int colIndex);
|
float getFloat(int colIndex);
|
||||||
@@ -39,4 +40,4 @@ public:
|
|||||||
|
|
||||||
void escape(const unsigned char* start,int size,std::string& retStr);
|
void escape(const unsigned char* start,int size,std::string& retStr);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user