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
//! FFI-friendly API for language bindings (Python, Java, Node.js, .NET).
//!
//! This module provides a stable, thread-safe API surface with:
//!
//! - **Numeric error codes** for cross-language error handling
//! - **Arrow RecordBatch** at all data boundaries (zero-copy via C Data Interface)
//! - **Explicit resource management** (`close()` methods return `Result`)
//! - **Thread safety guarantees** (all types are `Send + Sync`)
//!
//! # Quick Start
//!
//! ```rust,ignore
//! use laminar_db::api::{Connection, ApiError};
//!
//! // Open database
//! let conn = Connection::open()?;
//!
//! // Create a source
//! conn.execute("CREATE SOURCE trades (
//! symbol VARCHAR,
//! price DOUBLE,
//! ts BIGINT
//! )")?;
//!
//! // Insert data
//! conn.execute("INSERT INTO trades VALUES ('AAPL', 150.0, 1234567890)")?;
//!
//! // Query
//! let result = conn.query("SELECT * FROM trades")?;
//! println!("Got {} rows", result.num_rows());
//!
//! // Explicit cleanup
//! conn.close()?;
//! ```
//!
//! # Error Handling
//!
//! All errors include numeric codes suitable for FFI:
//!
//! ```rust,ignore
//! match conn.get_schema("missing") {
//! Ok(schema) => { /* use schema */ }
//! Err(e) => {
//! println!("Error code: {}", e.code());
//! println!("Message: {}", e.message());
//! }
//! }
//! ```
//!
//! See [`codes`](crate::api::codes) for the full list of error codes.
//!
//! # Thread Safety
//!
//! All types in this module are `Send + Sync`:
//!
//! ```rust,ignore
//! let conn = Arc::new(Connection::open()?);
//!
//! // Safe to share across threads
//! let handle = std::thread::spawn({
//! let conn = Arc::clone(&conn);
//! move || conn.list_sources()
//! });
//! ```
//!
//! # Arrow C Data Interface
//!
//! The `RecordBatch` type supports zero-copy export via Arrow's C Data Interface.
//! Language bindings can use this for efficient data exchange:
//!
//! - Python: `pyarrow.RecordBatch._import_from_c()`
//! - Java: Arrow Java C Data Interface
//! - Node.js: `apache-arrow` npm package
//! - .NET: `Apache.Arrow` NuGet package
pub use crateDdlInfo;
pub use ;
pub use ;
pub use Writer;
pub use ;
pub use ArrowSubscription;
// Re-export LaminarConfig for open_with_config
pub use crateLaminarConfig;
// Re-export catalog, pipeline, and metrics types for language bindings
pub use crate::;
pub use crate::;