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

[Experimental] ReqlAst.run syntax #8

Closed
NotJustAnna opened this issue Feb 12, 2020 · 2 comments · Fixed by #7
Closed

[Experimental] ReqlAst.run syntax #8

NotJustAnna opened this issue Feb 12, 2020 · 2 comments · Fixed by #7
Assignees
Labels
enhancement New feature or request question Further information is requested

Comments

@NotJustAnna
Copy link
Member

This issue is discussing something to be implemented first-hand on the develop/experimental branch, which is tracked by #7

At first, ReQL syntax feels nice, but after some usage, it starts to freak you out.

Some queries return Cursor<T>, others return List<T>, others just return T.If you're a JS/Python/Ruby developer, it is fine, but in Java it makes you feel lost.

The reason lies on this line:

public <T, P> T run(Connection conn, OptArgs runOpts, Class<P> pojoClass) {

In Java, experienced developers orient themselves by the type system. But in this case, there is no type logic at all!

T, the return type, can be P, but can also be Cursor<P>, which makes all code a runtime guessing game of "will it return a cursor, a list or something else?".

I'm opening this issue to ask the community your opinions about this annoying issue, if it should be fixed or not, and if it should, what would you think would be a better syntax?

@NotJustAnna NotJustAnna added enhancement New feature or request question Further information is requested labels Feb 12, 2020
@NotJustAnna
Copy link
Member Author

NotJustAnna commented Feb 15, 2020

Alternative syntax using reactive streams is implemented and being discussed at #12 Experiment was dropped, back to the drawing board.

@NotJustAnna
Copy link
Member Author

Implemented in #7 with Results, which replace cursors.

@NotJustAnna NotJustAnna linked a pull request Feb 20, 2020 that will close this issue
@NotJustAnna NotJustAnna self-assigned this Feb 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant