rowdy-db 0.5.8

A fast, modern, and rowdy TUI database management tool written in Rust.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use async_trait::async_trait;
use crate::db::error::DbError;

#[async_trait]
pub trait KvClient: Send + Sync {
    async fn connect(&mut self, url: &str) -> Result<(), DbError>;
    #[allow(dead_code)]
    async fn disconnect(&mut self) -> Result<(), DbError>;
    #[allow(dead_code)]
    async fn get(&self, key: &str) -> Result<Option<String>, DbError>;
    #[allow(dead_code)]
    async fn set(&self, key: &str, value: &str) -> Result<(), DbError>;
    #[allow(dead_code)]
    async fn del(&self, key: &str) -> Result<bool, DbError>;
    async fn keys(&self, pattern: &str) -> Result<Vec<String>, DbError>;
}