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

Create official C# driver #3931

Open
deontologician opened this issue Mar 13, 2015 · 20 comments
Open

Create official C# driver #3931

deontologician opened this issue Mar 13, 2015 · 20 comments
Milestone

Comments

@deontologician
Copy link
Contributor

https://github.com/mfenniak/rethinkdb-net might be a good jumping off point. It doesn't seem to be abandoned, just lagging a bit behind the official drivers.

@deontologician
Copy link
Contributor Author

There has been concern it would be weird to have a C# driver when RethinkDB doesn't run on Windows, but at least some people say that hybrid environments are common these days for windows devs, so it may not be strictly required

@robzhu
Copy link

robzhu commented Mar 13, 2015

A lot of enterprises that use .net had no options but to host on windows (ASP.net MVC requires IIS), but ASP.net vNext will change that:

https://weblogs.asp.net/scottgu/introducing-asp-net-5
https://github.com/dotnet/coreclr

If the RethinkDB .net drivers are in good shape when those pieces launch, it will be a soft landing for MS developers looking for alternatives to Mongo/Raven.

@danielmewes danielmewes added this to the backlog milestone Mar 18, 2015
@coffeemug
Copy link
Contributor

@robzhu -- what do you think the problems are with the community .net driver (https://github.com/mfenniak/rethinkdb-net)? Would love to hear your feedback on them -- it would really help with prioritizing development.

@mfenniak
Copy link

As the lead developer of the rethinkdb-net library, I'd also be interested in hearing any feedback on my project. I'm sure there are things that could be done better, some of which I'm aware of, but I'd be happy to hear if there's anything I'm missing.

In my opinion, the one area that mfenniak/rethinkdb-net is truly lacking is documentation. We do things a bit differently than the official RethinkDB drivers because .NET is a strongly typed environment and this driver is made to fit into that world. Unfortunately, that means that it's not simple to compare RethinkDB's documentation with our driver and expect everything to work.

@robzhu
Copy link

robzhu commented Apr 14, 2015

From the driver documentation:

"RethinkDB manipulations (pluck / merge / without / append / contains) and control structures (branch / forEach / error / coerceTo / typeOf) are not currently supported. Some manipulations (pluck / merge / without / append) are maybe not really compatible with the strong typing approach this library currently supports."

In practice, LINQ for performing queries on dynamic objects seems limited (pseudocode below, but perhaps I'm doing something wrong here?)

books.Filter( book => book.Name.ToLowerInvariant().Contains( "foo" ) );

will result in an exception. @mfenniak, perhaps you can suggest a workaround for this scenario and also chime in on the current level of support for the RethinkDB streaming APIs.

@mfenniak
Copy link

Whether the approach of mapping LINQ expression trees into ReQL is the best approach to a .NET driver or not would be a great discussion to have. If you want to have that discussion, I'd really enjoy participating in it, and we should take that to the rethinkdb-net project (as opposed to here). I have considered before that it might be better to have two layers of functionality within the driver; a basic layer that just provides all the operations with no type-safety but is easy to write and update, and a higher-level type-safe layer sitting on top of it.

The query you're trying to write doesn't seem to be supported by RethinkDB; RethinkDB's "contains" operator doesn't work on a string. RethinkDB does have a match operator for regular expression matching which could be used though; rethinkdb-net doesn't expose that currently (mfenniak/rethinkdb-net#107).

It also isn't supported by rethinkdb-net because we don't have a mapping for ToLowerInvariant() into the ReSQL downcase operator. I'll add an issue to support that (mfenniak/rethinkdb-net#206) and implement this for both Lower and Upper.

The current head of rethinkdb-net supports the streaming APIs on most of the queries. I just closed your issue, mfenniak/rethinkdb-net#190, after merging this support in 4 hours ago. A couple streaming cases aren't supported yet.

@robzhu
Copy link

robzhu commented Apr 14, 2015

Thanks Mathieu, let's continue this conversation over on the rethinkdb-net project. In case my intent was misinterpreted, I have been using your driver, and I think it's a great start. I filed this issue after a chat with @deontologician to list rethinkdb-net as the official .net driver and perhaps work with you to attain feature parity while preserving idiomatic C#/.net APIs.

@danielmewes
Copy link
Member

We're going to expand our set of officially supported drivers over the next months. We'll start with a Java driver (see #3930 ), but I think a C# driver might be next on our list (though this isn't completely planned out yet).

I'm not sure yet how we are going to do this exactly, but one option is to integrate the great driver by @mfenniak and the other rethinkdb-net developers into our testing system and documentation. We would then make sure to submit patches for protocol changes and extensions on time for our official releases.

@luisrudge
Copy link

@danielmewes well. I don't know how many people are asking for a native driver, but I'd reconsider the java over c# priority. With the new aspnet stack coming down any day now, it would be really great if you could take a ride on it's momentum to have gain some traction. If we think about aspnet5+rethinkdb+signalr, we certainly have a stack as powerful as nodejs+rethinkdb+socket.io.

@danielmewes
Copy link
Member

@luisrudge Thanks for your feedback. You make a good point.
The reason we're going to support a Java driver first is that a) we've seen quite a bit of demand for it and most importantly - b) there isn't an up-to-date community-supported driver for it.
rethinkdb-net on the other hand is already a really good driver, and it's up to date and maintained.

@luisrudge
Copy link

@danielmewes that's great to hear! Kudos to the rethinkdb-net team!

@bchavez
Copy link
Contributor

bchavez commented Aug 28, 2015

Hey everyone, I created a new C# RethinkDB driver here: https://github.com/bchavez/RethinkDb.Driver

bchavez/RethinkDb.Driver is modeled closely after @deontologician 's current Java driver progress (pretty much a one-to-one port of the Java driver). It follows the same build process and driver architecture as Josh's current Java driver.

As with @deontologician 's Java driver connection unit test, the bchavez/RethinkDb.Driver C# driver passes its first connection unit test too. 👍

I hope to continue following Josh's Java driver work closely and keep this new driver up-to-date since they both share the same architecture.

@deontologician
Copy link
Contributor Author

Nice! I am going to have to document this thing better now I guess...

On Thu, Aug 27, 2015 at 10:27 PM Brian Chavez notifications@github.com
wrote:

Hey everyone, I created a new C# RethinkDB driver here:
https://github.com/bchavez/RethinkDb.Driver

bchavez/RethinkDb.Driver https://github.com/bchavez/RethinkDb.Driver is
modeled closely after @deontologician https://github.com/deontologician
's current Java driver progress (pretty much a one-to-one port of the Java
driver). It follows the same build process and driver architecture as
Josh's current Java driver.

As with @deontologician https://github.com/deontologician 's Java
driver connection unit test
https://github.com/rethinkdb/rethinkdb/blob/8e701ed158e649c25984e568431e96d5c675b24a/drivers/java/src/main/java/com/rethinkdb/RethinkDBTest.java,
the bchavez/RethinkDb.Driver
https://github.com/bchavez/RethinkDb.Driver/blob/master/Source/RethinkDb.Driver.Tests/ConnectionTest.cs
C# driver passes its first connection unit test too. [image: 👍]

I hope to continue following Josh's Java driver work closely and keep this
new driver up-to-date since they both share the same architecture.


Reply to this email directly or view it on GitHub
#3931 (comment)
.

@srh
Copy link
Contributor

srh commented Feb 10, 2016

You shouldn't release an official C# driver with lowercase function names (they look really janky in a C# dev's eyes) or one that doesn't use IDisposable in the reasonable places -- it should follow Microsoft's C# Coding Conventions.

@coffeemug
Copy link
Contributor

Duly noted! Also, hi @srh!

@quentez
Copy link

quentez commented Feb 12, 2016

Any update on this? Both drivers have their issues, and I wouldn't want to invest too much time building on one if the other is about to be declared "official" 😅 !

@deontologician
Copy link
Contributor Author

@quentez: we arent going to declare an official driver soon, so feel free to pick whichever you like. But we would likely use the bchavez driver since it's similar to the java driver and is easier to maintain. The mfenniak driver will likely continue to be the more idiomatic driver for reasons discussed in bchavez/RethinkDb.Driver#18

@bchavez
Copy link
Contributor

bchavez commented Feb 12, 2016

Hey there, capitalization seems to be a big sticking point so I'll take a second swing at proper capitalization for the ReQL AST. I have a few other ideas I could to try... Also, do you have any other concerns about the bchavez driver? If so, please feel free to log them in the repo and I'll take a look at them.

@srh
Copy link
Contributor

srh commented Feb 13, 2016

Capitalization is naturally silly and intrinsically unimportant but it's basically a marketing thing, personally it sets off my C# dev spidey-sense. Time to rename the library NRethinkDB <LOL>. But there's no reason why you should particularly care about my opinion.

@bchavez
Copy link
Contributor

bchavez commented Feb 13, 2016

@srh No worries. Your 🪲 spidey-sense can rest at ease. The bchavez/RethinkDb.Driver now follows proper C#/.NET naming conventions for the ReQL AST and all public APIs (v2.2.5-beta-3 or later). It's a bit of whiplash for those upgrading to v2.2.5-beta-3 but I'd rather do it now than later. Docs updated too. 👍

Also, fixed a bug in the ReGrid file storage API: bchavez/RethinkDb.Driver#28

Thank you all for your valuable feedback. Brian

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

9 participants