Create a new session for the given user Sessions provide user context for permissions and security. Each session maintains its own transaction state and is isolated from other sessions. Unlike SQLite which doesn't have sessions, GraphLite uses sessions for: - User authentication and permissions - Transaction isolation - Audit logging # Arguments `username` - Username for the session # Example
(&self, username: &str)
| 84 | /// # Ok::<(), graphlite_sdk::Error>(()) |
| 85 | /// ``` |
| 86 | pub fn session(&self, username: &str) -> Result<Session> { |
| 87 | let session_id = self |
| 88 | .coordinator |
| 89 | .create_simple_session(username) |
| 90 | .map_err(|e| Error::Session(format!("Failed to create session: {}", e)))?; |
| 91 | |
| 92 | Ok(Session { |
| 93 | id: session_id, |
| 94 | coordinator: self.coordinator.clone(), |
| 95 | username: username.to_string(), |
| 96 | }) |
| 97 | } |
| 98 | |
| 99 | /// Get access to the underlying QueryCoordinator |
| 100 | /// |