sa_token_storage_database/
lib.rs1use std::time::Duration;
29use async_trait::async_trait;
30use sa_token_adapter::storage::{SaStorage, StorageResult, StorageError};
31
32pub struct DatabaseStorage {
34 }
37
38impl DatabaseStorage {
39 pub async fn new(_database_url: &str) -> StorageResult<Self> {
41 Err(StorageError::InternalError(
43 "Database storage is not implemented yet. Please use memory or redis storage.".to_string()
44 ))
45 }
46}
47
48#[async_trait]
49impl SaStorage for DatabaseStorage {
50 async fn get(&self, _key: &str) -> StorageResult<Option<String>> {
51 Err(StorageError::InternalError("Not implemented".to_string()))
52 }
53
54 async fn set(&self, _key: &str, _value: &str, _ttl: Option<Duration>) -> StorageResult<()> {
55 Err(StorageError::InternalError("Not implemented".to_string()))
56 }
57
58 async fn delete(&self, _key: &str) -> StorageResult<()> {
59 Err(StorageError::InternalError("Not implemented".to_string()))
60 }
61
62 async fn exists(&self, _key: &str) -> StorageResult<bool> {
63 Err(StorageError::InternalError("Not implemented".to_string()))
64 }
65
66 async fn expire(&self, _key: &str, _ttl: Duration) -> StorageResult<()> {
67 Err(StorageError::InternalError("Not implemented".to_string()))
68 }
69
70 async fn ttl(&self, _key: &str) -> StorageResult<Option<Duration>> {
71 Err(StorageError::InternalError("Not implemented".to_string()))
72 }
73
74 async fn clear(&self) -> StorageResult<()> {
75 Err(StorageError::InternalError("Not implemented".to_string()))
76 }
77}
78
79