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

Document optimizer hints #306

Merged
merged 4 commits into from
Jan 28, 2021

Conversation

martinmacko47
Copy link
Contributor

Documents knex/knex#4199 and PR knex/knex#4243

@@ -138,6 +138,7 @@ export default class Sidebar extends Component {
<li>– <a href="#Builder-avg">avg</a></li>
<li>– <a href="#Builder-increment">increment</a></li>
<li>– <a href="#Builder-decrement">decrement</a></li>
<li>– <a href="#Builder-optimizerHint">optimizerHint</a></li>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about the order where to put the method

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the place is fine.

{
type: "runnable",
content: `
knex('accounts').where('userid', '=', 1).optimizerHint('hint()')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

runnable won't work before the change is released, as the scipt cant compile the query on the current knex version

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use a real hint in the example?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kibertoad Added real MySQL hint example 7bc4df5

{
type: "method",
method: "optimizerHint",
example: ".optimizerHint(hint)",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have a convention how to denote that hint may be either a single value or an array of values?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like this:
.whereIn(column|columns, array|callback|builder)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kibertoad Ok. Used hint|hints c12ab97

@kibertoad kibertoad merged commit 801f3a7 into knex:gh-pages Jan 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants