aboutsummaryrefslogtreecommitdiff
path: root/tracecallback_noimpl.go
diff options
context:
space:
mode:
authorYasuhiro Matsumoto <mattn.jp@gmail.com>2017-01-11 01:29:59 +0900
committerYasuhiro Matsumoto <mattn.jp@gmail.com>2017-01-11 01:29:59 +0900
commiteff6379ba09b2fca7aa8216f2132d4c170ed9d46 (patch)
tree72a03c17e69d1d7671bc6f131b0414128fc33949 /tracecallback_noimpl.go
parentdummy constants (diff)
downloadgolite-eff6379ba09b2fca7aa8216f2132d4c170ed9d46.tar.gz
golite-eff6379ba09b2fca7aa8216f2132d4c170ed9d46.tar.xz
fix notrace
Diffstat (limited to 'tracecallback_noimpl.go')
-rw-r--r--tracecallback_noimpl.go34
1 files changed, 34 insertions, 0 deletions
diff --git a/tracecallback_noimpl.go b/tracecallback_noimpl.go
index 09b55d0..5db43a5 100644
--- a/tracecallback_noimpl.go
+++ b/tracecallback_noimpl.go
@@ -13,6 +13,40 @@ const (
TraceClose = uint32(0x08)
)
+type TraceInfo struct {
+ // Pack together the shorter fields, to keep the struct smaller.
+ // On a 64-bit machine there would be padding
+ // between EventCode and ConnHandle; having AutoCommit here is "free":
+ EventCode uint32
+ AutoCommit bool
+ ConnHandle uintptr
+
+ // Usually filled, unless EventCode = TraceClose = SQLITE_TRACE_CLOSE:
+ // identifier for a prepared statement:
+ StmtHandle uintptr
+
+ // Two strings filled when EventCode = TraceStmt = SQLITE_TRACE_STMT:
+ // (1) either the unexpanded SQL text of the prepared statement, or
+ // an SQL comment that indicates the invocation of a trigger;
+ // (2) expanded SQL, if requested and if (1) is not an SQL comment.
+ StmtOrTrigger string
+ ExpandedSQL string // only if requested (TraceConfig.WantExpandedSQL = true)
+
+ // filled when EventCode = TraceProfile = SQLITE_TRACE_PROFILE:
+ // estimated number of nanoseconds that the prepared statement took to run:
+ RunTimeNanosec int64
+
+ DBError Error
+}
+
+type TraceUserCallback func(TraceInfo) int
+
+type TraceConfig struct {
+ Callback TraceUserCallback
+ EventMask uint
+ WantExpandedSQL bool
+}
+
// RegisterAggregator register the aggregator.
func (c *SQLiteConn) RegisterAggregator(name string, impl interface{}, pure bool) error {
return errors.New("This feature is not implemented")