4 ms·
Slava @ RethinkDB here. You might want to look at https://github.com/mfenniak/rethinkdb-net https://github.com/mfenniak/rethinkdb-net (this is an alternative C
by coffeemug 11y ago
Slava @ RethinkDB here.
You might want to look at https://github.com/mfenniak/rethinkdb-net https://github.com/mfenniak/rethinkdb-net (this is an alternative C# driver with a different API). We'd love to get an official C# driver in soon, so if the community has suggestions on how to improve the API (and which driver feels more idiomatic), we're all ears!
- talles 11y agoFrom a quick glance, this one you just posted feels way more idiomatic than the Java port. The ultimate idiomatic thing to do would be to expose rethink as an IQueryable<T>, but implementing it can get hard/tricky. https://msdn.microsoft.com/library/System.Linq.IQueryable https://msdn.microsoft.com/library/System.Linq.IQueryable
- skrebbel 11y agoThat would be amazing, but potentially also misleading. My 2 cents for Slava & co: The idea of IQueryable<T> is that it implements all LINQ "operators" (a weird LINQ term; they're just methods on an interface) just like IEnumerable<T> does it on in-memory data structures. But internally IQueryable<T> implementations typically build an SQL query instead. So IQueryable<T> is designed for a use case somewhere halfway between an SQL query builder and an ORM. I don't know ReQL well enough, so you'll have to assess this yourselves: If you can map all or most LINQ operators into ReQL, then you have to do the effort and implement IQueryable, it's too awesome an opportunity to let go. But if the match is only, say, 50%, plus there's a couple of things Rethink can do that isn't easy to express with LINQ, I'd strongly recommend not implementing it at all, but designing your own, C#-flavored, query interface that just resembles the LINQ operators wherever possible (e.g. use "Where" instead of "filter"). Thing is, developers expect that anything they do on an IQueryable is transformed into a single gigantic query and optimized and executed once, on the database. Maybe Rethink can't guarantee the same performance characteristics, simply because it's no relational SQL-ish database. It would have to implement certain parts of IQueryable in client-side memory just to be compatible. Do that, and you'll end up fooling a lot of developers and they'll have a hard time finding out where their speed went. The other option is runtime NotImplementedExceptions for all unsupported methods, which really is just as unfriendly.
- coffeemug 11y agoThanks guys, that helps a lot!