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
//! Protocol integration layer
//!
//! This module provides the infrastructure for integrating multiple database
//! protocols (PostgreSQL, MySQL, etc.) with HeliosDB Lite's storage and query
//! execution engines.
//!
//! # Architecture Overview
//!
//! The protocol integration follows a layered architecture:
//!
//! ```text
//! ┌─────────────────────────────────────────────────────────┐
//! │ Protocol Handlers │
//! │ (PostgreSQL, MySQL, HTTP/REST - Future) │
//! └─────────────────────────────────────────────────────────┘
//! │
//! ↓
//! ┌─────────────────────────────────────────────────────────┐
//! │ Adapter Layer (Phase 1) │
//! │ - StorageAdapter: Bridge to RocksDB engine │
//! │ - QueryExecutorAdapter: Bridge to SQL executor │
//! │ - PubSubAdapter: LISTEN/NOTIFY implementation │
//! │ - ConnectionPool: Connection management │
//! └─────────────────────────────────────────────────────────┘
//! │
//! ↓
//! ┌─────────────────────────────────────────────────────────┐
//! │ HeliosDB Lite Core │
//! │ - StorageEngine (RocksDB) │
//! │ - SQL Executor │
//! │ - Vector Search │
//! │ - Encryption & Compression │
//! └─────────────────────────────────────────────────────────┘
//! ```
//!
//! # Implementation Phases
//!
//! ## Phase 1: Adapter Layer (Current)
//!
//! - StorageAdapter trait and implementation
//! - QueryExecutorAdapter trait and implementation
//! - PubSubAdapter for LISTEN/NOTIFY
//! - ConnectionPool for connection management
//!
//! ## Phase 2: PostgreSQL Protocol (Future)
//!
//! - Wire protocol implementation
//! - Authentication (MD5, SCRAM-SHA-256)
//! - Extended query protocol
//! - COPY protocol
//! - Streaming replication
//!
//! ## Phase 3: Additional Protocols (Future)
//!
//! - MySQL wire protocol
//! - HTTP/REST API
//! - GraphQL endpoint
//!
//! # Usage Example
//!
//! ```rust,no_run
//! use heliosdb_nano::protocols::adapters::{
//! LiteStorageAdapter,
//! LiteQueryExecutorAdapter,
//! StorageAdapter,
//! QueryExecutorAdapter,
//! };
//! use heliosdb_nano::{StorageEngine, Config};
//! use std::sync::Arc;
//!
//! // Initialize storage engine
//! let config = Config::in_memory();
//! let engine = Arc::new(StorageEngine::open_in_memory(&config).unwrap());
//!
//! // Create adapters
//! let storage = LiteStorageAdapter::new(Arc::clone(&engine));
//! let executor = LiteQueryExecutorAdapter::new(Arc::clone(&engine));
//!
//! // Use storage adapter
//! storage.put(b"key", b"value").unwrap();
//! let value = storage.get(b"key").unwrap();
//!
//! // Use query executor adapter
//! executor.execute_query("CREATE TABLE users (id INT, name TEXT)").unwrap();
//! let result = executor.execute_query("SELECT * FROM users").unwrap();
//! ```
// Re-export commonly used types
pub use ;
// Re-export Oracle protocol types
pub use ;
// Re-export server manager
pub use ;