nodedb_sql/parser/array_stmt/
ast.rs1use crate::types_array::{
6 ArrayAttrAst, ArrayCellOrderAst, ArrayCoordLiteral, ArrayDimAst, ArrayInsertRow,
7 ArrayTileOrderAst,
8};
9
10#[derive(Debug, Clone, PartialEq)]
12pub enum ArrayStatement {
13 Create(CreateArrayAst),
14 Drop(DropArrayAst),
15 Insert(InsertArrayAst),
16 Delete(DeleteArrayAst),
17 Alter(AlterArrayAst),
18}
19
20#[derive(Debug, Clone, PartialEq)]
26pub struct AlterArrayAst {
27 pub name: String,
28 pub set: Vec<(String, Option<i64>)>,
31}
32
33#[derive(Debug, Clone, PartialEq)]
34pub struct CreateArrayAst {
35 pub name: String,
36 pub dims: Vec<ArrayDimAst>,
37 pub attrs: Vec<ArrayAttrAst>,
38 pub tile_extents: Vec<i64>,
39 pub cell_order: ArrayCellOrderAst,
40 pub tile_order: ArrayTileOrderAst,
41 pub prefix_bits: u8,
44 pub audit_retain_ms: Option<u64>,
48 pub minimum_audit_retain_ms: Option<u64>,
52}
53
54#[derive(Debug, Clone, PartialEq)]
55pub struct DropArrayAst {
56 pub name: String,
57 pub if_exists: bool,
58}
59
60#[derive(Debug, Clone, PartialEq)]
61pub struct InsertArrayAst {
62 pub name: String,
63 pub rows: Vec<ArrayInsertRow>,
64}
65
66#[derive(Debug, Clone, PartialEq)]
67pub struct DeleteArrayAst {
68 pub name: String,
69 pub coords: Vec<Vec<ArrayCoordLiteral>>,
70}