Commit Graph

124 Commits

Author SHA1 Message Date
silverqx afc4630205 fixed clang-tidy and clazy warnings 2022-07-10 18:49:20 +02:00
silverqx 611564800b removed todo tasks 2022-07-10 17:58:04 +02:00
silverqx 9162c5a53d used shared_ptr everywhere
Get rid of the QSharedPointer and use the std::shared_ptr everywhere.
2022-07-10 17:36:53 +02:00
silverqx 67dfa12b36 added tap helper
It calls the given callback with the given value then return the value.

Also used it on few places as a proof that it works, the old code
looks cleaner though because it's flat.
2022-06-02 14:57:35 +02:00
silverqx 7c0f97181d added using XyzUtils alias to classes
Instead of use Orm::Utils::Xyz used alias XyzUtils.
2022-06-01 12:03:57 +02:00
silverqx 3d6875b268 removed todo task
[skip ci]
2022-05-31 20:38:48 +02:00
silverqx 133d9e525a removed todo task 2022-04-28 13:03:56 +02:00
silverqx 5cd54ebbef converted tiny utils to library classes
- added Type::isTrue()
 - added studly() and splitStringByWidth() to StringUtils
 - used using XxUtils for all Tiny library classes everywhere
2022-04-13 19:32:42 +02:00
silverqx a2714be30e added schema builder 🔥🚀
Added practically everything I wanted to have in except for updating
columns.
Needed to name the schema namespace as Orm::SchemaNs to avoid collision
with the Orm::Schema class.

 - unit tests with great coverage
 - new schema constants
 - a new prefix_indexes and engine DB conncetion configurations

Others:

 - IsModel tag
 - enhanced columnize in the BaseGrammar
 - used a new columnize logic in all grammars
 - new constants
 - new container utils class for joining containers
 - new DB::driver() getter for QSqlDriver
 - avoid possible crash in tests with pretend, added empty log checks
 - clang tidy, excluded to word from short variable names
2022-03-22 09:53:33 +01:00
silverqx 76ad095241 added Concerns::ExplainQueries
It is not enabled because Qt sql driver doesn't support EXPLAIN queries.
2022-01-18 11:07:57 +01:00
silverqx 71d22f2034 unified almost all throw exceptions 2022-01-17 19:07:59 +01:00
silverqx 7a017855f8 disabled copy constructors
Disabled on all relations, tiny builder and all base classes
2022-01-16 18:26:40 +01:00
silverqx b36888ae93 extracted queries counters to CountsQueries
Queries counters extracted to the Concerns::CountsQueries base class.

 - removed ConnectionInterface 😕😎🙌
 - all methods are returning DatabaseConnection & instead of
   ConnectionInterface
 - includes cleanup after extraction
2022-01-14 16:04:17 +01:00
silverqx 8380676d09 shorten namespace 2022-01-07 19:16:11 +01:00
silverqx f4e7c6faff fixed all macro guards 2022-01-06 11:22:46 +01:00
silverqx 0acca5c076 moved inline from definitions to declarations 2022-01-06 10:13:42 +01:00
silverqx 92775f444c divided Orm::Utils
While ORM can be disabled, Orm::Utils has been split into Orm::Utils
and Orm::Tiny::Utils (Orm::Tiny::TinyUtils alias).
So when ORM is disabled then utils used only in the ORM will be
excluded from a final build.

 - bugfix cmake undefined ORM option in TinySources
2022-01-01 14:28:42 +01:00
silverqx cf8690d2a1 reverted = {}; and = ""; redundant initializers 2021-10-28 16:33:09 +02:00
silverqx c289a93a65 passed clang-tidy performance-* (header files) 2021-10-27 09:58:30 +02:00
silverqx ff9ea7b2d7 passed google-* clang-tidy (cpp files)
- namespace-comments
 - using-namespaces
2021-10-25 09:34:44 +02:00
silverqx 7f07ed4482 unified macro guards 2021-10-21 16:36:50 +02:00
silverqx 89f8566d33 replaced TINYORM_COMMON_NAMESPACE with macro 2021-10-19 19:40:17 +02:00
silverqx d68d8fedb3 added pragma system_header 2021-10-13 10:06:50 +02:00
silverqx 7899e3ed47 changed define macros to _HPP 2021-09-30 09:20:58 +02:00
silverqx ed40e8cfe4 enabled Weffc++ 🚀🔥🙌 2021-09-21 08:00:44 +02:00
silverqx 65a0274efd updated todo tasks 2021-08-06 15:20:06 +02:00
silverqx 8473ada739 added comments for all classes 2021-08-06 11:52:26 +02:00
silverqx e9133df5c8 comments for all ctors/dtors 2021-08-06 10:35:15 +02:00
silverqx b7d72e93de moved all inline outside classes 2021-08-06 10:14:13 +02:00
silverqx db5aa004a1 all exceptions moved to own folder and namespace 2021-08-05 21:13:23 +02:00
silverqx dd55222a57 all proxy methods extracted to base classes
All proxy methods on TinyBuilder, Model and Relation moved to their own
base classes.
This change makes the classes code in headers more clear.
2021-08-05 13:51:42 +02:00
silverqx 9d8304ae32 changed method position 2021-08-03 14:21:59 +02:00
silverqx 7ca8910cc4 added querying relationship existence/absence
- support for querying nested relations existence/absence
 - added tests for all possible overloads 😲, 28 unit tests and 14
   functional tests
 - added has() related proxies to the Model and Relation
 - added documentation
 - gcc and clang specific fixes

others:

 - used clazy exclude comments instead of suppressing warnings in IDE
2021-08-03 09:31:31 +02:00
silverqx 1e40fa3e61 failed to add explain()
Qt sql driver does not support to call EXPLAIN as a prepared statement.
2021-07-19 10:19:53 +02:00
silverqx d1044e37bc added subquery support for order by clause 2021-07-18 20:49:56 +02:00
silverqx 4b4f34fbdc added support for subqueries in the select clause 2021-07-18 13:38:53 +02:00
silverqx 1d10afa6c0 added/replaced QChar constants for most used chars 2021-07-17 14:44:27 +02:00
silverqx 5d4391900a replaced = strings with EQ constant 2021-07-17 14:44:27 +02:00
silverqx 7d1f03021b added global constants for most used strings 2021-07-17 14:41:28 +02:00
silverqx 40b639c458 subquery support for where() columns 🔥🚀
where() column can take lambda expression or QueryBuilder &
for subqueries.

 - added proxy methods
 - added unit tests
 - proxy methods tested manually
2021-07-15 16:44:23 +02:00
silverqx ef1660dd6d subquery support for where() values 🔥🚀
where() values can take labmbda expression or QueryBuilder &
for subqueries.

 - added proxy methods
 - added unit tests
2021-07-15 08:24:46 +02:00
silverqx b1f68ae140 added const to aggregate methods 2021-07-13 17:01:08 +02:00
silverqx a4fe443541 added pluck()
Two overloads, simple pluck(column) to get values from the given column
and pluck<T>(column, key) which returns std::map<T, QVariant> values
of the given column keyed by the given key.

 - added docs
 - added tests
 - manually tested all proxies
2021-07-13 14:28:41 +02:00
silverqx 867a5f6587 added missing raw methods
or/whereRaw(), groupByRaw(), or/havingRaw(), orderByRaw().

 - added docs
 - tested manually in Playground
2021-07-06 18:28:58 +02:00
silverqx a1d9183af1 added new joinSub() overload
With the callback for join on clause.
2021-07-06 10:57:02 +02:00
silverqx bedd67120a removed all expressions todo tasks 🙌
Expressions finished.
2021-07-06 08:26:52 +02:00
silverqx 1aa0ef9cae added proxies for Aggregates
- all new proxies tested manually in Playground
2021-07-05 20:10:51 +02:00
silverqx c1c37cdf84 column expressions for having and orderBy
having() and orderBy() related methods now take column expressions.

 - added all proxies
 - all new code tested manually in the TinyOrmPlayground
2021-07-05 14:40:09 +02:00
silverqx 7298d72623 groupBy column expressions and new overload
groupBy() methods now take column expressions.

 - added all proxies
 - added new perfectly forwarded groupBy(&&...args) overload
 - all new code tested manually in the TinyOrmPlayground
2021-07-05 11:57:12 +02:00
silverqx 5626788eb6 renamed FromClause concept to SubQuery
Forgotten uncommitted code ☹.
2021-07-04 17:08:42 +02:00