-
Notifications
You must be signed in to change notification settings - Fork 11
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
Suggestion to Standardize SDK Initialization Method Naming #39
Comments
Weird, on most packages, the method is named In Rust: let db = Surreal::new::<Ws>("127.0.0.1:8000").await?; In Golang: db, err := surrealdb.New("ws://localhost:8000/rpc") For information, I tried to stay as close as possible to the Rust SDK. And IMO, |
It's very confusing to have so many constructors. Maybe make the following one's private and not documented. |
Agreed, I think it would make more sense to be able to pass this into a generic factory method and it returns
I also found it quite confusing that the first parameter in the |
Now, I can understand your point of view. I made those extra functions for the following reasons:
So, like you both are trying to say. If there is no value, we can definitely get rid of it. |
For information, those static methods are gone from at least v0.3. |
PR #58 for reference |
I've been going through the documentation for the SDK drivers for our database, and I've noticed a discrepancy in the way we initialize a new host across different languages. Specifically, in the .NET SDK, we currently use SurrealDbHttpClient.New(host) for initialization. In contrast, other languages' documentation frequently employs the .init() convention.
To maintain consistency and predictability for developers familiar with other SDKs or expecting a more standard initialisation method, I'd like to suggest renaming the method from:
SurrealDbHttpClient.New(host)
to
SurrealDbHttpClient.Init(host)
The text was updated successfully, but these errors were encountered: