Skip to main content

selene_gql/
lib.rs

1//! ISO/IEC 39075:2024 GQL parser, AST, and Flagger for selene-db.
2//!
3//! See Spec 07 for the parser and Flagger design contract.
4
5#![forbid(unsafe_code)]
6#![deny(missing_docs)]
7
8pub mod analyze;
9pub mod ast;
10pub mod diagnostic;
11pub mod error;
12mod flagger;
13pub mod parser;
14pub mod plan;
15pub mod procedure_registry;
16pub mod runtime;
17mod temporal_parse;
18
19pub use crate::analyze::{
20    AnalysisError, AnalyzedStatement, AnalyzedStatementKind, AnalyzedType, BindingDecl,
21    BindingDeclKind, BindingId, BindingScope, BindingScopeTree, BindingUse, BindingUseKind,
22    ConditionClause, ElementKind, ExpectedType, ExprId, ExprIdLookup, ExprTypeTable,
23    InvalidLabelForm, MutationWriteSet, ScopeId, ScopeKind, Side, StatementCategory,
24    TypeMismatchContext, WriteKind, WriteSetEntry, analyze,
25};
26pub use crate::ast::{
27    call::{InlineProcedureCall, ProcedureCall, YieldColumn, YieldItem},
28    ddl::{
29        DdlStatement, DropBehavior, EdgeEndpointSpec, KeyLabelSet, TypePropertyConstraint,
30        TypePropertyDef, ValidationMode,
31    },
32    expr::{
33        BinaryOp, DecimalLiteralKind, ExistsBody, FloatLiteralKind, IntegerLiteralKind,
34        IsCheckKind, Literal, NormalForm, TemporalDurationQualifier, TrimSpec, TruthValue, UnaryOp,
35        ValueExpr,
36    },
37    format::format_procedure_call,
38    mutation::{
39        DeleteMode, DeleteStatement, InsertStatement, MutationPipeline, MutationStatement,
40        MutationTerminator, RemoveItem, SetItem,
41    },
42    pattern::{
43        EdgeDirection, EdgePattern, GraphPattern, LabelExpr, MatchClause, MatchMode, NodePattern,
44        PathMode, PathSelector, PatternElement, Quantifier,
45    },
46    span::SourceSpan,
47    statement::{
48        ForStatement, LetBinding, LimitValue, NullsPolicy, OrderDirection, OrderTerm,
49        PipelineStatement, QueryPipeline, ReturnClause, ReturnItem, RowExpansionPosition,
50        RowExpansionPositionKind, SessionResetTarget, SessionSetGraphTarget, SetOp, Statement,
51        WithClause,
52    },
53    types::{BindingTableType, GqlType, RecordType},
54    util::{EmptyVecError, NonEmpty, Vec2OrMore},
55};
56pub use crate::diagnostic::DiagnosticReport;
57pub use crate::error::{GqlStatus, ParserError};
58pub use crate::flagger::{FeatureUse, feature_walk};
59pub use crate::parser::{parse, parse_many, parse_with_source};
60pub use crate::plan::{
61    Aggregate, AggregateArg, BindingDef, BindingElement, BindingTableColumn, BindingTableSchema,
62    BuildSide, CatalogOp, CompositeIndexHandle, DeleteTargetPlan, EdgeMatch, EmptyIndexCatalog,
63    ExecutionPlan, FilterPredicate, FilterPredicateKind, HiddenBindingId, HopContributor,
64    ImplDefinedCaps, IndexCatalog, IndexHandle, IndexKey, IndexKind, IndexTarget,
65    InsertEndpointRef, InsertSiteId, JoinTree, LimitAmount, LiveIndexCatalog, MutationOp,
66    NodeIdOrdering, NodeOrEdgeScan, OptimizeContext, OrderAccess, OrderKey, OuterBindingRef,
67    PathContributor, PathPlan, PatternPlan, PipelineOp, PipelineOpId, PlannedCall, PlannedSubquery,
68    PlannedTableSubquery, PlannedTableSubqueryYield, PlannedTypePropertyConstraint,
69    PlannedTypePropertyDef, PlannedYieldItem, PlannerError, ProjectExpr, PropertyInit,
70    RepeatEdgeMatch, Rule, ScanAccess, ScanKind, SessionOp, SubqueryBody, SubqueryKind,
71    SubqueryRegistry, TailBinding, Transformed, TxOp, TypedIndexBounds, TypedIndexLookup,
72    YieldKind, optimize, plan,
73};
74pub use crate::procedure_registry::{
75    EmptyProcedureRegistry, ProcedureArity, ProcedureDefaultValue, ProcedureError, ProcedureHandle,
76    ProcedureMetadata, ProcedureMutability, ProcedureOutputColumn, ProcedureOutputSchema,
77    ProcedureParameter, ProcedureRegistry, ProcedureResult, ProcedureSignature, ProcedureTier,
78    Value,
79};
80pub use crate::runtime::{
81    AdaptiveOptimizer, Binding, BindingTable, BindingTableRegistry, BuiltinProcedureRegistry,
82    CallPlanCache, CallPlanCacheStats, CallPlanKey, DataExceptionSubclass, ExecutorError,
83    ExecutorWarning, GraphContext, MaintenanceContext, MutationContext, PlanCache, PlanCacheStats,
84    ProcedureContext, RollbackOutcome, Session, SessionParameterValue, SharedPlanCache,
85    SharedPlanCacheStats, StatementOutput, TransactionOutcome, TxContext, WarningSink,
86    WriteOutcome, execute_pattern, execute_pipeline, execute_statement,
87};
88pub use selene_core::{CancellationCause, CancellationChecker, CancellationToken, NodeScanBudget};
89
90#[cfg(any(test, feature = "test-harness"))]
91pub use crate::runtime::{
92    ExecutorSnapshot, ExecutorSummaryInput, NetGraphDelta, RowOrderPolicy, SnapshotColumn,
93    executor_summary,
94};