Feature-flag null binary and string support
-DREALM_ENABLE_NULL to enable
This commit is contained in:
parent
c90f3e0210
commit
c0da7c76e1
|
@ -37,7 +37,11 @@ ObjectSchema::ObjectSchema(Group *group, const std::string &name) : name(name) {
|
|||
property.type = (PropertyType)table->get_column_type(col);
|
||||
property.is_indexed = table->has_search_index(col);
|
||||
property.is_primary = false;
|
||||
#ifdef REALM_ENABLE_NULL
|
||||
property.is_nullable = table->is_nullable(col) || property.type == PropertyTypeObject;
|
||||
#else
|
||||
property.is_nullable = property.type == PropertyTypeObject;
|
||||
#endif
|
||||
property.table_column = col;
|
||||
if (property.type == PropertyTypeObject || property.type == PropertyTypeArray) {
|
||||
// set link type for objects and arrays
|
||||
|
|
|
@ -292,7 +292,11 @@ bool ObjectStore::create_tables(Group *group, ObjectStore::Schema &target_schema
|
|||
break;
|
||||
}
|
||||
default:
|
||||
#ifdef REALM_ENABLE_NULL
|
||||
target_prop.table_column = table->add_column(DataType(target_prop.type), target_prop.name, target_prop.is_nullable);
|
||||
#else
|
||||
target_prop.table_column = table->add_column(DataType(target_prop.type), target_prop.name);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue