Skip to main content

surrealdb_sql/
limit.rs

1use surrealdb_types::{SqlFormat, ToSql, write_sql};
2
3use crate::{CoverStmts, Expr};
4
5#[derive(Clone, Debug, PartialEq, Eq)]
6#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
7pub struct Limit(pub Expr);
8
9impl ToSql for Limit {
10	fn fmt_sql(&self, f: &mut String, fmt: SqlFormat) {
11		write_sql!(f, fmt, "LIMIT {}", CoverStmts(&self.0))
12	}
13}