Closed vshapenko closed 5 years ago
Awesome! can you add your mapper to the tests to see which ones are failing? There is this function:
let useDatabase (f: LiteDatabase -> unit) =
let mapper = FSharpBsonMapper()
use memoryStream = new MemoryStream()
use db = new LiteDatabase(memoryStream, mapper)
f db
create another one useTypeShapeDb
:
let useTypeShapeDb(f: LiteDatabase -> unit) =
let mapper = Experiemental.TypeShapeMapper()
use memoryStream = new MemoryStream()
use db = new LiteDatabase(memoryStream, mapper)
f db
Then parameterize the tests such that they take (useDatabase : LiteDatabase -> unit)
parameter, what do you think?
@Zaid-Ajaj Based on tests, we got 3x performance gain
Wohoo Nice! 🚀 it looks like these tests are failing:
I guess that is because Bson.deserialize
and Bson.serialize
are still mapper-dependent, can you parameterize these as well such that take and use a mapper as input?
Lastly, it would be great to add a little section to the README regarding how to use the type-shape mapper 🙏
Wohoo Nice! 🚀 it looks like these tests are failing:
I guess that is because
Bson.deserialize
andBson.serialize
are still mapper-dependent, can you parameterize these as well such that take and use a mapper as input?Lastly, it would be great to add a little section to the README regarding how to use the type-shape mapper 🙏
Bson.serialize and deserialize do not depend on mapper
I guess tests failed because i use different serialization format for DU etc
Also looks like quotation expressions heavily tied to Bson.fs
I see, I though we could make Bson.fs mapper-dependent but that is OK, I guess we can merge this, I will put the Bson specific tests in their own testList that only takes FSharpBsonMapper
I will add a README section as well, will be able to work on this later this evening
Published as of v2.12.0 :rocket:
This PR adds typeshape mapper support for LiteDb.Fsharp. Currently it passes 76 of 78 tests