Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ opendal = { version = "0.54", default-features = false, features = [
"services-memory",
"services-fs",
] }
reqwest = { version = "0.12.22", features = ["json", "rustls-tls", "multipart"] }

# cache
moka = { version = "0.12.7", features = ["sync"], optional = true }
Expand Down Expand Up @@ -205,7 +206,6 @@ loco-rs = { path = ".", features = ["testing"] }
rstest = "0.21.0"
insta = { version = "1.34.0", features = ["redactions", "yaml", "filters"] }
tree-fs = { version = "0.3" }
reqwest = { version = "0.12.7", features = ["json"] }
tower = { workspace = true, features = ["util"] }
sqlx = { version = "0.8.2", default-features = false, features = [
"macros",
Expand Down
21 changes: 12 additions & 9 deletions src/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,35 @@ pub use axum::{
pub use axum_extra::extract::cookie;
pub use chrono::NaiveDateTime as DateTime;
pub use include_dir::{include_dir, Dir};
pub use reqwest::{header::*, Client, StatusCode};
#[cfg(feature = "with-db")]
pub use sea_orm::entity::prelude::*;
// some types required for controller generators
#[cfg(feature = "with-db")]
pub use sea_orm::prelude::{Date, DateTimeUtc, DateTimeWithTimeZone, Decimal, Uuid};
#[cfg(feature = "with-db")]
pub use sea_orm::{
ActiveModelBehavior, ActiveModelTrait, ActiveValue, ColumnTrait, ConnectionTrait,
DatabaseConnection, DbErr, EntityTrait, IntoActiveModel, ModelTrait, QueryFilter, Set,
TransactionTrait,
ActiveValue, DbErr, EntityOrSelect, FromQueryResult, IntoActiveModel, JoinType, QuerySelect,
Set, TransactionTrait,
};
// sugar for controller views to use `data!({"item": ..})` instead of `json!`
pub use serde_json::json as data;
pub use validator::{Validate, ValidationError};

#[cfg(feature = "auth_jwt")]
pub use crate::controller::extractor::auth;
pub use crate::controller::extractor::{
shared_store::SharedStore,
validate::{JsonValidate, JsonValidateWithMessage},
};
#[cfg(feature = "with-db")]
pub use crate::model::{query, Authenticable, ModelError, ModelResult};
pub use crate::{
app::{AppContext, Initializer},
bgworker::{BackgroundWorker, Queue},
controller::{
bad_request, format,
bad_request,
extractor::{
shared_store::SharedStore,
validate::{JsonValidate, JsonValidateWithMessage},
},
format,
middleware::{
format::{Format, RespondTo},
remote_ip::RemoteIP,
Expand All @@ -48,7 +52,6 @@ pub use crate::{
validation::{self, Validatable, ValidatorTrait},
Result,
};
pub use validator::Validate;
#[cfg(feature = "with-db")]
pub mod model {
pub use crate::model::query;
Expand Down
2 changes: 2 additions & 0 deletions src/testing/prelude.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#[cfg(feature = "with-db")]
pub use crate::testing::db::*;
pub use crate::testing::{redaction::*, request::*, selector::*};

pub use axum_test::multipart::{MultipartForm, Part};
Loading