mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-24 18:34:34 +01:00
feat: support keyword rowid
This commit is contained in:
@@ -194,6 +194,9 @@ impl CreateTableBody {
|
||||
{
|
||||
let mut generated_count = 0;
|
||||
for c in columns.values() {
|
||||
if c.col_name == "rowid" {
|
||||
return Err(custom_err!("cannot use reserved word: ROWID"));
|
||||
}
|
||||
for cs in &c.constraints {
|
||||
if let ColumnConstraint::Generated { .. } = cs.constraint {
|
||||
generated_count += 1;
|
||||
|
||||
@@ -728,6 +728,7 @@ impl ToTokens for Expr {
|
||||
}
|
||||
s.append(TK_RP, None)
|
||||
}
|
||||
Self::RowId { .. } => Ok(()),
|
||||
Self::Subquery(query) => {
|
||||
s.append(TK_LP, None)?;
|
||||
query.to_tokens(s)?;
|
||||
|
||||
@@ -338,6 +338,13 @@ pub enum Expr {
|
||||
/// is the column a rowid alias
|
||||
is_rowid_alias: bool,
|
||||
},
|
||||
/// `ROWID`
|
||||
RowId {
|
||||
/// the x in `x.y.z`. index of the db in catalog.
|
||||
database: Option<usize>,
|
||||
/// the y in `x.y.z`. index of the table in catalog.
|
||||
table: usize,
|
||||
},
|
||||
/// `IN`
|
||||
InList {
|
||||
/// expression
|
||||
|
||||
Reference in New Issue
Block a user