use std::sync::atomic::Ordering;
use crate::Engine;
impl Engine {
pub(crate) fn statement_timestamp_micros(&self) -> i64 {
match self
.session
.statement_started_at_micros
.load(Ordering::Relaxed)
{
0 => uqa_sql::expr::clock_timestamp_micros(),
micros => micros,
}
}
pub(crate) fn transaction_timestamp_micros(&self) -> i64 {
self.session.transactions.lock().first().map_or_else(
|| self.statement_timestamp_micros(),
|frame| frame.started_at_micros,
)
}
}