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
//! Database executors and connection management for Nautilus ORM.
//!
//! This crate provides the execution layer for Nautilus, enabling SQL queries
//! to be run against real databases. It defines the `Executor` trait and provides
//! concrete implementations for supported databases.
//!
//! ## Architecture
//!
//! - `Executor` trait: Abstract interface for query execution
//! - `Row`: Database result representation with hybrid access (positional + named)
//! - `PgExecutor`: PostgreSQL implementation using sqlx
//! - `MysqlExecutor`: MySQL implementation using sqlx
//! - `SqliteExecutor`: SQLite implementation using sqlx
//!
//! ## Example
//!
//! ```rust,ignore
//! use nautilus_connector::{execute_all, Executor, PgExecutor, ConnectorResult};
//! use nautilus_dialect::{Dialect, PostgresDialect};
//! use nautilus_core::select::SelectBuilder;
//!
//! #[tokio::main]
//! async fn main() -> ConnectorResult<()> {
//! // Create executor
//! let executor = PgExecutor::new("postgres://localhost/mydb").await?;
//! let dialect = PostgresDialect;
//!
//! // Build query
//! let select = SelectBuilder::new("users")
//! .columns(vec!["id", "name"])
//! .build()?;
//!
//! // Render and execute
//! let sql = dialect.render_select(&select)?;
//! let rows = execute_all(&executor, &sql).await?;
//!
//! // Access results
//! for row in rows {
//! let id = row.get("id");
//! let name = row.get("name");
//! println!("User: {:?}, {:?}", id, name);
//! }
//!
//! Ok(())
//! }
//! ```
/// Generate `execute_affected` for a pool-backed executor.
///
/// Each backend module defines its own `bind_value` function and exposes a
/// `self.pool` field. The method body is identical across all three backends
/// (Postgres, MySQL, SQLite), so this macro produces it from a single source.
pub use Client;
pub use ;
pub use ;
pub use FromRow;
pub use MysqlExecutor;
pub use MysqlRowStream;
pub use PgExecutor;
pub use PgRowStream;
pub use Row;
pub use RowStream;
pub use SqliteExecutor;
pub use SqliteRowStream;
pub use ;
// Re-export RowAccess from nautilus-core for convenience
pub use RowAccess;
// Re-export from nautilus_core for convenience
pub use Column;
pub use FromValue;