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

Improve sql:Client->query()` method documentation to reflect usage of parameterized queries #2524

Comments

@IMS94
Copy link

IMS94 commented Dec 21, 2021

Description:
When using the sql:Client to query (and other similar operations), users get a bit confused about the usage of sql:ParameterizedQuery. From an end user's perspective, what they see is a class, but in source we write parameterized queries as:

sql:ParameterizedQuery query = `select * from ${tableName} where id=${entityId}`;

We have to explicitly mention how to write sql:ParameterizedQuery in the method documentations. See the method documentation for io:println() for an example. Similarly, we should add some examples and mention about parameterized queries being converted to prepared statements in the docs.

Describe your problem(s)
See description

Describe your solution(s)
Improve lib docs to reflect the correct usage

Related Issues (optional):
#33669

@niveathika
Copy link
Contributor

I am -1 on this because even though it is single line in the description, this needs to be repeated in all function description. There can be also issues where the give sample will not match all databases.

@daneshk WDYT?

@daneshk
Copy link
Member

daneshk commented Feb 9, 2022

It is better if we can have a code snippet to explain the usage in API Docs. Shall we add a simple code snippet that matches the connector?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment