Skip to content

Commit f885448

Browse files
SL-9970 Added a method to get the extended error code
1 parent f66d730 commit f885448

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

CppSQLite3.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,16 @@ const unsigned char* CppSQLite3Query::getBlobField(CppSQLite3StringView field, i
360360
}
361361

362362

363+
int CppSQLite3Query::getExtendedErrorCode() const
364+
{
365+
if (mConfig.db != nullptr) {
366+
return sqlite3_extended_errcode(mConfig.db);
367+
}
368+
else {
369+
return -1;
370+
}
371+
}
372+
363373
bool CppSQLite3Query::fieldIsNull(int nField) const
364374
{
365375
return (fieldDataType(nField) == SQLITE_NULL);

CppSQLite3.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ class CppSQLite3Query
147147
const unsigned char* getBlobField(int nField, int& nLen) const;
148148
const unsigned char* getBlobField(CppSQLite3StringView field, int& nLen) const;
149149

150+
int getExtendedErrorCode() const;
151+
150152
bool fieldIsNull(int nField) const;
151153
bool fieldIsNull(CppSQLite3StringView field) const;
152154

0 commit comments

Comments
 (0)