Skip to main content

linkrs_query/parser/ast/
types.rs

1//! AST Basic Type Definitions
2//!
3//! This module defines types specific to the query AST (Abstract Syntax Tree), including tags, property references, clause structures, etc.
4//! At the same time, the type of the core module is re-exported for easier use.
5
6pub use linkrs_core::types::operators::AggregateFunction as CoreAggregateFunction;
7pub use linkrs_core::types::{EdgeDirection, OrderDirection};
8
9pub use linkrs_core::types::Span;
10
11pub type BinaryOp = linkrs_core::types::operators::BinaryOperator;
12pub type UnaryOp = linkrs_core::types::operators::UnaryOperator;
13pub type DataType = linkrs_core::types::DataType;
14pub type AggregateFunction = CoreAggregateFunction;
15
16#[derive(Debug, Clone, PartialEq)]
17pub struct LimitClause {
18    pub span: Span,
19    pub count: usize,
20}
21
22#[derive(Debug, Clone, PartialEq)]
23pub struct SkipClause {
24    pub span: Span,
25    pub count: usize,
26}
27
28#[derive(Debug, Clone, PartialEq)]
29pub struct SampleClause {
30    pub span: Span,
31    pub count: usize,
32    pub percentage: Option<f64>,
33}