realm / realm-java

Realm is a mobile database: a replacement for SQLite & ORMs
http://realm.io
Apache License 2.0
11.45k stars 1.75k forks source link

Support for Null values #478

Closed mikeholler closed 8 years ago

mikeholler commented 9 years ago

I want to be able to soft-delete items with a created and a deleted field, both of which being Date fields. When I tried creating an object (with no deleted flag), I received this error message:

java.lang.IllegalArgumentException: Null Date is not allowed.
            at io.realm.internal.Row.setDate(Row.java:195)
            at io.realm.RealmDataFileRealmProxy.setEnd(RealmDataFileRealmProxy.java:53)

Soft deletes like this are very common in databases, so it seems reasonable to support them. Are there any plans to support this already in the works?

rgrinberg commented 9 years ago

Is there an ETA on this feature, or development that we can follow?

It's a pretty simple but hugely important for me.

cmelchior commented 9 years ago

@rgrinberg We have a open PR that is under final review at this point. So right now a release this or next week is very likely. You can follow it here https://github.com/realm/realm-java/pull/1396

rgrinberg commented 9 years ago

Thanks, I'm excited to try this out.

kneth commented 8 years ago

We have just merge null support into master, and you can try it using the snapshot release. Please be aware that Realm's storage engine has changed and there is no downgrade path.