This class provides high level abstraction for delete from database operations.
You can find more information in comments below.
class CDbDelete :public virtual IDbQuery, public CReleasable
{
public:
CDbDelete(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
CDbDelete* From(const String& table); // Set name of table to delete from
CDbDelete* From(const String& table, const String& alias); // Set name with alias of table to delete from
CDbDelete* Where(DbCondition condition); // Set delete condition
CDbDelete* Where(const DbConditions &conditions); // Set delete conditions joined by AND operator
CDbDelete* AndWhere(DbCondition condition); // Add delete condition joined by AND operator
CDbDelete* OrWhere(DbCondition condition); // Add delete condition joined by OR operator
CDbDelete* OrderBy(const String& column, const DbOrder& order); // Add ordering column
CDbDelete* OrderBy(const DbOrderByArray& columns); // Add ordering columns
CDbDelete* Limit(const int64& limit = -1); // Set how many record maximum to be deleted. -1 means no limit
// Execute
void Execute(); // Execute deletion. Throw exceptions in case of error
};
Namespace: | nitisa |
Include: | Nitisa/Db/DbDelete.h |