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 🕺
This commit contains a huge amount of small fixes and changes, almost
every file was edited.
I still have 21 new todos to finish/revisit and also, all todos defined
in mysqlresult/_p.cpp and sqlquery.cpp (~33).
- bugfix in MySqlUtilsPrivate::decodeMySqlType()
- updated NOTES.txt - TinyOrm headres used in TinyDrivers
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()
- and also to the tom --version
- added components to Dependencies section
- prints info also about TinyMySql
- takes into account all build types static/shared/loadable
- tests both build systems qmake/CMake