Feature guard macros

This commit is contained in:
Chris Tsang 2021-09-30 22:25:31 +08:00
parent fcd969e57c
commit ca296bc941
4 changed files with 15 additions and 7 deletions

View File

@ -1,9 +1,14 @@
pub use crate::{
error::*, ActiveModelBehavior, ActiveModelTrait, ColumnDef, ColumnTrait, ColumnType,
EntityName, EntityTrait, EnumIter, ForeignKeyAction, Iden, IdenStatic, Linked, ModelTrait,
PrimaryKeyToColumn, PrimaryKeyTrait, QueryFilter, QueryResult, Related, RelationDef,
RelationTrait, Select, Value,
};
#[cfg(feature = "macros")]
pub use crate::{
DeriveActiveModel, DeriveActiveModelBehavior, DeriveColumn, DeriveCustomColumn, DeriveEntity,
DeriveEntityModel, DeriveModel, DerivePrimaryKey, DeriveRelation, EntityName, EntityTrait,
EnumIter, ForeignKeyAction, Iden, IdenStatic, Linked, ModelTrait, PrimaryKeyToColumn,
PrimaryKeyTrait, QueryFilter, QueryResult, Related, RelationDef, RelationTrait, Select, Value,
DeriveEntityModel, DeriveModel, DerivePrimaryKey, DeriveRelation,
};
#[cfg(feature = "with-json")]

View File

@ -304,7 +304,7 @@ pub trait TryGetableMany: Sized {
fn try_get_many(res: &QueryResult, pre: &str, cols: &[String]) -> Result<Self, TryGetError>;
/// ```
/// # #[cfg(feature = "mock")]
/// # #[cfg(all(feature = "mock", feature = "macros"))]
/// # use sea_orm::{error::*, tests_cfg::*, MockDatabase, Transaction, DbBackend};
/// #
/// # let db = MockDatabase::new(DbBackend::Postgres)

View File

@ -127,7 +127,7 @@ where
}
/// ```
/// # #[cfg(feature = "mock")]
/// # #[cfg(all(feature = "mock", feature = "macros"))]
/// # use sea_orm::{error::*, tests_cfg::*, MockDatabase, Transaction, DbBackend};
/// #
/// # let db = MockDatabase::new(DbBackend::Postgres)

View File

@ -243,13 +243,13 @@
//! pub id: i32,
//! pub name: String,
//! }
//!
//!
//! #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
//! pub enum Relation {
//! #[sea_orm(has_many = "super::fruit::Entity")]
//! Fruit,
//! }
//!
//!
//! impl Related<super::fruit::Entity> for Entity {
//! fn to() -> RelationDef {
//! Relation::Fruit.def()
@ -433,6 +433,7 @@ pub use executor::*;
pub use query::*;
pub use schema::*;
#[cfg(feature = "macros")]
pub use sea_orm_macros::{
DeriveActiveModel, DeriveActiveModelBehavior, DeriveColumn, DeriveCustomColumn, DeriveEntity,
DeriveEntityModel, DeriveModel, DerivePrimaryKey, DeriveRelation, FromQueryResult,
@ -440,7 +441,9 @@ pub use sea_orm_macros::{
pub use sea_query;
pub use sea_query::Iden;
#[cfg(feature = "macros")]
pub use sea_query::Iden as DeriveIden;
pub use sea_strum;
#[cfg(feature = "macros")]
pub use sea_strum::EnumIter;