1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
//! A lightweight gRPC client for [ArcadeDB](https://arcadedb.com).
//!
//! Generated tonic stubs for `com.arcadedb.grpc`, a typed record-decode path
//! (`RecordDecode` derive + runtime), a `serde_json` bridge for dynamic
//! access, and nothing else.
//!
//! ## What's here
//!
//! - [`client::ArcadeDbClient`] — wraps the data + admin gRPC services
//! (connect with retry, auth headers, `execute`/`query`/`create_database`/
//! `bulk_insert`, …). `Clone` (shares one tonic `Channel`).
//! - [`error::ArcadeDbError`] — the typed error for every fallible client
//! call: match on the failure category (transport, server-rejected command,
//! decode, invalid input) and inspect the gRPC code/metadata.
//! - JSON bridge ([`grpc_record_to_json`]):
//! `GrpcRecord` → `serde_json::Value` for callers that need dynamic
//! access. The *typed* decode path is
//! [`RecordDecode`] (see below) — there is no serde `Deserializer` anymore.
//! - [`record`] — the typed-decode runtime: [`record::FromGrpcValue`],
//! [`record::RecordDecodeError`], and the property-access helpers used by the
//! generated code.
//! - [`RecordDecode`] (re-exported derive) — `#[derive(RecordDecode)]` turns a
//! model struct into [`TryFrom<&GrpcRecord>`]` + `FromGrpcValue` with
//! per-field type coercion, honoring `#[serde(rename/default/flatten)]` for
//! drop-in adoption. Custom types plug in via the `#[record(with = "...")]`
//! attribute or by implementing `FromGrpcValue` directly.
//! - [`RecordEncode`] (re-exported derive) — the write-side mirror: derives
//! [`record::ToGrpcRecord`] so bulk writers call `dto.to_grpc_record(class)`
//! instead of hand-assembling `GrpcValue`/`GrpcRecord` protos.
//! - Value builders ([`Params`], [`IntoGrpcValue`]) for fixture/test code.
//!
//! ## Optional features
//!
//! - `ahash` — aHash maps as first-class wire maps:
//! `ahash::AHashMap<String, V>` binds as the wire `Map` (encode) and
//! decodes back into an `AHashMap` (decode), so a DTO field or a
//! `params!` value can be an aHash map with no std↔aHash conversion.
//! - `cache` — transient KV facade over the Redis plugin (`client.cache()`).
//! - `decimal` — exact `rust_decimal::Decimal` mapping for `DECIMAL` columns.
//! - `fxhash` — rustc's FxHash maps as first-class wire maps
//! (`rustc_hash::FxHashMap<String, V>`), same as the `ahash` feature.
//! - `rayon` — parallel decode of large batches.
//! - `serde` — serde impls for wire-identity types (`Link` ↔ rid string).
//!
//! ## What's NOT here
//!
//! Identity types and query/repository layers. ArcadeDB's native RID
//! (`#bucket:pos`) is the only identifier this crate deals with; apps choose
//! their own logical identity scheme (e.g. `table:key` or an external id)
//! and build their repo + query functions on top of [`ArcadeDbClient`].
//!
//! ```no_run
//! # async fn demo() -> arcadedb_protocol::Result<()> {
//! use arcadedb_protocol::ArcadeDbClient;
//! let client = ArcadeDbClient::connect("127.0.0.1:50051", "root", "password", "mydb").await?;
//! let res = client.query("mydb", "SELECT FROM item LIMIT 10").await?;
//! println!("{} rows in {} ms", res.len(), res.execution_time_ms);
//! # Ok(()) }
//! ```
// ---------------------------------------------------------------------------
// Generated proto types (package `com.arcadedb.grpc`)
// ---------------------------------------------------------------------------
// Domain facades: capability groups off the root client. The canonical
// spelling is the module path; the `ArcadeDbClient::admin`/`scan`/`batch`
// accessors are discovery sugar over the same implementations.
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use FilterClause;
pub use ClientOptions;
pub use StreamOptions;
/// Value constructors for generated code (`RecordEncode` derives) — NOT a
/// public API. The fns stay `pub` in `encode` (macro codegen must name
/// them cross-crate) but are re-exported ONLY here, doc-hidden: the public
/// binding surface is `params!` / `rec()` / `SetClause` / `IntoGrpcValue`,
/// where the Rust types disambiguate the wire kinds.
pub use ;
/// The protobuf well-known `Timestamp` — the wire shape for date/datetime
/// values (`Kind::TimestampValue`), re-exported for `RecordEncode` DTOs.
pub use Timestamp;
pub use GrpcRecord;
pub use ;
// And the grpc_value::Kind enum, for assembling list/map parameter values.
pub use Kind;
pub use ;
/// The `ahash` crate, re-exported for the `ahash` feature — so callers can
/// name the map type the crate's conversions accept
/// (`arcadedb_protocol::ahash::AHashMap`) without pinning their own
/// `ahash` version.
pub use ahash;
/// The `rustc-hash` crate, re-exported for the `fxhash` feature — so
/// callers can name `arcadedb_protocol::rustc_hash::FxHashMap` without
/// pinning their own `rustc-hash` version.
pub use rustc_hash;
/// Implement [`DecodeFromMap`](record::DecodeFromMap) for a manual
/// [`FromGrpcValue`](record::FromGrpcValue) type through the clone-based
/// [`from_map_via_value`](record::from_map_via_value) path — for manual types
/// used as `#[serde(flatten)]` targets. Prefer deriving `RecordDecode` on
/// flatten targets (zero-copy).
// Re-export proto service handles + types that downstream query code commonly
// needs when building typed wrappers around the client.
pub use ;