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

Incorrect index created for Datetime option #9

Open
sandeepc24 opened this issue Aug 12, 2017 · 5 comments
Open

Incorrect index created for Datetime option #9

sandeepc24 opened this issue Aug 12, 2017 · 5 comments

Comments

@sandeepc24
Copy link

For following type

type User = {
    Id : Guid
    Username : string
    Password : string    
    DOB : DateTime option
}

I define store as shown below

let store = DocumentStore.For(fun x -> 
    x.AutoCreateSchemaObjects <- AutoCreate.CreateOrUpdate
    x.Connection(ConnecitonString)
    x.Schema.For<User>().Index(fun x -> x.Username :> obj) |> ignore
    x.Schema.For<User>().Index(fun x -> x.DOB :> obj)|> ignore
    )

The index for DOB is created as

CREATE INDEX mt_doc_database_user_idx_dob
  ON public.mt_doc_database_user
  USING btree
  (((data ->> 'DOB'::text)::jsonb));

this should be as shown below

CREATE INDEX mt_doc_database_user_idx_dob
  ON public.mt_doc_database_user
  USING btree
  (mt_immutable_timestamp(data ->> 'DOB'::text));
@ibnuda
Copy link
Contributor

ibnuda commented Aug 12, 2017

Should be Marten's problem.

@TheAngryByrd
Copy link
Owner

Yeah this should be an opened on Marten's issue tracker: https://github.com/JasperFx/marten/issues

I'm not sure how pluggable the type generation is, but I'd be up for supporting F# types here if it's pluggable and doesn't want to support them in Marten main.

@sandeepc24
Copy link
Author

I think there was some talk about making serialization pluggable on gitter. IMO it would be better if we deal with it, that way F# won't have to rely on Marten for serialization implementation and fixes.

@TheAngryByrd
Copy link
Owner

I think I'll try to take a look at JasperFx/marten#778 over the weekend and see if it's possible to add some F# types.

@sandeepc24
Copy link
Author

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

3 participants