surrealdb-expr 4.0.0

A scalable, distributed, collaborative, document-graph database, for the realtime web
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use common::fmt::SqlDuration;
use surrealdb_types::{SqlFormat, ToSql, write_sql};

use crate::val::Duration;

#[derive(Clone, Copy, Debug, Default, Eq, PartialEq, Hash)]
pub struct SleepStatement {
	pub duration: Duration,
}

impl ToSql for SleepStatement {
	fn fmt_sql(&self, f: &mut String, sql_fmt: SqlFormat) {
		write_sql!(f, sql_fmt, "SLEEP {}", SqlDuration(self.duration.0));
	}
}