Files
TinyORM/include/orm/query/expression.hpp
silverqx 17e0bb4cca added BelongsToMany::attach and queries counter
The BelongsToMany::attach overloads are able to accept also Model instance/s.
The many-to-many relation also supports touching timestamps on the pivot table and also touching parent timestamps.

Added queries execution time counter and the number of executed queries
counter, it counts normal, affecting and transactional queries.
Also added proxy methods to the DB facade and DatabaseManager.
The DatabaseManager also contains api to be able enable/disable counters
on all connections or get/reset counters on all connections.

 - tried to compile without PCH and added all the missing includes
2021-03-26 18:44:06 +01:00

48 lines
1.0 KiB
C++

#ifndef EXPRESSION_H
#define EXPRESSION_H
#include <QVariant>
#include <QVector>
#include "export.hpp"
#ifdef TINYORM_COMMON_NAMESPACE
namespace TINYORM_COMMON_NAMESPACE
{
#endif
namespace Orm::Query
{
// TODO rework saveing Expressions to the "BindingsMap m_bindings", see also todo at BindingsMap definition in ormtypes.hpp silverqx
class SHAREDLIB_EXPORT Expression
{
public:
Expression() = default;
~Expression() = default;
Expression(const QVariant &value);
Expression(const Expression &) = default;
Expression &operator=(const Expression &) = default;
operator QVariant() const;
inline QVariant getValue() const
{ return m_value; }
private:
QVariant m_value;
};
} // namespace Orm
#ifdef TINYORM_COMMON_NAMESPACE
} // namespace TINYORM_COMMON_NAMESPACE
#endif
#ifdef TINYORM_COMMON_NAMESPACE
Q_DECLARE_METATYPE(TINYORM_COMMON_NAMESPACE::Orm::Query::Expression);
#else
Q_DECLARE_METATYPE(Orm::Query::Expression);
#endif
#endif // EXPRESSION_H