From 3ccd52b46db124086345f3c7b8e95e435d500903 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 19 Jul 2011 13:42:18 +0200 Subject: New design for NULL semantics Now, instead of being specified as part of the SQL type with the type pragma, there are separate null and not_null pragmas. The not_null pragma was used to control NULL-ness of object pointers. Now the two pragmas are used consistently for object pointers and simple values (and in the future will work for composite values and containers). --- odb/qt/basic/mysql/default-mapping.hxx | 5 ++--- odb/qt/basic/sqlite/default-mapping.hxx | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'odb/qt/basic') diff --git a/odb/qt/basic/mysql/default-mapping.hxx b/odb/qt/basic/mysql/default-mapping.hxx index d111a08..e26e73e 100644 --- a/odb/qt/basic/mysql/default-mapping.hxx +++ b/odb/qt/basic/mysql/default-mapping.hxx @@ -12,12 +12,11 @@ // By default, map QString to MySQL TEXT for non-id and to VARCHAR(256) for // id members. MySQL cannot have primary keys of the TEXT type. // -#pragma db value(QString) type("TEXT NOT NULL") \ - id_type("VARCHAR(256) NOT NULL") +#pragma db value(QString) type("TEXT") id_type("VARCHAR(256)") // Map QByteArray to MySQL BLOB by default. Allow NULL values by default as // QByteArray provides a null representation. // -#pragma db value(QByteArray) type("BLOB") +#pragma db value(QByteArray) type("BLOB") null #endif // ODB_QT_BASIC_MYSQL_DEFAULT_MAPPING_HXX diff --git a/odb/qt/basic/sqlite/default-mapping.hxx b/odb/qt/basic/sqlite/default-mapping.hxx index cc04ddd..2526121 100644 --- a/odb/qt/basic/sqlite/default-mapping.hxx +++ b/odb/qt/basic/sqlite/default-mapping.hxx @@ -12,11 +12,11 @@ // Map QString to SQLite TEXT by default. Allow NULL values by default as // QString provides a null representation. // -#pragma db value(QString) type("TEXT") +#pragma db value(QString) type("TEXT") null // Map QByteArray to SQLite BLOB by default. Allow NULL values by default as // QByteArray provides a null representation. // -#pragma db value(QByteArray) type("BLOB") +#pragma db value(QByteArray) type("BLOB") null #endif // ODB_QT_BASIC_SQLITE_DEFAULT_MAPPING_HXX -- cgit v1.1