Commit Graph

356 Commits

Author SHA1 Message Date
silverqx
2b7976bd30 drivers updated comment 2024-07-28 12:53:09 +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
5154bc945b drivers added/updated comment 2024-07-28 09:13:51 +02:00
silverqx
656895eb1e drivers fixtypo 2024-07-28 00:34:48 +02:00
silverqx
fbafb316f1 drivers removed const_cast<>
This is possible after the std::enable_shared_from_this<MySqlDriver> was
added.
2024-07-28 00:34:47 +02:00
silverqx
88b8286e35 drivers removed driverWeakInternal()
This is possible after the std::enable_shared_from_this<MySqlDriver> was
added.
2024-07-28 00:34:45 +02:00
silverqx
3518d9f316 drivers get rid of passing weak_ptr<SqlDriver> 🙌
Used the std::enable_shared_from_this<MySqlDriver> base class to avoid
passing the weak_ptr<SqlDriver> all around. It greatly simplified
the code and also the logic is more correct.

It also allowed to remove the SqlDatabase::driverWeak() non-const
version which was dedicated exactly for this, to be able to pass it
to methods that needed it, no more needed now.
2024-07-28 00:32:39 +02:00
silverqx
f9cdaba8ba drivers added IWYU pragma 2024-07-27 21:12:39 +02:00
silverqx
66e0404688 drivers mysql added comment 2024-07-26 21:52:40 +02:00
silverqx
eba49776c1 drivers optimized cleanup before query execution
Don't cleanup on the newly created instance.
2024-07-26 21:51:05 +02:00
silverqx
ee78b3f534 drivers mysql added comment and removed todo task 2024-07-26 19:20:00 +02:00
silverqx
d540bd4c53 drivers mysql removed memset() to 0 2024-07-26 13:59:08 +02:00
silverqx
9b63cc9f1f drivers mysql added/updated comments 2024-07-26 12:39:09 +02:00
silverqx
beeeff52b0 drivers mysql added todo task 2024-07-26 12:39:09 +02:00
silverqx
e4e46ff463 drivers mysql +1 for string buffers length
- updated comments
2024-07-24 19:41:54 +02:00
silverqx
a1ce7bb31a drivers mysql added Q_ASSERT() 2024-07-24 19:41:03 +02:00
silverqx
abc9902878 drivers mysql whitespace 2024-07-24 19:40:49 +02:00
silverqx
5c0bce8787 drivers mysql bugfix BLOB-s length 2024-07-23 21:51:55 +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
be79111379 drivers fixtypo 2024-07-23 13:28:30 +02:00
silverqx
8df1d77999 drivers updated comment 2024-07-21 20:29:54 +02:00
silverqx
3d599fc501 drivers bugfix different parameter name decl./def. 2024-07-21 20:03:33 +02:00
silverqx
c5e9b86459 drivers renamed parameter 2024-07-21 20:03:16 +02:00
silverqx
25a4c94de3 drivers mysql added IWYU pragma 2024-07-21 12:58:19 +02:00
silverqx
7ec904de76 removed useless #include-s 2024-07-21 12:54:40 +02:00
silverqx
af9e405954 unified constructor comments 2024-07-21 12:54:39 +02:00
silverqx
6a59f334f9 fixtypo 2024-07-21 12:54:38 +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
6472bb6063 drivers mysql updated comment 2024-07-20 19:50:11 +02:00
silverqx
a249a52a5f drivers mysql renamed local variable 2024-07-20 19:50:11 +02:00
silverqx
49de8b62c2 drivers added databaseName() 2024-07-20 19:50:11 +02:00
silverqx
7d111c31eb drivers fixtypo 2024-07-20 19:50:10 +02:00
silverqx
59002ddbb2 drivers added section comment 2024-07-20 19:50:10 +02:00
silverqx
063d725340 drivers updated comment 2024-07-20 19:50:09 +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
36d2f694e5 drivers updated comments 2024-07-20 18:42:01 +02:00
silverqx
97e0c2892e drivers added SqlRecord::fieldNames() 2024-07-20 18:42:01 +02:00
silverqx
270b75bf8d drivers added SqlField::isNullColumn() 2024-07-20 18:42:01 +02:00
silverqx
84b5498c27 drivers mysql removed useless #include 2024-07-20 18:42:01 +02:00
silverqx
d29050293a drivers extracted SqlRecord cache to own class
- added a nice API
2024-07-20 18:42:01 +02:00
silverqx
c90c5c1298 drivers moved databaseName up 2024-07-20 18:42:01 +02:00
silverqx
a836f35f4a drivers mysql added escapeIdentifier()
- also added DOT constant
2024-07-20 18:42:00 +02:00
silverqx
f1c1246d7d drivers mysql bugfix isIdentifierEscaped() 2024-07-17 10:40:28 +02:00
silverqx
0e2a038291 driver moved definition down 2024-07-14 14:59:04 +02:00
silverqx
fe49e0e491 drivers mysql added BACKTICK constant 2024-07-14 12:41:46 +02:00
silverqx
ce6ed5a15b drivers mysql reordered method 2024-07-14 12:33:34 +02:00
silverqx
203c8f96bb drivers suppressed Clang Tidy warning 2024-07-13 22:17:13 +02:00
silverqx
16103cb9cb drivers whitespace 2024-07-12 18:30:39 +02:00
silverqx
8a60adca8a drivers renamed method 2024-07-12 12:05:04 +02:00
silverqx
9ae5928806 drivers fixtypo in method name 2024-07-12 12:04:12 +02:00