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

Support optional properties #5

Closed
bleonard opened this issue Sep 3, 2015 · 6 comments
Closed

Support optional properties #5

bleonard opened this issue Sep 3, 2015 · 6 comments

Comments

@bleonard
Copy link

bleonard commented Sep 3, 2015

some of the issues that I'm seeing could be attributed to crashing if the value is undefined.

I'm calling realm.create(data)
let's say the table has a column named title but I leave it off the data object.

I think it's crashing with "should be a string"
I was expecting it to set the value to NULL if left off.

@bleonard
Copy link
Author

bleonard commented Sep 3, 2015

upon further testing, it turns out that I can't set null to a string column at all. is that expected?

@alazier
Copy link
Contributor

alazier commented Sep 3, 2015

That is expected for the time being. Support for optional properties was just added to the core library and needs to be extended to the js binding. In the long term all properties in js will probably be optional by default, and you will be able to indicate properties with required values in the schema definition.

@alazier alazier changed the title undefined/null behavior Support optional properties Sep 3, 2015
@bleonard
Copy link
Author

bleonard commented Sep 3, 2015

That's interesting. There is no NULL in Realm?

@alazier
Copy link
Contributor

alazier commented Sep 3, 2015

In the past NULL was only supported on object/link properties. All other property types required valued to be present. This was mostly due to optimizations in the core library. Changes in core were just finished to support NULL values for all types and work is currently being done to expose this in all of the bindings.

@bleonard
Copy link
Author

bleonard commented Sep 3, 2015

ok, thanks. can i keep this open until that is fixed in the JS?

@alazier
Copy link
Contributor

alazier commented Sep 4, 2015

Lets keep it open. Will hopefully be working on this next week.

@alazier alazier added blocked and removed blocked labels Oct 20, 2015
@alazier alazier removed the P1 label Oct 27, 2015
@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.
Projects
None yet
Development

No branches or pull requests

2 participants