Content


NTL
Core
CDbInsert

CDbInsert


This class provides high level abstraction for insert into database operations.

You can find more information in comments below.

class CDbInsert :public virtual IDbQuery, public CReleasable
{
public:
    CDbInsert(IDbConnection* connection, IDbStatement *statement, IDbQueryBuilder* qb); // Constructor. "connection" is ignored if "statement" is specified. Either "connection" or "statement" is required. "qb" is required 

    // Query building 
    CDbInsert* Into(const String& table); // Set table where data should be inserted into 

    // Execute 
    CDbInsert* Execute(const StringArray& columns, const DbRow& row, const String& on_duplicate_update = L""); // Insert one row. Throw exceptions in case of error 
    CDbInsert* Execute(const StringArray& columns, const DbRows& rows, const String& on_duplicate_update = L""); // Insert multiple rows. Throw exceptions in case of error 
    CDbInsert* Execute(const DbSet& data, const String& on_duplicate_update = L""); // Insert row data specified as array of key => value pairs. Throw exceptions in case of error 
    DbValue Id(); // Return last inserted Id. Throw exceptions in case of error 
};
Namespace: nitisa
Include: Nitisa/Db/DbInsert.h