-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Better docs for Repository.execute #5264
Comments
I could not find a case where command is an object, is it connector specific, if this is the case, which connector? I checked out mysql, postgres and mongodb connectors, have I missed something? Can you guys provide any tips regarding this issue, in the end this function's documentation is very much based on the underlying connector, documentation may be very dry. |
Thank you @hazimdikenli for investigating the implementation of Yes, the functionality of
Cross-posting a comment from the PR that introduced
The trick is to keep the type descriptions generic enough to support different flavors implemented by connectors, but specific enough to provide at least basic type checks. One option is to create multiple overloads for different connectors. For example: // PostgreSQL
execute(command: string, params: any[], options: Options & {transaction: object});
// neo4j-graph
execute(query: object, unused: any[], options: Options);
// generic variant
execute(command: string|object, params: any[], options: Options);
That looks correct to me 👍 |
I noticed that we don't have a good documentation on how to use
Repository.execute
method. The API docs is very vague:Let's improve the docs to show examples how to use
execute
for SQL databases using parameterized queries (to avoid SQL injection attacks).If #3342 is not implemented yet, then add a mention about NoSQL flavors not being supported yet, link to that GitHub issue and update it's acceptance criteria to request a MongoDB example to be added to the API docs. If the issue is already implemented, thenAdd a MongoDB example as part of this story.
Prior work:
Acceptance criteria
Repository.execute
, details see ^.The text was updated successfully, but these errors were encountered: