Feature-flag null binary and string support

-DREALM_ENABLE_NULL to enable
This commit is contained in:
Samuel E. Giddins 2015-06-18 14:46:37 -07:00
parent c90f3e0210
commit c0da7c76e1
2 changed files with 8 additions and 0 deletions

View File

@ -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

View File

@ -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;
}