MCPcopy Create free account
hub / github.com/GraphLite-AI/GraphLite / session

Method session

sdk-rust/src/connection.rs:86–97  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 ///

Callers 4

mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45

Calls 3

create_simple_sessionMethod · 0.80
cloneMethod · 0.80
SessionClass · 0.70

Tested by

no test coverage detected