Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object store cleanup #99

Merged
merged 64 commits into from
Oct 26, 2015
Merged

Object store cleanup #99

merged 64 commits into from
Oct 26, 2015

Conversation

alazier
Copy link
Contributor

@alazier alazier commented Oct 26, 2015

Migrates to latest changes and cleans some stuff up.

@appden

alazier and others added 30 commits August 13, 2015 09:28
Much faster to copy and destroy with no loss in lookup performance.
Switch to an abstract class rather than std::function in preparation for having
more kinds of notifications with different arguments for KVO.
Change schema verification to operate on a pair of Schema objects rather than a
Schema and a Group to eliminate some redundant work done, defer some of the
work done for migrations to within the migration block to avoid doing it
unnecessarily, and make passing in a custom schema in the Config when creating
a Realm entirely equivalent to calling update_schema() afterwards.
tgoyne and others added 19 commits September 28, 2015 15:33
Minimal migration tests - use same path for all tests
Move things which are not part of the API to an impl directory/namespace
…ents.

Required columns are migrated to optional by creating a new nullable column,
copying the data from the required column to the optional column, then removing
the original required column.
…n to a required column.

Optional values are not automatically migrated to required columns since it is a lossy process.

This test case revealed an issue where the number of objects can be lost if all properties of an
object were optional and are all being migrated to required. This happens because the migration
process removes the optional columns in a first pass, and recreates them as required in a second
pass. Since this results in all columns being removed, we lose track of how many objects were
stored. We avoid this by detecting the case where we are about to remove the last column and
inserting a placeholder column that we'll remove after inserting the new columns.
Support migrating required columns to optional, preserving their contents
@alazier alazier changed the title [WIP] Object store cleanup Object store cleanup Oct 26, 2015
static void copy_property_values(const Property& old_property, const Property& new_property, Table& table,
T (Table::*getter)(std::size_t, std::size_t) const noexcept,
void (Table::*setter)(std::size_t, std::size_t, T)) {
size_t old_column = old_property.table_column, new_column = new_property.table_column;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wish these had their own lines for better readability

@appden
Copy link
Contributor

appden commented Oct 26, 2015

👍

alazier added a commit that referenced this pull request Oct 26, 2015
@alazier alazier merged commit 6db449e into master Oct 26, 2015
fealebenpae pushed a commit that referenced this pull request Aug 2, 2016
Specify width of PropertyType to 1 byte
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants