-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
doc: correct and expand documentation for SQLTagStore #60200
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
doc: correct and expand documentation for SQLTagStore #60200
Conversation
|
Review requested:
|
e9601ee to
ca594f6
Compare
8a576e5 to
35c7030
Compare
|
Rebased for merge conflict. |
doc/api/sqlite.md
Outdated
| parameters to the underlying prepared statement. For example: | ||
|
|
||
| ```js | ||
| tagStore.get`SELECT ${value}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tagStore should be defined, otherwise it is unclear how it is created.
Also I would recommend naming it sql or something else that is concise, since that is the whole point of the tagged literal API right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If anything it should be sqlTagStore to match the class block. I don't think the meaning is ambiguous, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think adding a
const tagStore = db.createTagStore();
at the top would be helpful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turtle problem, no? db isn't explicitly defined either!
This is really only intended to be an inline comment to show the difference between the two styles, and the full example block below still contains the concrete self-contained demonstration. I don't think there's much benefit to bloating these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are other examples that use db as a name for a DatabaseSync handle.
This is really only intended to be an inline comment to show the difference between the two styles, and the full example block below still contains the concrete self-contained demonstration.
Fair point, maybe they can be swapped? First show the general usage, and then the difference?
I still think naming it sql would make the elegance of the API show, but I trust your judgement.
35c7030 to
98bd239
Compare
98bd239 to
64c6328
Compare
|
Rebased for #60474. |
cjihrig
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RSLGTM
|
Landed in 1ce22dd |
PR-URL: #60200 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Cleaning up a few issues:
.reset()was never implemented, only.clear(). There's no need for both to exist; the easiest thing is just to remove the dead reference.The class definition block forStatementSyncwas sliced in half, messing with the doc tooling.