mirror of
https://github.com/silverqx/TinyORM.git
synced 2026-01-05 18:40:02 -06:00
moved Orm::StatementsCounter to own header file
This commit is contained in:
@@ -58,6 +58,7 @@ Common:
|
||||
- perf : performance
|
||||
- production : check before deploy to production
|
||||
- reliability : make things more robust and reliable
|
||||
- repeat : tasks that should I make from time to time
|
||||
- security : self explaining
|
||||
- study : don't know how something works, need to check up
|
||||
- sync : synchronization in multi thread environment silverqx
|
||||
@@ -108,6 +109,9 @@ Powershell commands:
|
||||
- export todos to csv:
|
||||
Get-ChildItem -Path *.cpp,*.hpp -Recurse | sls -Pattern ' (TODO|NOTE|FIXME|BUG|WARNING|CUR|FEATURE|TEST|FUTURE) ' -CaseSensitive | % { $_.Line = $_.Line.Trim().TrimStart('// '); return $_; } | select Line,LineNumber,Path | Export-Csv todos.csv -Delimiter ';' -NoTypeInformation
|
||||
|
||||
- search in todos:
|
||||
Get-ChildItem -Path *.cpp,*.hpp -Recurse | sls -Pattern ' (TODO|NOTE|FIXME|BUG|WARNING|CUR|FEATURE|TEST|FUTURE) ' -CaseSensitive | % { $_.Line = $_.Line.Trim().TrimStart('// '); return $_; } | where Line -Match 'pch' | select Line,LineNumber,Path | ft -AutoSize
|
||||
|
||||
- filter out executed queries:
|
||||
Get-Content .\tmp.sql | sls -Pattern '^(Executed prepared query)' | Set-Content executed_queries.sql
|
||||
|
||||
|
||||
@@ -63,6 +63,7 @@ HEADERS += \
|
||||
$$PWD/orm/tiny/relations/relation.hpp \
|
||||
$$PWD/orm/tiny/tinybuilder.hpp \
|
||||
$$PWD/orm/types/log.hpp \
|
||||
$$PWD/orm/types/statementscounter.hpp \
|
||||
$$PWD/orm/utils/attribute.hpp \
|
||||
$$PWD/orm/utils/string.hpp \
|
||||
$$PWD/orm/utils/type.hpp \
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "orm/query/expression.hpp"
|
||||
#include "orm/types/log.hpp"
|
||||
#include "orm/types/statementscounter.hpp"
|
||||
|
||||
#ifdef TINYORM_COMMON_NAMESPACE
|
||||
namespace TINYORM_COMMON_NAMESPACE
|
||||
@@ -40,24 +41,12 @@ namespace Grammars
|
||||
}
|
||||
} // Orm::Schema
|
||||
|
||||
using Log = Types::Log;
|
||||
using QueryBuilder = Query::Builder;
|
||||
using QueryGrammar = Query::Grammars::Grammar;
|
||||
using QueryProcessor = Query::Processors::Processor;
|
||||
using SchemaBuilder = Schema::SchemaBuilder;
|
||||
using SchemaGrammar = Schema::Grammars::SchemaGrammar;
|
||||
|
||||
/*! Counts executed statements in a current connection. */
|
||||
struct StatementsCounter
|
||||
{
|
||||
/*! Normal select statements. */
|
||||
int normal = -1;
|
||||
/*! Affecting statements (UPDATE, INSERT, DELETE). */
|
||||
int affecting = -1;
|
||||
/*! Transactional statements (START TRANSACTION, ROLLBACK, COMMIT, SAVEPOINT). */
|
||||
int transactional = -1;
|
||||
};
|
||||
|
||||
class ConnectionInterface
|
||||
{
|
||||
Q_DISABLE_COPY(ConnectionInterface)
|
||||
|
||||
@@ -52,6 +52,8 @@ namespace Relations {
|
||||
};
|
||||
#endif
|
||||
|
||||
// TODO repeat, from time to time try to compile without microsoft extensions, QMAKE_CXXFLAGS *= -Za silverqx
|
||||
// TODO repeat, recompile without PCH silverqx
|
||||
// TODO decide/unify when to use class/typename keywords for templates silverqx
|
||||
// TODO concept, AllRelations can not contain type defined in "Model" parameter silverqx
|
||||
// TODO next test no relation behavior silverqx
|
||||
|
||||
@@ -275,7 +275,7 @@ namespace Orm::Tiny::Relations
|
||||
const auto &value = model.getAttribute(m_foreignKey);
|
||||
|
||||
if (!value.isNull())
|
||||
// TODO add support for non-int primary keys, ranges::acrions doesn't accept QVariant container silverqx
|
||||
// TODO add support for non-int primary keys, ranges::actions doesn't accept QVariant container silverqx
|
||||
keys.append(value);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,9 @@
|
||||
namespace TINYORM_COMMON_NAMESPACE
|
||||
{
|
||||
#endif
|
||||
namespace Orm::Types
|
||||
namespace Orm
|
||||
{
|
||||
namespace Types
|
||||
{
|
||||
|
||||
/*! Query Log record. */
|
||||
@@ -36,6 +38,10 @@ namespace Orm::Types
|
||||
};
|
||||
|
||||
} // namespace Orm::Types
|
||||
|
||||
using Log = Types::Log;
|
||||
|
||||
} // namespace Orm
|
||||
#ifdef TINYORM_COMMON_NAMESPACE
|
||||
} // namespace TINYORM_COMMON_NAMESPACE
|
||||
#endif
|
||||
|
||||
33
include/orm/types/statementscounter.hpp
Normal file
33
include/orm/types/statementscounter.hpp
Normal file
@@ -0,0 +1,33 @@
|
||||
#ifndef STATEMENTSCOUNTER_HPP
|
||||
#define STATEMENTSCOUNTER_HPP
|
||||
|
||||
#ifdef TINYORM_COMMON_NAMESPACE
|
||||
namespace TINYORM_COMMON_NAMESPACE
|
||||
{
|
||||
#endif
|
||||
namespace Orm
|
||||
{
|
||||
namespace Types
|
||||
{
|
||||
|
||||
/*! Counts executed statements in a current connection. */
|
||||
struct StatementsCounter
|
||||
{
|
||||
/*! Normal select statements. */
|
||||
int normal = -1;
|
||||
/*! Affecting statements (UPDATE, INSERT, DELETE). */
|
||||
int affecting = -1;
|
||||
/*! Transactional statements (START TRANSACTION, ROLLBACK, COMMIT, SAVEPOINT). */
|
||||
int transactional = -1;
|
||||
};
|
||||
|
||||
} // namespace Orm::Types
|
||||
|
||||
using StatementsCounter = Types::StatementsCounter;
|
||||
|
||||
} // namespace Orm
|
||||
#ifdef TINYORM_COMMON_NAMESPACE
|
||||
} // namespace TINYORM_COMMON_NAMESPACE
|
||||
#endif
|
||||
|
||||
#endif // STATEMENTSCOUNTER_HPP
|
||||
Reference in New Issue
Block a user