Sqlite: Strict table support

With Sqlite 3.37 strict tables are introduced:
https://www.sqlite.org/stricttables.html

The introduce strict column types. So you can not add a text to an
integer column anymore. Additionally they introduce the "any" column
which is a dynamic type.

Change-Id: I43c0410821aa154e7de83e24bd221a232f98e910
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Marco Bubke
2021-12-14 13:36:23 +01:00
parent 90bb92f327
commit ad505aad59
12 changed files with 1388 additions and 468 deletions

View File

@@ -135,16 +135,6 @@ TEST(SqlStatementBuilder, ClearBinding)
ASSERT_THROW(sqlStatementBuilder.sqlStatement(), SqlStatementBuilderException);
}
TEST(SqlStatementBuilder, ColumnType)
{
ASSERT_THAT(SqlStatementBuilder::columnTypeToString(ColumnType::Numeric), " NUMERIC");
ASSERT_THAT(SqlStatementBuilder::columnTypeToString(ColumnType::Integer), " INTEGER");
ASSERT_THAT(SqlStatementBuilder::columnTypeToString(ColumnType::Real), " REAL");
ASSERT_THAT(SqlStatementBuilder::columnTypeToString(ColumnType::Text), " TEXT");
ASSERT_THAT(SqlStatementBuilder::columnTypeToString(ColumnType::Blob), " BLOB");
ASSERT_TRUE(SqlStatementBuilder::columnTypeToString(ColumnType::None).isEmpty());
}
TEST(SqlStatementBuilder, SqlStatementFailure)
{
SqlStatementBuilder sqlStatementBuilder("SELECT $columns FROM $table");