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

F# support for Option type #147

Open
rogeralsing opened this issue Jul 3, 2016 · 1 comment
Open

F# support for Option type #147

rogeralsing opened this issue Jul 3, 2016 · 1 comment

Comments

@rogeralsing
Copy link

One thing that would be really nice would be to have support for F# option types.

e.g.

type Person =   { Name : string option; Age : int }

...
    let q = 
        query { 
            for person in context.Query<Person>() do
                where (person.Name = Some("Roger"))
                select person
        }

This results in a syntax error when emitting the N1QL, which tbh was expected, but as F# does not use null or nullable types but rather Option types, this would be a nice addition.
Half of it already works, you can query for person.Name = None and I guess None somehow gets translated to null somewhere.

@MikeGoldsmith
Copy link
Contributor

Hi @rogeralsing

Thanks for your suggestion.

I'm happy look at how much work this would take to get that type of query to work however I'm quite new to F#, would you be able to provide me with a sample app that illustrates the problem?

Thanks

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

No branches or pull requests

2 participants