F# support
See original GitHub issueThere are not much embedded databases on .net, especially with F# data structures support. So it would be nice to have such option in LiteDB.
The main problem is storing F# specific types, such as DU, records, collections, options.
I created simple POC for (de)serialization DU types, it works, but extending BsonMapper
is not very convenient.
First of all I’d like to ask: “Are you interested in it?” . And if the answer is yes, what is the best way to add F#-specific stuff for LiteDB?
I can add new project in main repo but ship nuget package separately. Or maintain f# project in separate repo. Anyway we should think about how it would be integrated, I mean how to extend BsonMapper
. In my POC I inherited BsonMapper
and override Serialize
and Deserialize
methods, but I’m not sure that it’s the best way. Maybe it would be better to create custom EntityMapper
.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:6 (3 by maintainers)
Top GitHub Comments
Hello @p69, I saw this thread a couple of days ago and thought it would be nice to have an F# version of LiteDB. So I started working on the library LiteDB.FSharp. It already supports a lot of kinds of conversions (records, maps, generic discriminated unions) and all of the special bson properties ($date, $binary, $oid, $longNumber, $decimalNumber)
Take a look and contribute (tests, samples) if you are interested 😄
@Zaid-Ajaj Ha, cool 👍 Thank you very much! I’ve already taken a quick a look at it today in the morning. Looks good 👍 So this thread can be closed. F# community strong!