use std::time::Duration;
use async_trait::async_trait;
use sa_token_adapter::storage::{SaStorage, StorageResult, StorageError};
pub struct DatabaseStorage {
}
impl DatabaseStorage {
pub async fn new(_database_url: &str) -> StorageResult<Self> {
Err(StorageError::InternalError(
"Database storage is not implemented yet. Please use memory or redis storage.".to_string()
))
}
}
#[async_trait]
impl SaStorage for DatabaseStorage {
async fn get(&self, _key: &str) -> StorageResult<Option<String>> {
Err(StorageError::InternalError("Not implemented".to_string()))
}
async fn set(&self, _key: &str, _value: &str, _ttl: Option<Duration>) -> StorageResult<()> {
Err(StorageError::InternalError("Not implemented".to_string()))
}
async fn delete(&self, _key: &str) -> StorageResult<()> {
Err(StorageError::InternalError("Not implemented".to_string()))
}
async fn exists(&self, _key: &str) -> StorageResult<bool> {
Err(StorageError::InternalError("Not implemented".to_string()))
}
async fn expire(&self, _key: &str, _ttl: Duration) -> StorageResult<()> {
Err(StorageError::InternalError("Not implemented".to_string()))
}
async fn ttl(&self, _key: &str) -> StorageResult<Option<Duration>> {
Err(StorageError::InternalError("Not implemented".to_string()))
}
async fn clear(&self) -> StorageResult<()> {
Err(StorageError::InternalError("Not implemented".to_string()))
}
}