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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions components/Sidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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-hintComment">hintComment</a></li>
<li>– <a href="#Builder-truncate">truncate</a></li>
<li>– <a href="#Builder-pluck">pluck</a></li>
<li>– <a href="#Builder-first">first</a></li>
Expand Down
14 changes: 14 additions & 0 deletions sections/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -2439,6 +2439,20 @@ export default [
}
]
},
{
type: "method",
method: "hintComment",
example: ".hintComment(hint|hints)",
description: "Add hints to the query using comment-like syntax `/*+ ... */`. MySQL and Oracle use this syntax for optimizer hints. Also various DB proxies and routers use this syntax to pass hints to alter their behavior. In other dialects the hints are ignored as simple comments.",
children: [
{
type: "runnable",
content: `
knex('accounts').where('userid', '=', 1).hintComment('NO_ICP(accounts)')
`
}
]
},
{
type: "method",
method: "clone",
Expand Down