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.
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
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 🕺
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)