Commit Graph

1078 Commits

Author SHA1 Message Date
silverqx e4b70758da tom fixtypo 2024-08-13 11:36:14 +02:00
silverqx ee966ddf9b tests fixed Clazy warnings 2024-08-09 01:12:06 +02:00
silverqx 6dbb91376a tests fixed Clazy warning 2024-08-06 21:01:42 +02:00
silverqx 76ceae31fc tests bugfix tst_SoftDeletes 🙌 2024-08-06 21:01:41 +02:00
silverqx fadb0d3d60 tests bugfix #include 2024-07-30 19:26:15 +02:00
silverqx e9302736a5 tests fixed Clang Tidy warnings 2024-07-30 16:53:33 +02:00
silverqx 2519c193ed fixed Clazy warnings 2024-07-30 14:03:44 +02:00
silverqx 3a14b13367 fixed Clang Tidy warnings 2024-07-29 23:39:39 +02:00
silverqx 3933bad984 tests renamed local variables to sqlQuery 2024-07-28 16:08:30 +02:00
silverqx 20dce55c17 tests renamed methods to createSqlQuery() 2024-07-28 15:55:52 +02:00
silverqx 7f897b339e renamed all getQtQuery and similar to getSqlQuery
These methods had a wrong names after the TinyDrivers were added as
all can return QSqlXyz or Orm::Drivers::SqlXyz instances.

Changing Qt to Sql covers both cases.

 - updated auto tests
 - updated docs
2024-07-28 15:53:02 +02:00
silverqx eb51e58b33 tests added SqlQuery::clear() tests 2024-07-28 12:53:25 +02:00
silverqx 840dbf2071 drivers added SqlQuery::isEmpty()
- used in some test methods
 - extracted throw an exception logic
2024-07-28 12:52:55 +02:00
silverqx 709ac28178 tests UTF-8 1, 2, 3, 4 byte characters
Testing the INSERT and SELECT.
2024-07-26 20:48:27 +02:00
silverqx 6cb30340d3 tests tried to avoid edge cases fail
Auto tests don't fail if the tom example migrations are migrated, they
will be rolled back and the migrations_example migration repository
table will be uninstalled.

This is a very rare edge case, but it can still happen during local
development, auto test are more robust now. 🕺
2024-07-24 20:50:16 +02:00
silverqx f0a01827b7 tests added --reset for edge cases 2024-07-24 20:47:30 +02:00
silverqx 8cc5d746ab tests fixtypo 2024-07-24 20:47:08 +02:00
silverqx 95310b4422 tests tried to avoid edge case 2024-07-24 19:39:24 +02:00
silverqx 525214e66e drivers bugfix withDefaultValues to false
Changed the Default Column Values default argument value to false
because Qt API doesn't obtain these Defaul Column Values
in the QSqlQuery::record(), I didn't realize that.

 - updated functional tests
2024-07-23 21:40:43 +02:00
silverqx ade98d5f44 tests cmake reuse PCH
The databasemanager test case that will provide PCH for all other test
cases, what means all other test cases will use this PCH without
compilation.

 - added a new PROVIDES_PCH for tiny_configure_test()
 - this new implementation will be enabled from Qt v6.8.0 because of
   https://bugreports.qt.io/projects/QTBUG/issues/QTBUG-126729
2024-07-22 13:44:05 +02:00
silverqx c4c696932f tests drivers bugfix get database connection 2024-07-21 22:06:46 +02:00
silverqx 457faea5b8 tests removed PCH
The qmake doesn't support reuse of already compiled PCH, what means
PCH-s are compiled for each test case, which is much slower ~10s.

I would have to manage the PCH compilation flags myself to make PCH
reuse possible.
2024-07-21 19:55:49 +02:00
silverqx 1698beec1f tests used QStringBuilder % vs + 2024-07-21 12:54:40 +02:00
silverqx 7f23bd8eba used auto instead of QString 2024-07-21 12:54:40 +02:00
silverqx 59d900562c drivers used single-line comments for NOLINT() 2024-07-21 12:54:35 +02:00
silverqx c4430453e6 drivers added SqlDatabase::record(tableName)
It allows to obtain a SqlRecord for the given table.

Populating the Default Column Values works the same way as
for the SqlQuery/SqlResult couterparts.

The recordCached() counterparts in SqlResult were not implemented
because of cache invalidation problems (not possible with the current
API, it's hard to implement).

This API always select-s all columns from the information_schema.columns
table, that's why the SqlResult::recordWithDefaultValues(allColumns)
has the allColumns parameter, it's used but this API/feature.

 - added functional tests
 - added a new empty_with_default_values table
 - logic that doesn't fit into the MySqlDriver class was extracted
   to the SelectsAllColumnsWithLimit0 concern 🕺
2024-07-20 19:58:54 +02:00
silverqx 999073cd19 tests added test method for mediumtext 2024-07-20 19:50:10 +02:00
silverqx 90a5a76ecf drivers populate Default Column Values
Populate the Default Column Values during SqlQuery::record() method
call. I was able to preserve the recordCached().
The withDefaultValues = true was added for both methods, the default
must be true to be API compatible with Qt, I would prefer false
otherwise. 😞

 - enhanced tst_SqlQuery_Normal/Prepared record() related tests
   (exhaustive testing of the SqlRecord)
2024-07-20 19:50:05 +02:00
silverqx 7b76f8bace tests moved using enum outside class 2024-07-14 16:01:28 +02:00
silverqx 4b07270faf tests reordered TinyDrivers #include-s 2024-07-14 15:57:02 +02:00
silverqx bcd5636211 tests drivers renamed test method 2024-07-12 19:51:27 +02:00
silverqx 118acd880d renamed all occurences toVector to toList 😎 (5)
Divided to 5 commits for simpler review.

Fifth commit:

 - renamed toVector() methods
 - updated all comments
 - also renamed toVectorVariantList() to toListVariantList() and
   attributesToVector() to attributesToList()

These methods must be renamed, they must be toList() because in the
future there can be toVector() method that will convert to
std::vector<>.

Also, all symbols described below which contain the word [Vv]ector will
not be renamed to [Ll]ist, the reason for this is that the QList<> is
vector and in the future when the QtCore dependency will be dropped 😮
this will be the std::vector<>. 😎

 - variable names that are of type QList<>
 - method names which are operating on the QList<>
 - comments like: Vector of attached models IDs.
2024-07-02 17:23:42 +02:00
silverqx eab113cdee renamed all occurences of QVector to QList 😎 (4)
Divided to 5 commits for simpler review.

Fourth commit:

 - renamed QVector to QList everywhere else (what's left)
   - comments
   - test method names
2024-07-02 16:30:17 +02:00
silverqx 6abf64a524 renamed all occurences of QVector to QList 😎 (3)
Divided to 5 commits for simpler review.

Third commit:

 - renamed QVector< to QList< in auto tests

OT: The worst part was to fix indents. 😄
2024-07-02 16:30:17 +02:00
silverqx 3ba13970d7 get rid of Helpers::qVariantTypeId()
Not needed anymore after Qt v5.15 support removed.

 - also removed PROJECT_TINYDRIVERS_PRIVATE compile definition, not
   needed anymore as well
2024-06-30 12:41:58 +02:00
silverqx eda9df9f9e removed Qt v5 support since TinyORM v0.38.0 🎉🕺🙌
Removed Qt v5.15 support since TinyORM v0.38.0, finally.

Minimum required Qt version is now v6.2!

Day of celebration is today. 😁

 - removed all #if QT_VERSION macro checks
 - updated docs
 - workflows removed Qt v5 related pipelines
 - updated all comments
 - vcpkg removed tinyorm-qt5 port
 - updated Gentoo build
 - updated README.md Qt v5 badges
 - tools removed Qt v5 related scripts
 - tools updated deploy.ps1 script
2024-06-28 14:57:59 +02:00
silverqx e24064b7fd qmake moved all feature to private/ folder
Moved all features which aren't used through CONFIG+=xyz and are loaded
using the load(private/xyz) function to the qmake/features/private/
folder.

Currently, the qmake/features/ folder contains only features which
should be used using the CONFIG+= qmake variable.
2024-06-25 13:44:52 +02:00
silverqx 4051028e79 tests updated comments 2024-06-25 12:18:36 +02:00
silverqx b6fdf41792 tests unified using Orm::Tiny:: ordering 2024-06-25 12:13:11 +02:00
silverqx 31b8e06a9c fixtypo compiler names
Everywhere cmake, qmake, docs, ...
2024-06-25 12:13:10 +02:00
silverqx 1c2f17facf removed deprecated up to Qt v6.9 (Qt::TimeSpec) 🎉
- removed using of QDateTime methods using plain Qt::TimeSpec
 - set QT_DISABLE_DEPRECATED_UP_TO to 0x060900 (also 0x061000 works)
 - maintained Qt v5 and <v6.5 code still 😬 (next step will be to drop
   Qt v5 🎉)
 - updated auto tests
 - updated docs
 - updated comments

See:
https://github.com/qt/qtbase/commit/8c8d6ff7b6e2e6b1b673051685f1499ae4d65e05?diff=unified&w=0
2024-06-25 12:13:07 +02:00
silverqx 318012fc13 tests whitespace 2024-06-19 20:40:42 +02:00
silverqx 9ff5a80901 TinyUtils whitespace 2024-06-19 19:34:14 +02:00
silverqx 6a559305d1 drivers bugfix QDateTime UTC handling (Qt v6.8)
This fixes long standing QtSql QMYSQL and QPSQL bug that ignores
database time zone.

This bugfix doesn't solve it correctly anyway, it only forces time zone
to UTC and isn't able to handle another time zones. But UTC handling is
implemented correctly.

TinyDrivers supports also other time zones using the qt_timezone
connection option.

 - updated QT_DISABLE_DEPRECATED_UP_TO to 0x060800 (Qt v6.8)
 - updated auto tests to pass on Qt v6.8

See MySQL-related:
https://github.com/qt/qtbase/commit/2781c3b6248fe4410a7afffd41bad72d8567fc95
https://codereview.qt-project.org/c/qt/qtbase/+/546954

See PostgreSQL-related:
https://github.com/qt/qtbase/commit/b71f185ffc54245197149d7a6f8b5f756c9b9393
https://codereview.qt-project.org/c/qt/qtbase/+/547611
2024-06-19 11:42:00 +02:00
silverqx b672741354 tests added time zone related comments 2024-06-17 14:56:05 +02:00
silverqx 1c8e4d35ec qmake/cmake disabled deprecated APIs for Qt <=6.7
- for Qt <6 disabled deprecated APIs for Qt <=6.0
 - added temporary workaround for
   QVERIFY_EXCEPTION_THROWN() vs QVERIFY_THROWS_EXCEPTION(), to support
   Qt v6.8 and also older version at the same time
2024-06-16 17:56:34 +02:00
silverqx 70c385d0e4 tests removed unneeded #include-s 2024-06-16 17:46:21 +02:00
silverqx 07513aa377 used utf8mb4_uca1400_ai_ci for MariaDB 2024-06-05 10:22:06 +02:00
silverqx 1c67da6b7d qmake used ccache instead tiny_ccache_win32
- updated docs
2024-06-03 13:50:10 +02:00
silverqx 090e52f122 cmake added support for ctest --parallel 🎉 2024-06-01 11:48:54 +02:00