Commit Graph

920 Commits

Author SHA1 Message Date
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 a7ace30999 unified constexpr static 2022-03-07 09:20:34 +01:00
silverqx f185e76cfa partial bugfix avoid exceptions in transactions
Partial bugfix getQtConnection() during transactions, it causes
exceptions, used getRawQtConnection() instead, still needs some work.
2022-03-06 12:49:02 +01:00
silverqx 80b0038914 updated notes
Added how to upgrade Docusaurus to the NOTES.txt.
2022-03-06 12:46:34 +01:00
silverqx 3cc40ae0a4 sync docs, added Qt 6 to dependencies 2022-03-06 12:45:47 +01:00
silverqx 3bc8f43fd3 missing connection parameter in DB/DM
Added connection parameter to all methods in DB/DM.
2022-03-06 12:45:19 +01:00
silverqx 6751ac849b added containsConnection() to DB/DatabaseManager 2022-03-06 12:44:13 +01:00
silverqx 8e75deb53a added on() alias for connection()
It allows shorter syntax like DB::on(connection).
2022-03-06 12:43:08 +01:00
silverqx 25e5c066ff divided table() to table()/tableAs()
This allows to call table(table, connection) and it avoids following
call table(table, "", connection) if 'as' is empty.
2022-03-06 12:42:02 +01:00
silverqx f268166f8f avoid to create physical connection for pretending
Added getQtQueryForPretend() that avoids to create physical connection
during pretend call when a physical DB connection was not created.
2022-03-06 12:37:48 +01:00
silverqx 312ef9dba7 bugfix ! Q_ASSERT() 😮 2022-03-06 12:35:25 +01:00
silverqx 80a1623b1d unified static constexpr
- also added const for STORE_TYPE
2022-03-06 12:34:36 +01:00
silverqx 1f4da6a6e4 missing inline 2022-03-06 12:33:46 +01:00
silverqx 98c207a7d9 added comment 2022-03-06 12:33:27 +01:00
silverqx bbd36faeba added todo tasks 2022-03-06 12:32:43 +01:00
silverqx 9a54b520bc added isOpen()/connectEagerly()/pingDatabase()
- added connectEagerly() that allows to force connection to the DB
 - added isOpen()
 - exposed isOpen()/connectEagerly()/pingDatabase() to DB and
   DatabaseManager
2022-03-06 12:31:10 +01:00
silverqx bd889521db sync, exposed playground connection names 2022-03-06 12:23:25 +01:00
silverqx 0d350d590a added SEC todo task to Find-Todos.ps1 2022-03-06 12:22:25 +01:00
silverqx e79be8906c used __has_include() to check mysql.h
Used __has_include() in #if macro directives instead of checking
_MSC_VER or __MINGW32__ to include mysql.h file.

 - also modified #error directive calls
2022-03-06 12:22:04 +01:00
silverqx 5185cd533d bugfix detecting of a lost connection 2022-03-02 12:32:45 +01:00
silverqx 4fc92a6e53 updated comment 2022-03-01 16:13:49 +01:00
silverqx c932f091c4 updated comments and renamed method
- clarified comments about connect/reconnect logic
   in the DatabaseConnection
 - renamed refreshQtConnection() method.
2022-03-01 15:30:17 +01:00
silverqx 39b92f5716 bugfix during disconnect
Do nothing if TinyORM connection is not resolved.

 - also throw RuntimeError in getRawQtConnection() if TinyORM
   connection is not resolved
2022-03-01 15:28:51 +01:00
silverqx 839a9fe16f exported (dll) DetectsLostConnections 2022-03-01 15:24:24 +01:00
silverqx 136a32c5fe added DatabaseConnection::isOpen()
It is a proxy to the QSqlDatabase::isOpen() method.
2022-03-01 15:23:08 +01:00
silverqx fbee3297ac handle lost connection during transactions
- bugfix reset transactions when lost connection occurs during
   commit()/rollBack()/savepoint()/rollBackToSavepoint() method calls
 - enhanced beginTransaction(), reconnect when connection was lost
2022-02-23 11:29:28 +01:00
silverqx 37c5f6e0d5 sync torrent model, connection names constants 2022-02-23 11:15:23 +01:00
silverqx 134bb37984 enahnced Find-Todos script 2022-02-21 13:24:45 +01:00
silverqx 7fed2e31e4 tests check transactions status
- bugfix reset savepoints during commit, rollBack
 - bugfix test all connections, forgotten code
2022-02-20 19:44:20 +01:00
silverqx d5ad16fb06 added SIZE constant 2022-02-20 15:21:49 +01:00
silverqx 2ffad4e1ca added transaction unit tests
Also savepoints tested.
2022-02-20 12:14:13 +01:00
silverqx e4a7ec5593 added todo tasks 2022-02-14 17:26:27 +01:00
silverqx 1991c8a959 modified Model's CRTP problem exception 2022-02-14 17:26:10 +01:00
silverqx ff6059fcdd inline comment 2022-02-14 17:25:28 +01:00
silverqx c165469f5d bugfix return QString for __tiny_func__ 2022-02-14 17:25:08 +01:00
silverqx 285d843733 changed forgotten std to TinyORM exception 2022-02-14 17:24:36 +01:00
silverqx 5956cb86c5 added OrmError base class for all exceptions 2022-02-14 17:23:31 +01:00
silverqx 8460f54be7 enable/disable debugging of SQL queries
Disabled forgotten log messages for transactional queries and also for
pretended queries.

Added possibility to enable/disable debugging of SQL queries per
connection (logging to the console using qDebug()).
2022-02-12 19:28:00 +01:00
silverqx a898660dfa enable/disable debugging of SQL queries
Added possibility to enable/disable debugging of SQL queries per
connection (logging to the console using qDebug()).
2022-02-12 18:49:26 +01:00
silverqx df0c1d666a added todo tasks 2022-02-12 13:17:05 +01:00
silverqx d9e857d5ed added using consts. NAME 2022-02-12 13:16:53 +01:00
silverqx 65a1c89c29 sync docs, DB::create() returns shared_ptr 2022-02-12 13:15:56 +01:00
silverqx cde15172c0 shared_ptr for DatabaseManager factory methods
Refactored from an unique_ptr to shared_ptr, I think this is a better
approach. Now it will be clear that a few DatabaseManager pointers are
stored somewhere in the TinyORM.

 - return std:shared_ptr from DatabaseManager factory methods
 - store a shared_ptr<DatabaseManager> in private data members in
   DatabaseManager and DB classes
2022-02-10 15:02:43 +01:00
silverqx 14fc5b891c qmake enhanced version header regex 2022-02-09 07:43:14 +01:00
silverqx b207fb9c6e unused method argument 2022-02-09 07:42:52 +01:00
silverqx ac32a6d3c4 qmake enhanced precompiled headers 2022-02-09 07:41:47 +01:00
silverqx dccc30e750 renamed Initialize- to Get- in ps1 script 2022-01-22 16:03:51 +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 4c2351e3ef fixed missing QVariant::typeid() for Qt6 2022-01-18 10:17:09 +01:00
silverqx 0442807a51 rewritten MySqlConnector::parseConfigOptions() 2022-01-18 10:00:40 +01:00