Commit Graph

924 Commits

Author SHA1 Message Date
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
silverqx dffdd8852c tom added completion for about --only= sections
Added support for pwsh, zsh, and bash shells.

Contains workaround for Register-ArgumentCompleter for array option
values, currently, the wordArg is empty, the workaround fix fills
the wordArg with the last option value.
2024-04-02 19:02:38 +02:00
silverqx ea6ad3cf8b added support for bool conn. options w/o value
Bool connection options without a value are considered as enabled or ON.
2024-03-28 18:34:48 +01:00
silverqx c30b1d4a9f used emplace() for Qt6 2024-03-28 18:32:19 +01:00
silverqx dcac6d0226 renamed local variable 2024-03-28 18:32:04 +01:00
silverqx 86f9e51632 bugfix wrong reserve() size
- also changed how class is instantiated
2024-03-28 18:31:22 +01:00
silverqx 778041f635 bugfix added +2 reserve() 2024-03-28 18:30:28 +01:00
silverqx f07ecfe290 used std::move() 2024-03-28 18:29:11 +01:00
silverqx ae74599f37 bugfix missing defined() 2024-03-27 14:04:08 +01:00
silverqx fd6eba0436 unified all reserve()-s formatting 2024-03-26 21:03:06 +01:00
silverqx 3e45698224 unified all #if QT_VERSION >= QT_VERSION_CHECK(6)
Qt6 goes first.
2024-03-26 21:03:06 +01:00
silverqx 01e203284a added comment 2024-03-26 21:03:05 +01:00
silverqx 84641e1c47 added mapping from BindingType to its name
Used in an exception message.
2024-03-26 21:03:02 +01:00
silverqx de0cfa1c77 used decltype ()::size_type everywhere 2024-03-26 21:03:00 +01:00
silverqx fc6239147b revisited static_cast<> for integral types 2024-03-26 21:02:57 +01:00
silverqx 89bf0b1a79 whitespace 2024-03-26 21:02:55 +01:00
silverqx 86161d4079 revisited static_cast<> for integral types 2024-03-26 21:02:54 +01:00
silverqx 09911ffc6b revisited static_cast<> for integral types 2024-03-26 21:02:44 +01:00
silverqx 5109925819 used /*unused*/ 2024-03-24 13:25:12 +01:00
silverqx d67ab049d8 added MYSQL_OPT_SSL_MODE configuration support
- updated docs, tests, and workflows
2024-03-22 14:42:21 +01:00
silverqx 60e60d3e80 analyzers fixed/suppressed Clang Tidy warnings 2024-03-20 19:56:59 +01:00
silverqx c3d8b2cb18 updated comment 2024-03-20 19:56:33 +01:00
silverqx d69c1846e8 made methods static 2024-03-20 14:42:42 +01:00
silverqx 272e0757fc added reserve() 2024-03-20 14:42:42 +01:00
silverqx 7486b972e0 analyzers suppressed Clang Tidy warning
- updated comment
2024-03-20 14:42:42 +01:00
silverqx 9f4a7ec155 whitespaces 2024-03-20 14:42:41 +01:00