Skip to content

Commit efd2c32

Browse files
committed
context pointer in trace.Scripting
1 parent 0b45924 commit efd2c32

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

trace/scripting.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ type (
1717
OnExplain func(info ExplainQueryStartInfo) func(doneInfo ExplainQueryDoneInfo)
1818
}
1919
ExecuteStartInfo struct {
20-
Context context.Context
20+
// Context make available context in trace callback function.
21+
// Pointer to context provide replacement of context in trace callback function.
22+
// Warning: concurrent access to pointer on client side must be excluded.
23+
// Safe replacement of context are provided only inside callback function
24+
Context *context.Context
2125
Query string
2226
Parameters queryParameters
2327
}
@@ -26,7 +30,11 @@ type (
2630
Error error
2731
}
2832
StreamExecuteStartInfo struct {
29-
Context context.Context
33+
// Context make available context in trace callback function.
34+
// Pointer to context provide replacement of context in trace callback function.
35+
// Warning: concurrent access to pointer on client side must be excluded.
36+
// Safe replacement of context are provided only inside callback function
37+
Context *context.Context
3038
Query string
3139
Parameters queryParameters
3240
}

trace/scripting_gtrace.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)