mirror of
https://github.com/silverqx/TinyORM.git
synced 2026-05-07 17:19:37 -05:00
76ad095241
It is not enabled because Qt sql driver doesn't support EXPLAIN queries.
49 lines
1022 B
C++
49 lines
1022 B
C++
#pragma once
|
|
#ifndef ORM_CONCERNS_EXPLAINQUERIES_HPP
|
|
#define ORM_CONCERNS_EXPLAINQUERIES_HPP
|
|
|
|
#include "orm/macros/systemheader.hpp"
|
|
TINY_SYSTEM_HEADER
|
|
|
|
#include <QtSql/QSqlQuery>
|
|
|
|
#include "orm/macros/commonnamespace.hpp"
|
|
#include "orm/macros/export.hpp"
|
|
|
|
TINYORM_BEGIN_COMMON_NAMESPACE
|
|
|
|
namespace Orm
|
|
{
|
|
namespace Query
|
|
{
|
|
class Builder;
|
|
}
|
|
using QueryBuilder = Query::Builder;
|
|
|
|
namespace Concerns
|
|
{
|
|
|
|
/*! Counts the number of executed queries and the elapsed time of queries. */
|
|
class SHAREDLIB_EXPORT ExplainQueries
|
|
{
|
|
public:
|
|
/*! Default constructor. */
|
|
inline ExplainQueries() = default;
|
|
/*! Virtual destructor. */
|
|
inline virtual ~ExplainQueries() = default;
|
|
|
|
/*! Explains the query. */
|
|
QSqlQuery explain();
|
|
|
|
private:
|
|
/*! Dynamic cast *this to the QueryBuilder & derived type. */
|
|
QueryBuilder &builder();
|
|
};
|
|
|
|
} // namespace Concerns
|
|
} // namespace Orm
|
|
|
|
TINYORM_END_COMMON_NAMESPACE
|
|
|
|
#endif // ORM_CONCERNS_EXPLAINQUERIES_HPP
|