Skip to content

Commit 38712e0

Browse files
committed
doc: clarify sqlite.db.query as profiling event
1 parent 9d5f126 commit 38712e0

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

doc/api/diagnostics_channel.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1928,12 +1928,20 @@ added: REPLACEME
19281928
instead.
19291929
* `database` {DatabaseSync} The [`DatabaseSync`][] instance that executed the
19301930
statement.
1931-
* `duration` {number} The estimated statement run time in nanoseconds.
1932-
1933-
Emitted when a SQL statement is executed against a [`DatabaseSync`][] instance.
1934-
This allows subscribers to observe every SQL statement executed without
1935-
modifying the database code itself. Tracing is zero-cost when there are no
1936-
subscribers.
1931+
* `duration` {number} SQLite's internal estimate of the statement run time in
1932+
nanoseconds. This reflects C-layer execution time only and does not include
1933+
JavaScript binding overhead such as argument marshaling or result-row
1934+
construction.
1935+
1936+
Emitted after a SQL statement finishes executing against a [`DatabaseSync`][]
1937+
instance. This is a **profiling** event: it fires once per statement upon
1938+
completion and reports an estimated duration from SQLite's internal profiler.
1939+
It is not a distributed-tracing span. There is no corresponding start event,
1940+
no async context propagation, and no parent-span linkage. If you need
1941+
OpenTelemetry-compatible spans or async context propagation, wrap your SQLite
1942+
calls with a [`TracingChannel`][] at the JavaScript layer instead.
1943+
1944+
Publishing is zero-overhead when there are no subscribers.
19371945

19381946
[BoundedChannel Channels]: #boundedchannel-channels
19391947
[TracingChannel Channels]: #tracingchannel-channels

0 commit comments

Comments
 (0)