Skip to main content

spiral/
lib.rs

1//! Rust clients for Spiral resources and immutable table data.
2//!
3//! Resource clients and wire types are generated from service contracts. Table data
4//! runs through scandal and does not initialize the query engine.
5
6mod address;
7pub mod api;
8mod application;
9#[cfg(feature = "tables")]
10mod arrow_input;
11/// Credentials: bearer tokens, the providers that obtain them, and default discovery.
12pub use spiral_auth as auth;
13#[cfg(feature = "tables")]
14mod blob;
15/// Validated catalog identifiers and publication helpers.
16pub mod catalog_types;
17#[cfg(feature = "tables")]
18mod changes;
19mod client;
20#[cfg(feature = "tables")]
21mod column_write;
22mod commit;
23pub mod config;
24mod connections;
25#[cfg(feature = "tables")]
26mod diagnostics;
27#[cfg(test)]
28#[cfg(feature = "tables")]
29mod edit_flow_tests;
30#[cfg(feature = "tables")]
31mod enrichment;
32mod error;
33#[cfg(feature = "tables")]
34mod functions;
35pub mod http;
36pub mod ids;
37#[cfg(feature = "tables")]
38mod ipc;
39#[cfg(feature = "tables")]
40mod local;
41mod location;
42#[cfg(feature = "tables")]
43mod merge;
44mod namespace;
45#[cfg(feature = "embedded")]
46mod native;
47mod pagination;
48mod project;
49#[cfg(feature = "tables")]
50mod registration;
51#[cfg(feature = "tables")]
52mod remote_scandal;
53#[cfg(feature = "tables")]
54mod scan;
55/// ScanDAL contracts and wire helpers used by the SDK's execution adapters.
56#[cfg(feature = "tables")]
57pub mod scandal;
58#[cfg(feature = "tables")]
59mod scandal_backend;
60#[cfg(feature = "tables")]
61mod table;
62#[cfg(feature = "tables")]
63mod table_edit;
64#[cfg(feature = "tables")]
65mod table_session;
66#[cfg(feature = "tables")]
67mod table_write;
68mod task_handle;
69/// The SPQL type registry's types as Arrow extension fields.
70#[cfg(feature = "tables")]
71pub mod types;
72#[cfg(feature = "tables")]
73mod uri_resolver;
74mod vector_index;
75mod workload;
76
77/// Authenticated resource facades and SDK-owned contract types.
78pub mod resources {
79    pub mod applications;
80    pub mod arbor;
81    pub mod catalog;
82    pub mod connection;
83    mod generated;
84    pub mod location;
85    pub mod organization;
86    pub mod project;
87    pub mod task;
88    pub mod vector_index;
89    pub mod workload;
90    pub use crate::api::catalog as catalog_contract;
91    pub use crate::api::catalog::objects as catalog_error;
92    pub use crate::api::locations::objects as location_types;
93    pub use crate::api::storage::objects as filesystem_types;
94    pub use crate::api::tables::{objects as arbor_error, objects as arbor_types};
95    pub use crate::api::tasks::objects as task_types;
96    pub use crate::api::vector_indexes::objects as vector_index_types;
97    pub use crate::catalog_types;
98}
99
100pub use address::{ResourceAddress, ResourceRef};
101pub use application::{
102    Application, ApplicationInstallation, ApplicationRegistration, Installation,
103    InstallationRegistration, UserInstallation,
104};
105#[cfg(feature = "tables")]
106pub use arrow_input::{IntoArrowStream, SortColumn, WriteInput, WriteLayout, WriteProperties};
107#[cfg(feature = "tables")]
108pub use blob::{Blob, BlobPack, BlobPart, BlobStat, BlobStream, BlobUpload};
109#[cfg(feature = "tables")]
110pub use changes::{
111    CHANGE_KIND_COLUMN, ChangeImages, ChangeKind, ChangeOptions, ChangePlan, FragmentChange,
112    FragmentDelta, TableCommitChanges,
113};
114pub use client::{Client, ClientBuilder};
115#[cfg(feature = "tables")]
116pub use column_write::ColumnWrite;
117pub use commit::{Commit, FrozenCommit, PublishError, SavedCommit};
118pub use config::{Config, ConfigBuilder};
119pub use connections::NamedConnection;
120#[cfg(feature = "tables")]
121pub use diagnostics::ExecutionDiagnostics;
122#[cfg(feature = "tables")]
123pub use enrichment::{
124    ENRICHMENT_VALUE_COLUMN, Enrichment, EnrichmentDefinition, enrichment_coverage, mirror_state,
125    mirrored_version,
126};
127pub use error::Error;
128#[cfg(feature = "tables")]
129pub use functions::Functions;
130#[cfg(feature = "tables")]
131pub use local::LocalTableWrite;
132pub use location::Location;
133#[cfg(feature = "tables")]
134pub use merge::{BySource, Matched, MergeActions, MergedRows, NotMatched};
135#[cfg(feature = "embedded")]
136pub use native::{NativeReadCache, NativeScandal};
137pub use pagination::{List, ListStream, Page};
138pub use project::{BranchHead, Project, Snapshot};
139#[cfg(feature = "tables")]
140pub use remote_scandal::RemoteScandal;
141pub use resources::organization::Organization;
142#[cfg(feature = "tables")]
143pub use scan::{
144    BatchStream, ColumnStatistics, FilterSupport, Scan, ScanMetrics, ScanMetricsSnapshot,
145    ScanOptions, ScanRowRange, ScanSplit, ScanStatistics, ScanStream, SplitFilter, StorageCounters,
146    StorageScope, TableSplit, Take, WindowCounters, WorkBatch, WorkItem, WorkStream,
147};
148#[cfg(feature = "tables")]
149pub use scandal::plan::{PlanDecision, PlanDescription, PlanNode};
150#[cfg(feature = "tables")]
151pub use scandal::profile::{ExecutionOptions, ExecutionProfile, NodeProfile};
152pub use spiral_contract::auth::AuthHeader;
153pub use spiral_contract::call::{CallError, ServiceFailure};
154#[cfg(feature = "tables")]
155pub use table::{DeletedRows, Table, TableIdentity};
156#[cfg(feature = "tables")]
157pub use table_edit::{ColumnPath, SchemaChange, UpdatedRows};
158#[cfg(feature = "tables")]
159pub use table_session::TableSession;
160#[cfg(feature = "tables")]
161pub use table_write::{ROW_ID_COLUMN, TableWrite};
162pub use task_handle::{Run, TaskHandle};
163#[cfg(feature = "tables")]
164pub use uri_resolver::ResourceUriResolver;
165pub use vector_index::{VectorIndex, VectorIndexMetric, VectorIndexOptions};
166#[cfg(feature = "tables")]
167pub use vector_index::{VectorSearch, VectorSearchOptions};
168pub use workload::Workload;
169#[cfg(feature = "tables")]
170pub use {arrow_array, arrow_ipc, arrow_schema};
171
172/// Top-k and aggregate emits, which a scan returns in place of its rows.
173#[cfg(feature = "tables")]
174pub use crate::scandal::emit;
175#[cfg(feature = "tables")]
176pub use crate::scandal::expression::{Expression, NamedExpression, case_when, spql_call};
177#[cfg(feature = "tables")]
178pub use crate::scandal::functions::{
179    FunctionAlias, FunctionInfo, FunctionVolatility, OverloadInfo, ParameterInfo,
180};
181#[cfg(feature = "tables")]
182pub use crate::scandal::read_cache::{ReadCacheOptions, ReadCacheStats};
183#[cfg(feature = "tables")]
184pub use crate::scandal::types::PreparedWriteReceipt;
185#[cfg(feature = "tables")]
186pub use crate::scandal::vortex;
187#[cfg(feature = "tables")]
188pub use crate::scandal::{Scandal, ScandalConfig};
189
190#[cfg(feature = "tables")]
191mod storage_binding;