Skip to content

Commit

Permalink
update to user 1.75.0, remove async_trait dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
soulww committed Jan 2, 2024
1 parent d9ca738 commit 913b7e6
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ luna-orm-trait = { path = "luna-orm-trait", version = "0.3.4" }
luna-orm-macro = { path = "luna-orm-macro", version = "0.3.4" }
thiserror = {workspace = true}
sqlx = {workspace = true}
async-trait = {workspace = true}
#async-trait = {workspace = true}
path-absolutize = {workspace = true}

[dev-dependencies]
async-trait = {workspace = true}
#async-trait = {workspace = true}
tokio = {workspace = true}
serde = {workspace = true}
serde_json = {workspace = true}
Expand All @@ -40,7 +40,7 @@ version = "0.3.4"

[workspace.dependencies]
thiserror = {version = "1.0"}
async-trait = {version = "0.1.74"}
#async-trait = {version = "0.1.74"}
serde = {version = "1.0", features = ["derive"]}
serde_with = { version = "3.4.0" }
sqlx = {version = "0.7.3", features = ["mysql", "sqlite", "any"]}
Expand Down
2 changes: 1 addition & 1 deletion luna-orm-trait/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ homepage = "https://github.com/thegenius/luna-orm"

[dependencies]
sqlx = { workspace = true }
async-trait = { workspace = true }
#async-trait = { workspace = true }
serde = { workspace = true }
serde_with = {workspace = true}
typetag = {workspace = true}
Expand Down
4 changes: 2 additions & 2 deletions src/command_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ use crate::sql_executor::SqlExecutor;
use crate::sql_generator::SqlGenerator;
use crate::LunaOrmResult;

use async_trait::async_trait;
//use async_trait::async_trait;
use luna_orm_trait::*;

#[async_trait]
//#[async_trait]
pub trait CommandExecutor: SqlExecutor {
type G: SqlGenerator + Sync;

Expand Down
4 changes: 2 additions & 2 deletions src/database/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ use crate::transaction::Transaction;
use crate::LunaOrmResult;
use std::ops::{Deref, DerefMut};

use async_trait::async_trait;
//use async_trait::async_trait;

#[async_trait]
//#[async_trait]
pub trait Database: CommandExecutor + SqlExecutor {
fn get_type(&self) -> &DatabaseType;

Expand Down
2 changes: 1 addition & 1 deletion src/mapper.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use async_trait::async_trait;
//use async_trait::async_trait;
use luna_orm_trait::SqlxError;
use luna_orm_trait::{
Entity, Location, Mutation, PageInfo, PagedList, Primary, SelectedEntity, Selection,
Expand Down
4 changes: 2 additions & 2 deletions src/sql_executor.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
use crate::error::LunaOrmError;
use crate::LunaOrmResult;

use async_trait::async_trait;
//use async_trait::async_trait;
use luna_orm_trait::*;

use sqlx::any::AnyArguments;
use sqlx::any::AnyQueryResult;
use sqlx::any::AnyRow;
use sqlx::AnyPool;

#[async_trait]
//#[async_trait]
pub trait SqlExecutor {
fn get_pool(&self) -> LunaOrmResult<&AnyPool> {
Err(LunaOrmError::NotImplement)
Expand Down
4 changes: 2 additions & 2 deletions src/sql_generator.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use async_trait::async_trait;
//use async_trait::async_trait;
use luna_orm_trait::FromClause;
use luna_orm_trait::JoinedConditions;
use luna_orm_trait::{Entity, Location, Mutation, OrderBy, Pagination, Primary, Selection};
Expand Down Expand Up @@ -62,7 +62,7 @@ impl SqlGenerator for PostgresGenerator {
self.pg_post_process(origin)
}
}
#[async_trait]
//#[async_trait]
pub trait SqlGenerator {
// const WRAP_CHAR: char = '`'; can not made trait to trait object
#[inline(always)]
Expand Down
4 changes: 2 additions & 2 deletions src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use sqlx::any::AnyRow;

use crate::command_executor::CommandExecutor;
use crate::sql_executor::SqlExecutor;
use async_trait::async_trait;
//use async_trait::async_trait;
use luna_orm_trait::{
Entity, Location, Mutation, Primary, SelectedEntity, Selection, WriteCommand,
};
Expand All @@ -30,7 +30,7 @@ where
}
}

#[async_trait]
//#[async_trait]
impl<'a, G> SqlExecutor for Transaction<'a, G>
where
G: SqlGenerator + Sync,
Expand Down

0 comments on commit 913b7e6

Please sign in to comment.