活动:'sqlite.db.query'
🌐 Event: 'sqlite.db.query'
sql<string> 展开的 SQL,已替换绑定的参数值。如果展开失败,则使用未替换占位符的原始 SQL。databaseDatabase 执行该语句的Database实例。duration<number> SQLite 对语句运行时间的内部估算,单位为纳秒。这只反映 C 层的执行时间,不包括 JavaScript 绑定的额外开销,比如参数传递或结果行构建。
在对 Database 实例执行 SQL 语句完成后触发。这是一个分析事件:每条语句完成后触发一次,并报告 SQLite 内部分析器的估计耗时。它不是分布式追踪的跨度(span)。没有对应的开始事件,也没有异步上下文传播,更没有父跨度关联。如果你需要兼容 OpenTelemetry 的跨度或异步上下文传播,可以在 JavaScript 层使用 TracingChannel 封装你的 SQLite 调用。
🌐 Emitted after a SQL statement finishes executing against a Database
instance. This is a profiling event: it fires once per statement upon
completion and reports an estimated duration from SQLite's internal profiler.
It is not a distributed-tracing span. There is no corresponding start event,
no async context propagation, and no parent-span linkage. If you need
OpenTelemetry-compatible spans or async context propagation, wrap your SQLite
calls with a TracingChannel at the JavaScript layer instead.
当没有订阅者时,发布完全不会有额外开销。
🌐 Publishing is zero-overhead when there are no subscribers.
对于在迭代中途被放弃、后来被最终处理的语句(无论是通过 statement.close() 显式处理,还是语句被垃圾回收时),不会发出任何事件。订阅者不能关闭数据库或语句,因为在事件传递期间它们仍在使用;参见 database.close() 和 statement.close()。
🌐 No event is emitted for a statement that is abandoned mid-iteration and later
finalized, either explicitly through statement.close() or when the
statement is garbage collected. Subscribers must not close the database or the
statement, since both are still in use while the event is being delivered; see
database.close() and statement.close().