Set clippy deny
This commit is contained in:
parent
a781cc6610
commit
7f38621c3c
@ -2,19 +2,22 @@ use crate::{
|
|||||||
debug_print, error::*, DatabaseConnection, DbBackend, ExecResult, MockDatabase, QueryResult,
|
debug_print, error::*, DatabaseConnection, DbBackend, ExecResult, MockDatabase, QueryResult,
|
||||||
Statement, Transaction,
|
Statement, Transaction,
|
||||||
};
|
};
|
||||||
|
use std::fmt::Debug;
|
||||||
use std::sync::{
|
use std::sync::{
|
||||||
atomic::{AtomicUsize, Ordering},
|
atomic::{AtomicUsize, Ordering},
|
||||||
Mutex,
|
Mutex,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
pub struct MockDatabaseConnector;
|
pub struct MockDatabaseConnector;
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
pub struct MockDatabaseConnection {
|
pub struct MockDatabaseConnection {
|
||||||
counter: AtomicUsize,
|
counter: AtomicUsize,
|
||||||
mocker: Mutex<Box<dyn MockDatabaseTrait>>,
|
mocker: Mutex<Box<dyn MockDatabaseTrait>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait MockDatabaseTrait: Send {
|
pub trait MockDatabaseTrait: Send + Debug {
|
||||||
fn execute(&mut self, counter: usize, stmt: Statement) -> Result<ExecResult, DbErr>;
|
fn execute(&mut self, counter: usize, stmt: Statement) -> Result<ExecResult, DbErr>;
|
||||||
|
|
||||||
fn query(&mut self, counter: usize, stmt: Statement) -> Result<Vec<QueryResult>, DbErr>;
|
fn query(&mut self, counter: usize, stmt: Statement) -> Result<Vec<QueryResult>, DbErr>;
|
||||||
|
@ -10,8 +10,10 @@ use crate::{debug_print, error::*, executor::*, DatabaseConnection, Statement};
|
|||||||
|
|
||||||
use super::sqlx_common::*;
|
use super::sqlx_common::*;
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
pub struct SqlxMySqlConnector;
|
pub struct SqlxMySqlConnector;
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
pub struct SqlxMySqlPoolConnection {
|
pub struct SqlxMySqlPoolConnection {
|
||||||
pool: MySqlPool,
|
pool: MySqlPool,
|
||||||
}
|
}
|
||||||
|
@ -10,8 +10,10 @@ use crate::{debug_print, error::*, executor::*, DatabaseConnection, Statement};
|
|||||||
|
|
||||||
use super::sqlx_common::*;
|
use super::sqlx_common::*;
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
pub struct SqlxPostgresConnector;
|
pub struct SqlxPostgresConnector;
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
pub struct SqlxPostgresPoolConnection {
|
pub struct SqlxPostgresPoolConnection {
|
||||||
pool: PgPool,
|
pool: PgPool,
|
||||||
}
|
}
|
||||||
|
@ -10,8 +10,10 @@ use crate::{debug_print, error::*, executor::*, DatabaseConnection, Statement};
|
|||||||
|
|
||||||
use super::sqlx_common::*;
|
use super::sqlx_common::*;
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
pub struct SqlxSqliteConnector;
|
pub struct SqlxSqliteConnector;
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
pub struct SqlxSqlitePoolConnection {
|
pub struct SqlxSqlitePoolConnection {
|
||||||
pool: SqlitePool,
|
pool: SqlitePool,
|
||||||
}
|
}
|
||||||
|
@ -46,6 +46,7 @@ pub trait Linked {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
pub struct RelationDef {
|
pub struct RelationDef {
|
||||||
pub rel_type: RelationType,
|
pub rel_type: RelationType,
|
||||||
pub from_tbl: TableRef,
|
pub from_tbl: TableRef,
|
||||||
@ -57,6 +58,7 @@ pub struct RelationDef {
|
|||||||
pub on_update: Option<ForeignKeyAction>,
|
pub on_update: Option<ForeignKeyAction>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
pub struct RelationBuilder<E, R>
|
pub struct RelationBuilder<E, R>
|
||||||
where
|
where
|
||||||
E: EntityTrait,
|
E: EntityTrait,
|
||||||
|
@ -21,6 +21,7 @@ pub trait TryGetable: Sized {
|
|||||||
fn try_get(res: &QueryResult, pre: &str, col: &str) -> Result<Self, TryGetError>;
|
fn try_get(res: &QueryResult, pre: &str, col: &str) -> Result<Self, TryGetError>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
pub enum TryGetError {
|
pub enum TryGetError {
|
||||||
DbErr(DbErr),
|
DbErr(DbErr),
|
||||||
Null,
|
Null,
|
||||||
|
@ -30,6 +30,7 @@ pub trait SelectorTrait {
|
|||||||
fn from_raw_query_result(res: QueryResult) -> Result<Self::Item, DbErr>;
|
fn from_raw_query_result(res: QueryResult) -> Result<Self::Item, DbErr>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
pub struct SelectModel<M>
|
pub struct SelectModel<M>
|
||||||
where
|
where
|
||||||
M: FromQueryResult,
|
M: FromQueryResult,
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||||
|
#![deny(
|
||||||
|
missing_debug_implementations,
|
||||||
|
clippy::print_stderr,
|
||||||
|
clippy::print_stdout
|
||||||
|
)]
|
||||||
|
|
||||||
//! <div align="center">
|
//! <div align="center">
|
||||||
//!
|
//!
|
||||||
//! <img src="https://www.sea-ql.org/SeaORM/img/SeaORM banner.png"/>
|
//! <img src="https://www.sea-ql.org/SeaORM/img/SeaORM banner.png"/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user