Commit Graph

949 Commits

Author SHA1 Message Date
silverqx 5651efcac2 removed useless local variable
This is possible after the std::enable_shared_from_this<MySqlDriver> was
added.
2024-07-28 00:32:39 +02:00
silverqx 189e80465e drivers mysql added comment 2024-07-27 21:12:40 +02:00
silverqx 6a59f334f9 fixtypo 2024-07-21 12:54:38 +02:00
silverqx bbeec5975a fixtypo 2024-07-17 09:58:49 +02:00
silverqx 35a9791dca tom cmake added TriState bool support
CMake compile definitions can have three states ON, OFF, and
xyz-/NOTFOUND.
2024-07-05 17:40:40 +02:00
silverqx 5c4f999e95 bugfix consider xyz-/NOTFOUND only as FALSE
The notfound and xyz-notfound is considered TRUE.
2024-07-05 17:38:59 +02:00
silverqx a599991798 tom extracted normalizeCMakeBool() method 2024-07-05 15:44:00 +02:00
silverqx 10683d3e8d added comment 2024-07-04 10:35:10 +02:00
silverqx afe299e6b0 upgraded to MySQL v9.0
- workflows, tools, docs, qmake, CMake, ...
2024-07-03 16:52:11 +02:00
silverqx b629c29256 whitespaces 2024-07-02 17:46:33 +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 52cbb1c960 renamed all occurences of QVector to QList 😎 (2)
Divided to 5 commits for simpler review.

Second commit:

 - renamed QVector< to QList< (excluding auto tests)

OT: The worst part was to fix indents. 😄
2024-07-02 16:30:08 +02:00
silverqx 8a71078f18 renamed all occurences of QVector to QList 😎 (1)
Divided to 5 commits for simpler review.

First commit:

 - renamed #include-s
2024-07-02 16:30:00 +02:00
silverqx 4d09aa8380 added comment 2024-07-02 10:10:09 +02:00
silverqx a183f81fd2 throw on deprecated Qt::TimeSpec
Throw if the given qt_timezone value is deprecated Qt::TimeSpec.
2024-07-02 09:51:46 +02:00
silverqx 19bcd372ba updated comment about NullVariant class 2024-06-30 12:47:36 +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 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 07513aa377 used utf8mb4_uca1400_ai_ci for MariaDB 2024-06-05 10:22:06 +02:00
silverqx b0ba3b9093 rename macro function 2024-06-03 22:08:40 +02:00
silverqx 7c12276e11 tom cmake added info about LTO to about command 2024-06-03 22:06:32 +02:00
silverqx 720b3f9e07 upgraded to MySQL v8.4
- docs
 - qmake auto-detection
 - tools
 - workflows

[skip ci]
2024-05-14 15:39:33 +02:00
silverqx 18d92da387 added free methods to DatabaseManager, DB, Schema
[skip ci]
2024-05-13 18:54:56 +02:00
silverqx f9d80a9aa7 fixed Clang Tidy warnings
After #pragma system_header fixed.
2024-05-03 17:15:40 +02:00
silverqx aa2927984d bugfix used method parameter 2024-05-01 13:05:30 +02:00
silverqx 2c61fc1f6d bugfix wrong type 2024-05-01 13:05:30 +02:00
silverqx 5e9966a7d8 analyzers suppressed Clang Tidy warning 2024-04-12 18:14:43 +02:00
silverqx 7569d370f4 analyzers fixed Clang Tidy warnings 2024-04-12 18:14:43 +02:00
silverqx f73cc44818 enabled SSL_MODE from Qt v6.6.0 2024-04-10 17:20:29 +02:00
silverqx 473c17ea96 bugfix Qt5 builds 2024-04-10 17:20:29 +02:00
silverqx 65088eabfd analyzers suppressed Clang Tidy warnings 2024-04-07 18:12:25 +02:00
silverqx 42d8f3e3e6 drivers added exceptions mappings
To avoid #ifdef-s to have nice code.
2024-04-07 18:12:01 +02:00
silverqx 983af9a858 drivers removed TSqlError mappings
- also used the QSqlQuery directly where it makes sense
2024-04-07 18:12:01 +02:00
silverqx 039e9fcf4b drivers get rid of Drivers::SqlError 🔥🚀🥳
This is part 2 of: used TinyDrivers exceptions everywhere.
The Drivers::SqlError was dropped and renamed to DummySqlError which
does nothing and it exists only for API compatibility with QtSql module
and it also helps to avoid #ifdef-s in users/client code.

There are 3 exceptions (what is all this about) and they are SqlError,
QueryError, and SqlTransactionError. The SqlError is a general SQL
exception class that is thrown eg. during connecting to SQL server
or during all other SQL API calls that are not database queries or
transaction queries.

The second part of this commit was to modify all error handling
in TinyOrm library and adapt it to exceptions thrown from
the TinyDrivers library.
Many #ifdef-s were added because of this because QtSql module returns
bool and then you need to obtain the QSqlError and TinyDrivers library
throws exceptions.

This commit was huge, also it's very weird and this error handling
things are unpopular and everybody has different opinion on this, but
it is what it is.

There is not way I would return bool and set error state instead of
exceptions in TinyDrivers, never.
Also, there is no way I would catch Drivers::SqlError/QueryError/
SqlTransactionError in TinyOrm library and translate these TinyDrivers
exceptions to TinyOrm exceptions with the same names to throw only one
set of exceptions, no way. TinyDrivers throws its own exceptions and
TinyOrm linked against QtSql throws its own exceptions (with the same
names but in different namespace).

 - removed all setLastError() and throw exceptions instead
 - added new constants
 - optimized #include-s
 - changed the causedByLostConnection() method signature
 - enhanced the ManagesTransactions class
 - extracted code to the mysqlClose()
 - removed MySqlDriverPrivate::q_ptr (not needed anymore)
 - removed createError() and createStmtError() (not needed anymore) and
   added prepareMySqlError() and prepareStmtError() as counterparts
 - renamed method to errorMessageForStmtFetch()
 - extracted the replaceBindingsInSql() because it's used from both
   TinyOrm and TinyDrivers libraries
 - enhanced replaceBindingsInSql()
   - added support for BLOB-s
 - the SqlError, QueryError, and SqlTransactionError are excluded from
   TinyOrm library build and include path if compiled against
   the TinyDrivers library (they are not needed and used anymore)
 - added connection name to SqlResult class, it's used in exception
   messages
 - also updated auto tests

bugfix-es:

 - qmake propagate the TINYDRIVERS_MYSQL_DRIVER DEFINE (made it public),
   cmake build is OK
 - removed mysql_thread_init()
 - changed call order for the mysql_thread_end()
2024-04-07 18:12:00 +02:00
silverqx 5bc60ef8b8 drivers revisited mapping #include-s 2024-04-07 18:11:39 +02:00
silverqx 2be73f8181 drivers qmake finished linking against TinyDrivers
- disable QT -= sql the QtSql module if linking against the TinyDrivers
2024-04-07 18:11:37 +02:00
silverqx 331ef5d013 drivers bugfix driver() vs driverWeak()
As the TinyDrivers library uses smart pointers everywhere it stores
the SqlDriver as std::shared_ptr<>/weak_ptr<> and because of this
we end up with API compatibility problems, exactly
the exposed SqlDriver *driver() method was problematic.

This commit solves this problem. The idea was to provide compatible API
related to this driver() method but also to still be able use smart
pointers internally.
2024-04-07 18:11:36 +02:00
silverqx 797c74b3be updated DatabaseManager::supportedDrivers()
Considering our TinyDrivers implementation.
2024-04-07 18:11:36 +02:00
silverqx b6347ae229 drivers renamed enum types
Renamed from QSql::BeforeFirstRow/... and QSql::LowPrecisionDouble/...
to TCursorPosition and TPrecisionPolicy.
2024-04-07 18:11:36 +02:00
silverqx 28633c129e drivers renamed QSqlQuery to TSqlQuery 2024-04-07 18:11:36 +02:00
silverqx 1b470b817a drivers add swappable includes for SQL drivers
Added the TINY_INCLUDE_TSqlQuery macro for swappable #include-s between
Qt/Tiny SQL drivers. 👌
2024-04-07 18:11:35 +02:00
silverqx cb7dd9fdcf drivers add swappable Qt/Tiny SQL drivers
The TinyOrm library can be compiled against the QtSql or TinyDrivers.
2024-04-07 18:11:35 +02:00
silverqx 018f9d70ee drivers initial qmake build 2024-04-07 18:11:34 +02:00
silverqx 5f5424ca25 drivers continued initial TinyDrivers
Initial development phase so lot of changes and modifications.
2024-04-07 18:11:33 +02:00
silverqx 5b9bee240a drivers initial TinyDrivers 2024-04-07 18:11:33 +02:00
silverqx e6266fb359 bugfix undeclared type in Release build 2024-04-07 16:45:34 +02:00