-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
extracted ExplainQueryMode to internal/connector, other query modes m…
…oved from xcontext to internal/table/conn
- Loading branch information
1 parent
3d61b65
commit 9f7962d
Showing
12 changed files
with
179 additions
and
213 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package connector | ||
|
||
import "context" | ||
|
||
type ctxExplainQueryModeKey struct{} | ||
|
||
func WithExplain(ctx context.Context) context.Context { | ||
return context.WithValue(ctx, ctxExplainQueryModeKey{}, true) | ||
} | ||
|
||
func isExplain(ctx context.Context) bool { | ||
v, has := ctx.Value(ctxExplainQueryModeKey{}).(bool) | ||
|
||
return has && v | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.