surrealdb_sql/statements/
continue.rs

1use crate::ctx::Context;
2use crate::dbs::{Options, Transaction};
3use crate::doc::CursorDoc;
4use crate::err::Error;
5use crate::Value;
6use derive::Store;
7use revision::revisioned;
8use serde::{Deserialize, Serialize};
9use std::fmt;
10
11#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
12#[revisioned(revision = 1)]
13pub struct ContinueStatement;
14
15impl ContinueStatement {
16	/// Check if we require a writeable transaction
17	pub(crate) fn writeable(&self) -> bool {
18		false
19	}
20	/// Process this type returning a computed simple Value
21	pub(crate) async fn compute(
22		&self,
23		_ctx: &Context<'_>,
24		_opt: &Options,
25		_txn: &Transaction,
26		_doc: Option<&CursorDoc<'_>>,
27	) -> Result<Value, Error> {
28		Err(Error::Continue)
29	}
30}
31
32impl fmt::Display for ContinueStatement {
33	fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
34		f.write_str("CONTINUE")
35	}
36}