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
//! Real SQLite inside an Octra Circle.
//!
//! `octra-sqlite` provides a small Rust client for querying and writing to a
//! SQLite database whose engine runs inside an Octra `wasm_v1` Circle. The
//! crate keeps the first story deliberately small: create a [`Client`], open a
//! [`Database`], then run SQL.
//!
//! ```no_run
//! use octra_sqlite::{Client, Result};
//!
//! fn main() -> Result<()> {
//! let client = Client::from_default_config()?;
//! let db = client.database("art")?;
//! let rows = db.query("select * from artist order by name;")?;
//! println!("{} rows", rows.row_count);
//! Ok(())
//! }
//! ```
//!
//! A public-read database can be queried without local wallet setup:
//!
//! ```no_run
//! use octra_sqlite::{Client, Result};
//!
//! fn main() -> Result<()> {
//! let client = Client::default();
//! let db = client.database(
//! "oct://devnet/octQfYK2fE9RvR9kfj8FJfMBQw1e4EzfHB8Q5Z9J2DCnRBQ?read_mode=public",
//! )?;
//! let rows = db.query("select id, name from artist order by id;")?;
//! println!("{} rows", rows.row_count);
//! Ok(())
//! }
//! ```
//!
//! Sealed databases use signed Octra view auth for reads. Public-read
//! databases use unsigned Octra Circle views for SQL reads while keeping writes
//! owner-signed through OSW1 owner write intent. Pass a saved database name or a
//! full `oct://NETWORK/<circle>?read_mode=public` URI to [`Client::database`].
//!
//! Feature flags:
//!
//! - `cli`: build the `octra-sqlite` command line interface.
//! - `http`: include the default blocking HTTP RPC transport.
//! - `wasm-behavior`: enable host-harness tests for the bundled Circle WASM.
//!
//! The CLI JSON envelopes and OSR1/OSW1 wire formats are treated as public
//! surfaces. The Rust API is still `0.x`; breaking Rust API cleanup happens in
//! minor versions.
pub use ;
pub use ReadMode;
pub use Value;