GnuCash c935c2f+
Loading...
Searching...
No Matches
Public Member Functions
GncDbiSqlStatement Class Reference
Inheritance diagram for GncDbiSqlStatement:
GncSqlStatement

Public Member Functions

 GncDbiSqlStatement (const std::string &sql)
 
const char * to_sql () const override
 
void add_where_cond (QofIdTypeConst, const PairVec &) override
 

Detailed Description

Definition at line 43 of file gnc-dbisqlconnection.cpp.

Constructor & Destructor Documentation

◆ GncDbiSqlStatement()

GncDbiSqlStatement::GncDbiSqlStatement ( const std::string &  sql)
inline

Definition at line 46 of file gnc-dbisqlconnection.cpp.

46 :
47 m_sql {sql} {}

◆ ~GncDbiSqlStatement()

GncDbiSqlStatement::~GncDbiSqlStatement ( )
inline

Definition at line 48 of file gnc-dbisqlconnection.cpp.

48{}

Member Function Documentation

◆ add_where_cond()

void GncDbiSqlStatement::add_where_cond ( QofIdTypeConst  type_name,
const PairVec &  col_values 
)
overridevirtual

Implements GncSqlStatement.

Definition at line 64 of file gnc-dbisqlconnection.cpp.

66{
67 m_sql += " WHERE ";
68 for (auto colpair : col_values)
69 {
70 if (colpair != *col_values.begin())
71 m_sql += " AND ";
72 if (colpair.second == "NULL")
73 m_sql += colpair.first + " IS " + colpair.second;
74 else
75 m_sql += colpair.first + " = " + colpair.second;
76 }
77}

◆ to_sql()

const char * GncDbiSqlStatement::to_sql ( ) const
overridevirtual

Implements GncSqlStatement.

Definition at line 58 of file gnc-dbisqlconnection.cpp.

59{
60 return m_sql.c_str();
61}

The documentation for this class was generated from the following file: