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

Help offered. Start developing the Client libraries for C# and F# #2

Open
iskandersierra opened this issue Jan 23, 2023 · 12 comments
Open

Comments

@iskandersierra
Copy link

I would like to work on a first draft for a C# client. How would it be possible to star collaborating with the SurrealDB team?

I'm also interested on creating the F# library as an extension of the main C# driver.

@mortalapeman
Copy link

Funny, I was also thinking working on a client implementation other way around for my personal project just today.

@iskandersierra
Copy link
Author

What do you mean @mortalapeman ? Working first on F#? 😄

That was my first reaction too, but thinking on the dotnet community, I thought that working on a C# friendly version first is more valuable, for the community and for this issue to move forward.

After posting the issue I found out that @Spylak started to work on a C# client, but I don't know if it is still WIP or just staled.

The REST API is very simple, so I think that the fundamentals could be developed very quickly. The query builder, if developed, would take more time, of course.

@Spylak
Copy link

Spylak commented Jan 24, 2023

Hello @iskandersierra , I did an initial implementation here which is kind of simple with all the endpoints that I saw while reading the documentation but then I found out that someone had done a more detailed implementation here so I stopped working on it.

@mortalapeman
Copy link

@Spylak I am not sure why I thought that last repo you linked was empty, maybe because the parent org of the repo has no members? Either way, that looks like something worth contributing to.

@iskandersierra Yes, working on F# first. Mostly because it would be more fun for me personally and therefore more likely that I would actually follow through and try to maintain it. I do realize that .NET is heavily C# biased, I just have a hard time using it in my free time.

@iskandersierra
Copy link
Author

Then go ahead 💪! Start working on the F# version. Given that dotnet is "shared" between C# and F#, let start with a repo structure where both can live. Let me know if I can make some code reviews when you have something.
@tobiemh and @jaimemh could lay some minimal rules on this proposal.

@mortalapeman
Copy link

Then go ahead 💪! Start working on the F# version. Given that dotnet is "shared" between C# and F#, let start with a repo structure where both can live. Let me know if I can make some code reviews when you have something. @tobiemh and @jaimemh could lay some minimal rules on this proposal.

If you have free time, I would not wait on me to get started. I have about an hour and a half each evening to do this kind of work, so my time is a bit limited. But if I do get something up, I will certainly reach out asap.

@iskandersierra
Copy link
Author

@mortalapeman @Spylak @tobiemh @jaimemh

I started a draft PR here, open for suggestions. It is still a WIP, missing some functionality, docs, benchmarks, tests and samples.

I started implementing the REST-based client, but I cannot find the WebSocket documentation here. So far, the only way around it is by reverse-engineering other clients

Is there any gRPC endpoint? Would that be a desired addition to the server?

@tstraus13
Copy link

I actually started working on a C# implementation as well when I saw there was no code in this repo. I guess I should have checked the issues/PRs 🤦. I worked on the Websocket Implementation though. I have connection, signup, and basic query function working but much still left to do. There was no documentation on the Websocket side so I started from the other clients (java, python, js, etc.) and slowly worked my way how each operation works. Maybe we can include an F# and C# implementation in the same repo? Just different projects in the same solution? I am not as familiar with F# but maybe both implementation could share code as well (Models/Classes and such)?

@PhotoAtomic
Copy link

PhotoAtomic commented May 5, 2023 via email

@mortalapeman
Copy link

I actually started working on a C# implementation as well when I saw there was no code in this repo. I guess I should have checked the issues/PRs 🤦. I worked on the Websocket Implementation though. I have connection, signup, and basic query function working but much still left to do. There was no documentation on the Websocket side so I started from the other clients (java, python, js, etc.) and slowly worked my way how each operation works. Maybe we can include an F# and C# implementation in the same repo? Just different projects in the same solution? I am not as familiar with F# but maybe both implementation could share code as well (Models/Classes and such)?

Just to be clear, I had originally thought I might write a client in F# for fun because I like F# and have done a toooon of C# and was bored of it. The one of the only reasons it should ever be done in F# is if I decided I was going to write it myself with little outside help because I do not want to do things in my free time that I do not find to be fun.

My aspirations to write it myself have not panned out, life has happened and such. I am of the opinion that any initial implementation that I am not actively involved in should be done in C# because the general .NET community is built around it. Doing it in C# is not a barrier for any other language built on the .NET runtime.

@vitorrubio
Copy link

I found some unoficial implementations for .net driver. One of them could be "promoted" as oficial. Some of they are
https://github.com/tiaringhio/Surreal.NET (only rest client)
there is @Spylak implementation (thanks a lot) https://github.com/Spylak/surrealdb.net (forked from oficial, only rest client yet too)
but the most complete implementation I saw until now is this fork of tiaringhio: https://github.com/Surreal-Net/Surreal.Net
It has HTTP and WS implementations and use Microsoft.IO.RecyclableMemoryStream when serialyzing/desserialyzing json request/response. And are all methods async.

I started to code a .net my own ws implementation just for fun / learning and followed js and go implementations as a guide. It still incomplete and a WiP (and a bit naive).

@Odonno
Copy link
Contributor

Odonno commented Aug 23, 2023

Hi everyone,

I know I am late to the party. I worked on a .NET client for the last several weeks. As of this, I made a PR #4 with basic features and I intend to make it the ultimate package for .NET developers using SurrealDB. I also have started the documentation, part on the readme and part for the official doc website here: https://github.com/surrealdb/www.surrealdb.com/pull/250. You can read it if you are interested.

I can see that some of you had questions in this discussion so I will try to answer them here.


Many of you asked for a F# client. I know that the patterns between C# and F# can be different. I concentrated my efforts first on C# because it is the primary language for .NET. Once the C# version is done, we could mimic the C# package to create a SurrealDb.FSharp package specifically designed for F# developers.


@iskandersierra SurrealDB only support HTTP(S) and WS(S) for the moment. So, no gRPC. I currently implemented HTTP(S) and WS(S) over TEXT protocol.


@vitorrubio As I said, I also want this package to be complete, or at least as much complete as possible. There is a lot of effort to make and if you see any interesting feature, please let us know. I know that one of the package you mentioned integrated a Query Builder. That may be something we can add in the future but it should not be part of the "core" package IMO.

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

7 participants