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

Implement From<Option> for BoltType #99

Merged
merged 1 commit into from
Jul 25, 2023

Conversation

jifalops
Copy link
Contributor

@jifalops jifalops commented Jul 23, 2023

Query strings that use a placeholder $foo for an Option<Into<BoltType>> cannot be constructed without first knowing if the option is None. This is bothersome because basic query strings for a struct can be determined without self, but filling in query params requires a self.

This PR associates a query parameter of None to mean BoltType::Null(BoltNull).

Does this change semantics? Before this, removing a property on an entity could be done via SET n.prop = null, but now it could be done with SET n.prop = $prop. It allows a kind of silly Option<Vec<Option>> as a type.

Will serde support take care of this (there's a draft PR)?

@jifalops jifalops changed the title impl From<Option> for BoltType implement From<Option> for BoltType Jul 23, 2023
@jifalops jifalops changed the title implement From<Option> for BoltType Implement From<Option> for BoltType Jul 23, 2023
Copy link
Collaborator

@knutwalker knutwalker left a comment

Choose a reason for hiding this comment

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

Thanks for adding this. We want to slowly phase out BoltType as the main API for things and replace it with serde for query params as well, until then this is a good addition.

@knutwalker knutwalker merged commit ded7476 into neo4j-labs:master Jul 25, 2023
21 checks passed
@jifalops jifalops deleted the allow-option-params branch July 25, 2023 16:30
@ddnomad
Copy link

ddnomad commented Sep 24, 2023

Any idea when this will be released?

@knutwalker
Copy link
Collaborator

I just mentioned this in another issue: #108 (comment)

Basically, since we are replacing the BoltType+(Try)From/Into based API with serde, I would like to not have anther release before the next one, which switches to serde. Can give a timeline for when that happens though. Could you use a git dependency in the meantime?

@ddnomad
Copy link

ddnomad commented Sep 29, 2023

I just mentioned this in another issue: #108 (comment)

Basically, since we are replacing the BoltType+(Try)From/Into based API with serde, I would like to not have anther release before the next one, which switches to serde. Can give a timeline for when that happens though. Could you use a git dependency in the meantime?

Thanks for replying! Yep, this is fine, I've vendored this lib in for now, staying tuned for a new release!

@knutwalker
Copy link
Collaborator

We now have a pre-release 0.7.0-rc.1 out with this change and others.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants