-
Notifications
You must be signed in to change notification settings - Fork 150
Make the library more javascript friendly #322
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
Comments
Hi @eelsweb, Thanks for raising this issue. I can't see how it is immediately actionable for us because, as you say, those problems have been mentioned before and corresponding issues are still open. There are number of problems with your suggestions:
Could you please share your code for result mapping? It would be valuable for us to see how much of a burden is it. |
Thanks for your response.
I am not sure If I understood the usage you are suggesting here - but it would be something like if my query has
Our mapping function utilizes the Again, thanks for clearly responding to the concerns. As a user of this lib, I just wanted to point out some of my suggestions |
Hi @eelsweb, I agree that it's possible to introduce a config like
I only mean that it's now possible to have query like |
@eelsweb attached PR adds a setting to make driver always use native JS numbers instead of Am I right that this resolves both your concerns? |
@lutovich this is great. I think this should cover all cases while providing a lot of flexibility. Though I would also recommend adding this, as well as the use of I think I also agree with what @ali-ince has suggested in the PR #323 - this config option could also be received by Lets say majority of my cases can be handled by JS Numbers and in a few cases I need the constructor - If, its the other way around, constructor - Thanks a lot for enhancing this so quickly. Waiting for 1.6 to drop now 😬 |
One of the principles of a js client library should be to make it easier to use the underlying platfrom (in this case cypher/neo4j) from a js/nodejs application. I think there are a number of design patterns in this lib which make it quite impractical
Handling of integers -
Has already been raised on numerous occasions Handling integers #245 Properties(node) with integer values returned with high/low object #225 Strange behavior with integer number literals being returned as objects {high: 23, low: 0} #122
Edge cases shouldn't make the default behavior impractical
Response format - currently returns a representation of a table
Was referred in Feature Request for a toJSON method #189 and the resolution provided for this issue should IMO be the default format that the promise returns.
As a consumer inside a javascript/nodejs application I would expect a json representation of the data.
This forces me to map the result in 100 pc of the cases - which IMO is one of the jobs that a client library should handle.
I don't mean to suggest that the other cases should be ignored, but these cases which are used less frequently and only in advanced/edge scenarios, should not be the default behavior.
The text was updated successfully, but these errors were encountered: