removed sqlx dependency

This commit is contained in:
alex 2026-07-03 15:19:23 +08:00
parent 8e93a4224b
commit 1bd479df72
3 changed files with 4 additions and 34 deletions

View File

@ -22,7 +22,6 @@ rsa = "0.9.6"
serde = { version = "1.0.196", features = ["derive"] }
serde_json = "1.0.113"
serde_repr = "0.1.18"
sqlx = "0.7.3"
#structopt = "0.3.26"
tokio = { version = "1.36.0", features = ["full"] }
tracing = "0.1.40"

View File

@ -4,7 +4,6 @@ use dashmap::DashMap;
use dashmap::DashSet;
use futures::future::BoxFuture;
use serde::{Deserialize, Serialize};
use sqlx::prelude::FromRow;
use std::default::Default;
use std::future::Future;
use std::hash::Hasher;
@ -94,11 +93,9 @@ impl IpSubnet {
}
*/
#[derive(Debug, Serialize, Deserialize, FromRow)]
#[derive(Debug, Serialize, Deserialize)]
pub struct IpSubnetNonAtomic {
#[sqlx(try_from = "u32")]
pub net_addr: u32,
#[sqlx(try_from = "u8")]
pub net_bit_len: u8,
}
@ -119,11 +116,9 @@ impl IpSubnetNonAtomic {
}
}
#[derive(Debug, Serialize, Deserialize, FromRow)]
#[derive(Debug, Serialize, Deserialize)]
pub struct IpSubnet {
#[sqlx(try_from = "u32")]
pub net_addr: AtomicU32,
#[sqlx(try_from = "u8")]
pub net_bit_len: AtomicU8,
}
@ -159,7 +154,7 @@ pub fn is_sdlan_sock_equal(s1: &SdlanSock, s2: &SdlanSock) -> bool {
}
/// SdlanSock: 对端对外的ip信息包括ipv4和ipv6
#[derive(Debug, Serialize, Deserialize, PartialEq, sqlx::FromRow)]
#[derive(Debug, Serialize, Deserialize, PartialEq)]
pub struct SdlanSock {
pub family: u8,
pub port: u16,
@ -167,9 +162,7 @@ pub struct SdlanSock {
// pub v6_port: u16,
// pub v4: Vec<u8>,
// pub v6: Vec<u8>,
#[sqlx(try_from = "Vec<u8>")]
pub v4: [u8; 4],
#[sqlx(try_from = "Vec<u8>")]
pub v6: [u8; 16],
}
@ -202,28 +195,12 @@ impl SdlanSock {
}
}
#[derive(Debug, Serialize, Deserialize, PartialEq, sqlx::FromRow)]
#[derive(Debug, Serialize, Deserialize, PartialEq)]
pub struct V6Info {
pub port: u16,
pub v6: [u8; 16],
}
/*
/// SdlanSock: 对端对外的ip信息包括ipv4和ipv6
#[derive(Debug, Serialize, Deserialize, PartialEq, sqlx::FromRow)]
pub struct SdlanSock {
pub family: u8,
pub port: u32,
pub has_v6: bool,
pub v6_port: u32,
pub v4: Vec<u8>,
pub v6: Vec<u8>,
// pub v4: [u8; 4],
// pub v6: [u8; 16],
}
*/
use std::borrow::Cow;
use std::sync::Arc;

View File

@ -51,12 +51,6 @@ impl From<serde_json::Error> for SDLanError {
}
}
impl From<sqlx::Error> for SDLanError {
fn from(value: sqlx::Error) -> Self {
Self::DBError(value.to_string())
}
}
impl From<ParseError> for SDLanError {
fn from(value: ParseError) -> Self {
Self::ConvertError(value.to_string())