mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-08 18:54:21 +01:00
boxed limit (by ignatz)
This commit is contained in:
@@ -172,7 +172,7 @@ pub enum Stmt {
|
||||
/// `ORDER BY`
|
||||
order_by: Option<Vec<SortedColumn>>,
|
||||
/// `LIMIT`
|
||||
limit: Option<Limit>,
|
||||
limit: Option<Box<Limit>>,
|
||||
},
|
||||
/// `DETACH DATABASE`: db name
|
||||
Detach(Expr), // TODO distinction between DETACH and DETACH DATABASE
|
||||
@@ -260,7 +260,7 @@ pub enum Stmt {
|
||||
/// `ORDER BY`
|
||||
order_by: Option<Vec<SortedColumn>>,
|
||||
/// `LIMIT`
|
||||
limit: Option<Limit>,
|
||||
limit: Option<Box<Limit>>,
|
||||
},
|
||||
/// `VACUUM`: database name, into expr
|
||||
Vacuum(Option<Name>, Option<Expr>),
|
||||
@@ -700,7 +700,7 @@ pub struct Select {
|
||||
/// `ORDER BY`
|
||||
pub order_by: Option<Vec<SortedColumn>>, // ORDER BY term does not match any column in the result set
|
||||
/// `LIMIT`
|
||||
pub limit: Option<Limit>,
|
||||
pub limit: Option<Box<Limit>>,
|
||||
}
|
||||
|
||||
/// `SELECT` body
|
||||
@@ -740,7 +740,7 @@ pub struct CompoundSelect {
|
||||
/// operator
|
||||
pub operator: CompoundOperator,
|
||||
/// select
|
||||
pub select: OneSelect,
|
||||
pub select: Box<OneSelect>,
|
||||
}
|
||||
|
||||
/// Compound operators
|
||||
@@ -1265,10 +1265,10 @@ impl ColumnDefinition {
|
||||
let mut split = col_type.name.split_ascii_whitespace();
|
||||
let truncate = if split
|
||||
.next_back()
|
||||
.map_or(false, |s| s.eq_ignore_ascii_case("ALWAYS"))
|
||||
.is_some_and(|s| s.eq_ignore_ascii_case("ALWAYS"))
|
||||
&& split
|
||||
.next_back()
|
||||
.map_or(false, |s| s.eq_ignore_ascii_case("GENERATED"))
|
||||
.is_some_and(|s| s.eq_ignore_ascii_case("GENERATED"))
|
||||
{
|
||||
let mut generated = false;
|
||||
for constraint in &cd.constraints {
|
||||
|
||||
@@ -737,7 +737,7 @@ groupby_opt(A) ::= GROUP BY nexprlist(X) having_opt(Y). {A = Some(GroupBy{ exprs
|
||||
having_opt(A) ::= . {A = None;}
|
||||
having_opt(A) ::= HAVING expr(X). {A = Some(X);}
|
||||
|
||||
%type limit_opt {Option<Limit>}
|
||||
%type limit_opt {Option<Box<Limit>>}
|
||||
|
||||
// The destructor for limit_opt will never fire in the current grammar.
|
||||
// The limit_opt non-terminal only occurs at the end of a single production
|
||||
@@ -749,11 +749,11 @@ having_opt(A) ::= HAVING expr(X). {A = Some(X);}
|
||||
//%destructor limit_opt {sqlite3ExprDelete(pParse->db, $$);}
|
||||
limit_opt(A) ::= . {A = None;}
|
||||
limit_opt(A) ::= LIMIT expr(X).
|
||||
{A = Some(Limit{ expr: X, offset: None });}
|
||||
{A = Some(Box::new(Limit{ expr: X, offset: None }));}
|
||||
limit_opt(A) ::= LIMIT expr(X) OFFSET expr(Y).
|
||||
{A = Some(Limit{ expr: X, offset: Some(Y) });}
|
||||
{A = Some(Box::new(Limit{ expr: X, offset: Some(Y) }));}
|
||||
limit_opt(A) ::= LIMIT expr(X) COMMA expr(Y).
|
||||
{A = Some(Limit{ expr: X, offset: Some(Y) });}
|
||||
{A = Some(Box::new(Limit{ expr: X, offset: Some(Y) }));}
|
||||
|
||||
/////////////////////////// The DELETE statement /////////////////////////////
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user