Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Continue PaginatorTrait #307

Merged
merged 4 commits into from
Nov 11, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 examples/actix4_example/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use actix_web::{

use listenfd::ListenFd;
use sea_orm::DatabaseConnection;
use sea_orm::{entity::*, query::*, PaginatorTrait};
use sea_orm::{entity::*, query::*};
use serde::{Deserialize, Serialize};
use std::env;
use tera::Tera;
Expand Down
2 changes: 1 addition & 1 deletion examples/actix_example/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use actix_web::{
};
use listenfd::ListenFd;
use sea_orm::DatabaseConnection;
use sea_orm::{entity::*, query::*, PaginatorTrait};
use sea_orm::{entity::*, query::*};
use serde::{Deserialize, Serialize};
use std::env;
use tera::Tera;
Expand Down
2 changes: 1 addition & 1 deletion examples/axum_example/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use axum::{
};
use flash::{get_flash_cookie, post_response, PostResponse};
use post::Entity as Post;
use sea_orm::{prelude::*, Database, QueryOrder, Set, PaginatorTrait};
use sea_orm::{prelude::*, Database, QueryOrder, Set};
use serde::{Deserialize, Serialize};
use std::str::FromStr;
use std::{env, net::SocketAddr};
Expand Down
2 changes: 1 addition & 1 deletion examples/basic/src/select.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use super::*;
use sea_orm::{entity::*, error::*, query::*, DbConn, FromQueryResult, PaginatorTrait};
use sea_orm::{entity::*, error::*, query::*, DbConn, FromQueryResult};

pub async fn all_about_select(db: &DbConn) -> Result<(), DbErr> {
find_all(db).await?;
Expand Down
2 changes: 1 addition & 1 deletion examples/rocket_example/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use rocket::response::{Flash, Redirect};
use rocket::{Build, Request, Rocket};
use rocket_dyn_templates::{context, Template};

use sea_orm::{entity::*, query::*, PaginatorTrait};
use sea_orm::{entity::*, query::*};
use sea_orm_rocket::{Connection, Database};

mod pool;
Expand Down
3 changes: 3 additions & 0 deletions src/entity/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,6 @@ pub use model::*;
// pub use prelude::*;
pub use primary_key::*;
pub use relation::*;

// Imports paginator utility by default making it backward compatible.
pub use crate::PaginatorTrait;
billy1624 marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 2 additions & 2 deletions src/entity/prelude.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
pub use crate::{
error::*, ActiveEnum, ActiveModelBehavior, ActiveModelTrait, ColumnDef, ColumnTrait,
ColumnType, DatabaseConnection, DbConn, EntityName, EntityTrait, EnumIter, ForeignKeyAction,
Iden, IdenStatic, Linked, ModelTrait, PrimaryKeyToColumn, PrimaryKeyTrait, QueryFilter,
QueryResult, Related, RelationDef, RelationTrait, Select, Value,
Iden, IdenStatic, Linked, ModelTrait, PaginatorTrait, PrimaryKeyToColumn, PrimaryKeyTrait,
QueryFilter, QueryResult, Related, RelationDef, RelationTrait, Select, Value,
};

#[cfg(feature = "macros")]
Expand Down
4 changes: 2 additions & 2 deletions src/executor/paginator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ where
///
/// ```rust
/// # #[cfg(feature = "mock")]
/// # use sea_orm::{error::*, MockDatabase, DbBackend, PaginatorTrait};
/// # use sea_orm::{error::*, MockDatabase, DbBackend};
/// # let owned_db = MockDatabase::new(DbBackend::Postgres).into_connection();
/// # let db = &owned_db;
/// # let _: Result<(), DbErr> = smol::block_on(async {
Expand Down Expand Up @@ -126,7 +126,7 @@ where
///
/// ```rust
/// # #[cfg(feature = "mock")]
/// # use sea_orm::{error::*, MockDatabase, DbBackend, PaginatorTrait};
/// # use sea_orm::{error::*, MockDatabase, DbBackend};
/// # let owned_db = MockDatabase::new(DbBackend::Postgres).into_connection();
/// # let db = &owned_db;
/// # let _: Result<(), DbErr> = smol::block_on(async {
Expand Down
4 changes: 1 addition & 3 deletions tests/basic.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
pub mod common;

pub use sea_orm::{
entity::*, error::*, query::*, sea_query, tests_cfg::*, Database, DbConn, PaginatorTrait,
};
pub use sea_orm::{entity::*, error::*, query::*, sea_query, tests_cfg::*, Database, DbConn};

// cargo test --features sqlx-sqlite,runtime-async-std-native-tls --test basic
#[sea_orm_macros::test]
Expand Down
2 changes: 1 addition & 1 deletion tests/crud/updates.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pub use super::*;
use rust_decimal_macros::dec;
use sea_orm::{DbErr, PaginatorTrait};
use sea_orm::DbErr;
use uuid::Uuid;

pub async fn test_update_cake(db: &DbConn) {
Expand Down