[odb-users] Schema change for std::set<QString> 2.4.0 vs 2.5.0

Boris Kolpackov boris at codesynthesis.com
Wed Apr 30 10:07:53 EDT 2025


Richard Oehlinger <richard.oehlinger at adbsafegate.com> writes:

> struct MyClass
> {
>     QString           m_id{};
>     std::set<QString> string_set;
> };
> PRAGMA_DB(object(MyClass))
> PRAGMA_DB(member(MyClass::m_id) id)
> 
>   "value" TEXT NOT NULL,                             ;<== DIFF
>
>   "value" TEXT NULL,                                 ;<== DIFF

Per the manual, the default mapping for QString allows NULL since
this type has the notion of a NULL value:

https://www.codesynthesis.com/products/odb/doc/manual.xhtml#24.1.3


> Was this change on purpose?

I actually don't see this changing since 2.4.0. What most likely
happened is a bug was fixed in ODB, perhaps in handling of nullable
values as elements of containers.


> Can I do anything to prevent a schema change or should I just bite
> the bullet and introduce a new schema version.

Yes, you can do:

PRAGMA_DB(member(MyClass::string_set) value_not_null)



More information about the odb-users mailing list