From: Daniel Kita Date: Fri, 20 Sep 2024 11:23:14 +0000 (+0200) Subject: Remove unused DataCommand&DataCommandHandler methods X-Git-Tag: accepted/tizen/8.0/unified/20241014.163634~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eabc36a70416560b71e122994df584c2a0ffec6c;p=platform%2Fcore%2Fsecurity%2Fkey-manager.git Remove unused DataCommand&DataCommandHandler methods Change-Id: I95874df17a9073dfd5430de2bb2fc961e97358ee --- diff --git a/src/manager/dpl/db/include/dpl/db/sql_connection.h b/src/manager/dpl/db/include/dpl/db/sql_connection.h index 46849c22..25411b65 100644 --- a/src/manager/dpl/db/include/dpl/db/sql_connection.h +++ b/src/manager/dpl/db/include/dpl/db/sql_connection.h @@ -145,54 +145,6 @@ public: */ void BindInteger(ArgumentIndex position, int value); - /** - * Bind int8_t to the prepared statement argument - * - * @param position Index of argument to bind value to - * @param value Value to bind - */ - void BindInt8(ArgumentIndex position, int8_t value); - - /** - * Bind int16 to the prepared statement argument - * - * @param position Index of argument to bind value to - * @param value Value to bind - */ - void BindInt16(ArgumentIndex position, int16_t value); - - /** - * Bind int32 to the prepared statement argument - * - * @param position Index of argument to bind value to - * @param value Value to bind - */ - void BindInt32(ArgumentIndex position, int32_t value); - - /** - * Bind int64 to the prepared statement argument - * - * @param position Index of argument to bind value to - * @param value Value to bind - */ - void BindInt64(ArgumentIndex position, int64_t value); - - /** - * Bind float to the prepared statement argument - * - * @param position Index of argument to bind value to - * @param value Value to bind - */ - void BindFloat(ArgumentIndex position, float value); - - /** - * Bind double to the prepared statement argument - * - * @param position Index of argument to bind value to - * @param value Value to bind - */ - void BindDouble(ArgumentIndex position, double value); - /** * Bind string to the prepared statement argument * @@ -209,77 +161,6 @@ public: */ void BindBlob(ArgumentIndex position, const RawBuffer &value); - /** - * Bind optional int to the prepared statement argument. - * If optional is not set null will be bound - * - * @param position Index of argument to bind value to - * @param value Value to bind - */ - void BindInteger(ArgumentIndex position, const boost::optional &value); - - /** - * Bind optional int8 to the prepared statement argument. - * If optional is not set null will be bound - * - * @param position Index of argument to bind value to - * @param value Value to bind - */ - void BindInt8(ArgumentIndex position, const boost::optional &value); - - /** - * Bind optional int16 to the prepared statement argument. - * If optional is not set null will be bound - * - * @param position Index of argument to bind value to - * @param value Value to bind - */ - void BindInt16(ArgumentIndex position, const boost::optional &value); - - /** - * Bind optional int32 to the prepared statement argument. - * If optional is not set null will be bound - * - * @param position Index of argument to bind value to - * @param value Value to bind - */ - void BindInt32(ArgumentIndex position, const boost::optional &value); - - /** - * Bind optional int64 to the prepared statement argument. - * If optional is not set null will be bound - * - * @param position Index of argument to bind value to - * @param value Value to bind - */ - void BindInt64(ArgumentIndex position, const boost::optional &value); - - /** - * Bind optional float to the prepared statement argument. - * If optional is not set null will be bound - * - * @param position Index of argument to bind value to - * @param value Value to bind - */ - void BindFloat(ArgumentIndex position, const boost::optional &value); - - /** - * Bind optional double to the prepared statement argument. - * If optional is not set null will be bound - * - * @param position Index of argument to bind value to - * @param value Value to bind - */ - void BindDouble(ArgumentIndex position, const boost::optional &value); - - /** - * Bind optional string to the prepared statement argument. - * If optional is not set null will be bound - * - * @param position Index of argument to bind value to - * @param value Value to bind - */ - void BindBlob(ArgumentIndex position, const boost::optional &value); /** * Execute the prepared statement and/or move @@ -300,13 +181,6 @@ public: */ void Reset(); - /** - * Checks whether column value is null - * - * @throw Exception::InvalidColumn - */ - bool IsColumnNull(ColumnIndex column); - /** * Get integer value from column in current row. * @@ -314,47 +188,6 @@ public: */ int GetColumnInteger(ColumnIndex column); - /** - * Get int8 value from column in current row. - * - * @throw Exception::InvalidColumn - */ - int8_t GetColumnInt8(ColumnIndex column); - - /** - * Get int16 value from column in current row. - * - * @throw Exception::InvalidColumn - */ - int16_t GetColumnInt16(ColumnIndex column); - /** - * Get int32 value from column in current row. - * - * @throw Exception::InvalidColumn - */ - int32_t GetColumnInt32(ColumnIndex column); - - /** - * Get int64 value from column in current row. - * - * @throw Exception::InvalidColumn - */ - int64_t GetColumnInt64(ColumnIndex column); - - /** - * Get float value from column in current row. - * - * @throw Exception::InvalidColumn - */ - float GetColumnFloat(ColumnIndex column); - - /** - * Get double value from column in current row. - * - * @throw Exception::InvalidColumn - */ - double GetColumnDouble(ColumnIndex column); - /** * Get string value from column in current row. * @@ -368,62 +201,6 @@ public: * @throw Exception::InvalidColumn */ RawBuffer GetColumnBlob(ColumnIndex column); - - /** - * Get optional integer value from column in current row. - * - * @throw Exception::InvalidColumn - */ - boost::optional GetColumnOptionalInteger(ColumnIndex column); - - /** - * Get optional int8 value from column in current row. - * - * @throw Exception::InvalidColumn - */ - boost::optional GetColumnOptionalInt8(ColumnIndex column); - - /** - * Get optional int16value from column in current row. - * - * @throw Exception::InvalidColumn - */ - boost::optional GetColumnOptionalInt16(ColumnIndex column); - - /** - * Get optional int32 value from column in current row. - * - * @throw Exception::InvalidColumn - */ - boost::optional GetColumnOptionalInt32(ColumnIndex column); - - /** - * Get optional int64 value from column in current row. - * - * @throw Exception::InvalidColumn - */ - boost::optional GetColumnOptionalInt64(ColumnIndex column); - - /** - * Get optional float value from column in current row. - * - * @throw Exception::InvalidColumn - */ - boost::optional GetColumnOptionalFloat(ColumnIndex column); - - /** - * Get optional double value from column in current row. - * - * @throw Exception::InvalidColumn - */ - boost::optional GetColumnOptionalDouble(ColumnIndex column); - - /** - * Get string value from column in current row. - * - * @throw Exception::InvalidColumn - */ - boost::optional GetColumnOptionalBlob(ColumnIndex column); }; class DataCommandHandler { @@ -437,124 +214,18 @@ public: void BindInteger(ArgumentIndex pos, int val) { m_dataCommand.BindInteger(pos, val); } - void BindInt8(ArgumentIndex pos, int8_t val) { m_dataCommand.BindInt8(pos, val); } - - void BindInt16(ArgumentIndex pos, int8_t val) { m_dataCommand.BindInt16(pos, val); } - - void BindInt32(ArgumentIndex pos, int8_t val) { m_dataCommand.BindInt32(pos, val); } - - void BindInt64(ArgumentIndex pos, int8_t val) { m_dataCommand.BindInt64(pos, val); } - - void BindFloat(ArgumentIndex pos, float val) { m_dataCommand.BindFloat(pos, val); } - - void BindDouble(ArgumentIndex pos, double val) { m_dataCommand.BindDouble(pos, val); } - void BindString(ArgumentIndex pos, const char *val) { m_dataCommand.BindString(pos, val); } void BindBlob(ArgumentIndex pos, const RawBuffer &val) { m_dataCommand.BindBlob(pos, val); } - void BindInteger(ArgumentIndex pos, const boost::optional &val) - { - m_dataCommand.BindInteger(pos, val); - } - - void BindInt8(ArgumentIndex pos, const boost::optional &val) - { - m_dataCommand.BindInt8(pos, val); - } - - void BindInt16(ArgumentIndex pos, const boost::optional &val) - { - m_dataCommand.BindInt16(pos, val); - } - - void BindInt32(ArgumentIndex pos, const boost::optional &val) - { - m_dataCommand.BindInt32(pos, val); - } - - void BindInt64(ArgumentIndex pos, const boost::optional &val) - { - m_dataCommand.BindInt64(pos, val); - } - - void BindFloat(ArgumentIndex pos, const boost::optional &val) - { - m_dataCommand.BindFloat(pos, val); - } - - void BindDouble(ArgumentIndex pos, const boost::optional &val) - { - m_dataCommand.BindDouble(pos, val); - } - - void BindBlob(ArgumentIndex pos, const boost::optional &val) - { - m_dataCommand.BindBlob(pos, val); - } - bool Step() { return m_dataCommand.Step(); } - bool IsColumnNull(ColumnIndex col) { return m_dataCommand.IsColumnNull(col); } - int GetColumnInteger(ColumnIndex col) { return m_dataCommand.GetColumnInteger(col); } - int8_t GetColumnInt8(ColumnIndex col) { return m_dataCommand.GetColumnInt8(col); } - - int16_t GetColumnInt16(ColumnIndex col) { return m_dataCommand.GetColumnInt16(col); } - - int32_t GetColumnInt32(ColumnIndex col) { return m_dataCommand.GetColumnInt32(col); } - - int64_t GetColumnInt64(ColumnIndex col) { return m_dataCommand.GetColumnInt64(col); } - - float GetColumnFloat(ColumnIndex col) { return m_dataCommand.GetColumnFloat(col); } - - double GetColumnDouble(ColumnIndex col) { return m_dataCommand.GetColumnDouble(col); } - std::string GetColumnString(ColumnIndex col) { return m_dataCommand.GetColumnString(col); } RawBuffer GetColumnBlob(ColumnIndex col) { return m_dataCommand.GetColumnBlob(col); } - boost::optional GetColumnOptionalInteger(ColumnIndex col) - { - return m_dataCommand.GetColumnOptionalInteger(col); - } - - boost::optional GetColumnOptionalInt8(ColumnIndex col) - { - return m_dataCommand.GetColumnOptionalInt8(col); - } - - boost::optional GetColumnOptionalInt16(ColumnIndex col) - { - return m_dataCommand.GetColumnOptionalInt16(col); - } - - boost::optional GetColumnOptionalInt32(ColumnIndex col) - { - return m_dataCommand.GetColumnOptionalInt32(col); - } - - boost::optional GetColumnOptionalInt64(ColumnIndex col) - { - return m_dataCommand.GetColumnOptionalInt64(col); - } - - boost::optional GetColumnOptionalFloat(ColumnIndex col) - { - return m_dataCommand.GetColumnOptionalFloat(col); - } - - boost::optional GetColumnOptionalDouble(ColumnIndex col) - { - return m_dataCommand.GetColumnOptionalDouble(col); - } - - boost::optional GetColumnOptionalBlob(ColumnIndex col) - { - return m_dataCommand.GetColumnOptionalBlob(col); - } - private: DataCommand &m_dataCommand; }; @@ -648,21 +319,6 @@ public: */ void SetKey(const RawBuffer &rawPass); - /** - * ResetKey is used for changing key used for database encryption. - * If key was already set by using SetKey, this function will only change it. - * If no key was yet set, this function first will set key with rawPassOld and - * then change it to rawPassNew. - * Same rules for failing apply as for SetKey. - * Both password must have length >=1. - * - * @param rawPassOld current password for encryption in raw binary format - * @param rawPassNew new password for encryption in raw binary format - * - */ - void ResetKey(const RawBuffer &rawPassOld, - const RawBuffer &rawPassNew); - /** * Execute SQL command without result * @@ -716,13 +372,6 @@ public: */ bool CheckTableExist(const char *tableName); - /** - * Get last insert operation new row id - * - * @return Row ID - */ - RowID GetLastInsertRowID() const; - /** * Clear prepared SQL statements map * diff --git a/src/manager/dpl/db/src/sql_connection.cpp b/src/manager/dpl/db/src/sql_connection.cpp index 0bff4c0e..01e737e4 100644 --- a/src/manager/dpl/db/src/sql_connection.cpp +++ b/src/manager/dpl/db/src/sql_connection.cpp @@ -159,67 +159,6 @@ void SqlConnection::DataCommand::BindInteger( << position << "] -> " << value); } -//LCOV_EXCL_START -void SqlConnection::DataCommand::BindInt8( - SqlConnection::ArgumentIndex position, - int8_t value) -{ - CheckBindResult(sqlite3_bind_int(m_stmt, position, - static_cast(value))); - LogPedantic("SQL data command bind int8: [" - << position << "] -> " << value); -} - -void SqlConnection::DataCommand::BindInt16( - SqlConnection::ArgumentIndex position, - int16_t value) -{ - CheckBindResult(sqlite3_bind_int(m_stmt, position, - static_cast(value))); - LogPedantic("SQL data command bind int16: [" - << position << "] -> " << value); -} - -void SqlConnection::DataCommand::BindInt32( - SqlConnection::ArgumentIndex position, - int32_t value) -{ - CheckBindResult(sqlite3_bind_int(m_stmt, position, - static_cast(value))); - LogPedantic("SQL data command bind int32: [" - << position << "] -> " << value); -} - -void SqlConnection::DataCommand::BindInt64( - SqlConnection::ArgumentIndex position, - int64_t value) -{ - CheckBindResult(sqlite3_bind_int64(m_stmt, position, - static_cast(value))); - LogPedantic("SQL data command bind int64: [" - << position << "] -> " << value); -} - -void SqlConnection::DataCommand::BindFloat( - SqlConnection::ArgumentIndex position, - float value) -{ - CheckBindResult(sqlite3_bind_double(m_stmt, position, - static_cast(value))); - LogPedantic("SQL data command bind float: [" - << position << "] -> " << value); -} - -void SqlConnection::DataCommand::BindDouble( - SqlConnection::ArgumentIndex position, - double value) -{ - CheckBindResult(sqlite3_bind_double(m_stmt, position, value)); - LogPedantic("SQL data command bind double: [" - << position << "] -> " << value); -} -//LCOV_EXCL_STOP - void SqlConnection::DataCommand::BindString( SqlConnection::ArgumentIndex position, const char *value) @@ -255,88 +194,6 @@ void SqlConnection::DataCommand::BindBlob( << position << "] -> " << raw.size()); } -//LCOV_EXCL_START -void SqlConnection::DataCommand::BindInteger( - SqlConnection::ArgumentIndex position, - const boost::optional &value) -{ - if (!value) - BindNull(position); - else - BindInteger(position, *value); -} - -void SqlConnection::DataCommand::BindInt8( - SqlConnection::ArgumentIndex position, - const boost::optional &value) -{ - if (!value) - BindNull(position); - else - BindInt8(position, *value); -} - -void SqlConnection::DataCommand::BindInt16( - SqlConnection::ArgumentIndex position, - const boost::optional &value) -{ - if (!value) - BindNull(position); - else - BindInt16(position, *value); -} - -void SqlConnection::DataCommand::BindInt32( - SqlConnection::ArgumentIndex position, - const boost::optional &value) -{ - if (!value) - BindNull(position); - else - BindInt32(position, *value); -} - -void SqlConnection::DataCommand::BindInt64( - SqlConnection::ArgumentIndex position, - const boost::optional &value) -{ - if (!value) - BindNull(position); - else - BindInt64(position, *value); -} - -void SqlConnection::DataCommand::BindFloat( - SqlConnection::ArgumentIndex position, - const boost::optional &value) -{ - if (!value) - BindNull(position); - else - BindFloat(position, *value); -} - -void SqlConnection::DataCommand::BindDouble( - SqlConnection::ArgumentIndex position, - const boost::optional &value) -{ - if (!value) - BindNull(position); - else - BindDouble(position, *value); -} - -void SqlConnection::DataCommand::BindBlob( - SqlConnection::ArgumentIndex position, - const boost::optional &value) -{ - if (!!value) - BindBlob(position, *value); - else - BindNull(position); -} -//LCOV_EXCL_STOP - bool SqlConnection::DataCommand::Step() { // Notify all after potentially synchronized database connection access @@ -428,16 +285,6 @@ void SqlConnection::DataCommand::CheckColumnIndex( ThrowMsg(Exception::InvalidColumn, "Column index is out of bounds"); } -//LCOV_EXCL_START -bool SqlConnection::DataCommand::IsColumnNull( - SqlConnection::ColumnIndex column) -{ - LogPedantic("SQL data command get column type: [" << column << "]"); - CheckColumnIndex(column); - return sqlite3_column_type(m_stmt, column) == SQLITE_NULL; -} -//LCOV_EXCL_STOP - int SqlConnection::DataCommand::GetColumnInteger( SqlConnection::ColumnIndex column) { @@ -448,68 +295,6 @@ int SqlConnection::DataCommand::GetColumnInteger( return value; } -//LCOV_EXCL_START -int8_t SqlConnection::DataCommand::GetColumnInt8( - SqlConnection::ColumnIndex column) -{ - LogPedantic("SQL data command get column int8: [" << column << "]"); - CheckColumnIndex(column); - int8_t value = static_cast(sqlite3_column_int(m_stmt, column)); - LogPedantic(" Value: " << value); - return value; -} - -int16_t SqlConnection::DataCommand::GetColumnInt16( - SqlConnection::ColumnIndex column) -{ - LogPedantic("SQL data command get column int16: [" << column << "]"); - CheckColumnIndex(column); - int16_t value = static_cast(sqlite3_column_int(m_stmt, column)); - LogPedantic(" Value: " << value); - return value; -} - -int32_t SqlConnection::DataCommand::GetColumnInt32( - SqlConnection::ColumnIndex column) -{ - LogPedantic("SQL data command get column int32: [" << column << "]"); - CheckColumnIndex(column); - int32_t value = static_cast(sqlite3_column_int(m_stmt, column)); - LogPedantic(" Value: " << value); - return value; -} - -int64_t SqlConnection::DataCommand::GetColumnInt64( - SqlConnection::ColumnIndex column) -{ - LogPedantic("SQL data command get column int64: [" << column << "]"); - CheckColumnIndex(column); - int64_t value = static_cast(sqlite3_column_int64(m_stmt, column)); - LogPedantic(" Value: " << value); - return value; -} - -float SqlConnection::DataCommand::GetColumnFloat( - SqlConnection::ColumnIndex column) -{ - LogPedantic("SQL data command get column float: [" << column << "]"); - CheckColumnIndex(column); - float value = static_cast(sqlite3_column_double(m_stmt, column)); - LogPedantic(" Value: " << value); - return value; -} - -double SqlConnection::DataCommand::GetColumnDouble( - SqlConnection::ColumnIndex column) -{ - LogPedantic("SQL data command get column double: [" << column << "]"); - CheckColumnIndex(column); - double value = sqlite3_column_double(m_stmt, column); - LogPedantic(" Value: " << value); - return value; -} -//LCOV_EXCL_STOP - std::string SqlConnection::DataCommand::GetColumnString( SqlConnection::ColumnIndex column) { @@ -545,131 +330,6 @@ RawBuffer SqlConnection::DataCommand::GetColumnBlob( return RawBuffer(value, value + length); } -//LCOV_EXCL_START -boost::optional SqlConnection::DataCommand::GetColumnOptionalInteger( - SqlConnection::ColumnIndex column) -{ - LogPedantic("SQL data command get column optional integer: [" - << column << "]"); - CheckColumnIndex(column); - - if (sqlite3_column_type(m_stmt, column) == SQLITE_NULL) - return boost::optional(); - - int value = sqlite3_column_int(m_stmt, column); - LogPedantic(" Value: " << value); - return boost::optional(value); -} - -boost::optional SqlConnection::DataCommand::GetColumnOptionalInt8( - SqlConnection::ColumnIndex column) -{ - LogPedantic("SQL data command get column optional int8: [" - << column << "]"); - CheckColumnIndex(column); - - if (sqlite3_column_type(m_stmt, column) == SQLITE_NULL) - return boost::optional(); - - int8_t value = static_cast(sqlite3_column_int(m_stmt, column)); - LogPedantic(" Value: " << value); - return boost::optional(value); -} - -boost::optional SqlConnection::DataCommand::GetColumnOptionalInt16( - SqlConnection::ColumnIndex column) -{ - LogPedantic("SQL data command get column optional int16: [" - << column << "]"); - CheckColumnIndex(column); - - if (sqlite3_column_type(m_stmt, column) == SQLITE_NULL) - return boost::optional(); - - int16_t value = static_cast(sqlite3_column_int(m_stmt, column)); - LogPedantic(" Value: " << value); - return boost::optional(value); -} - -boost::optional SqlConnection::DataCommand::GetColumnOptionalInt32( - SqlConnection::ColumnIndex column) -{ - LogPedantic("SQL data command get column optional int32: [" - << column << "]"); - CheckColumnIndex(column); - - if (sqlite3_column_type(m_stmt, column) == SQLITE_NULL) - return boost::optional(); - - int32_t value = static_cast(sqlite3_column_int(m_stmt, column)); - LogPedantic(" Value: " << value); - return boost::optional(value); -} - -boost::optional SqlConnection::DataCommand::GetColumnOptionalInt64( - SqlConnection::ColumnIndex column) -{ - LogPedantic("SQL data command get column optional int64: [" - << column << "]"); - CheckColumnIndex(column); - - if (sqlite3_column_type(m_stmt, column) == SQLITE_NULL) - return boost::optional(); - - int64_t value = static_cast(sqlite3_column_int64(m_stmt, column)); - LogPedantic(" Value: " << value); - return boost::optional(value); -} - -boost::optional SqlConnection::DataCommand::GetColumnOptionalFloat( - SqlConnection::ColumnIndex column) -{ - LogPedantic("SQL data command get column optional float: [" - << column << "]"); - CheckColumnIndex(column); - - if (sqlite3_column_type(m_stmt, column) == SQLITE_NULL) - return boost::optional(); - - float value = static_cast(sqlite3_column_double(m_stmt, column)); - LogPedantic(" Value: " << value); - return boost::optional(value); -} - -boost::optional SqlConnection::DataCommand::GetColumnOptionalDouble( - SqlConnection::ColumnIndex column) -{ - LogPedantic("SQL data command get column optional double: [" - << column << "]"); - CheckColumnIndex(column); - - if (sqlite3_column_type(m_stmt, column) == SQLITE_NULL) - return boost::optional(); - - double value = sqlite3_column_double(m_stmt, column); - LogPedantic(" Value: " << value); - return boost::optional(value); -} - -boost::optional SqlConnection::DataCommand::GetColumnOptionalBlob( - SqlConnection::ColumnIndex column) -{ - LogPedantic("SQL data command get column blog: [" << column << "]"); - CheckColumnIndex(column); - - if (sqlite3_column_type(m_stmt, column) == SQLITE_NULL) - return boost::optional(); - - const unsigned char *value = reinterpret_cast( - sqlite3_column_blob(m_stmt, column)); - - int length = sqlite3_column_bytes(m_stmt, column); - LogPedantic("Got blob of length: " << length); - - RawBuffer temp(value, value + length); - return boost::optional(temp); -} -//LCOV_EXCL_STOP SqlConnection::DataCommandHandler::~DataCommandHandler() { LogPedantic("SQL DataCommandHandler finalizing"); try{ @@ -764,37 +424,6 @@ void SqlConnection::SetKey(const RawBuffer &rawPass) m_isKeySet = true; }; -//LCOV_EXCL_START -void SqlConnection::ResetKey(const RawBuffer &rawPassOld, - const RawBuffer &rawPassNew) -{ - if (m_connection == NULL) { - LogPedantic("Cannot reset key. No connection to DB!"); - return; - } - - // Binary data for raw password should be 32 bytes long. - assert(rawPassOld.size() == SQLITE_RAW_DATA_SIZE && - rawPassNew.size() == SQLITE_RAW_DATA_SIZE); - - // sqlite3_rekey requires for key to be already set - if (!m_isKeySet) - SetKey(rawPassOld); - - RawBuffer pass = createHexPass(rawPassNew); - int result = sqlite3_rekey(m_connection, pass.data(), pass.size()); - - if (result == SQLITE_OK) { - LogPedantic("Reset key on DB"); - } else { - //sqlite3_rekey fails only when m_connection == NULL || key == NULL || - // key length == 0 - LogError("Failed to reset key on DB"); - ThrowMsg(Exception::InvalidArguments, result); - } -} -//LCOV_EXCL_STOP - void SqlConnection::Disconnect() { if (m_connection == NULL) { @@ -1033,13 +662,6 @@ void SqlConnection::ClearMap() m_preparedStatements.clear(); } -//LCOV_EXCL_START -SqlConnection::RowID SqlConnection::GetLastInsertRowID() const -{ - return static_cast(sqlite3_last_insert_rowid(m_connection)); -} -//LCOV_EXCL_STOP - void SqlConnection::TurnOnForeignKeys() { ExecCommand("PRAGMA foreign_keys = ON;");