Update examples and test
This commit is contained in:
parent
23498892b0
commit
4b11a10680
@ -5,7 +5,7 @@ use actix_web::{
|
|||||||
|
|
||||||
use listenfd::ListenFd;
|
use listenfd::ListenFd;
|
||||||
use sea_orm::DatabaseConnection;
|
use sea_orm::DatabaseConnection;
|
||||||
use sea_orm::{entity::*, query::*};
|
use sea_orm::{entity::*, query::*, PaginatorTrait};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::env;
|
use std::env;
|
||||||
use tera::Tera;
|
use tera::Tera;
|
||||||
|
@ -4,7 +4,7 @@ use actix_web::{
|
|||||||
};
|
};
|
||||||
use listenfd::ListenFd;
|
use listenfd::ListenFd;
|
||||||
use sea_orm::DatabaseConnection;
|
use sea_orm::DatabaseConnection;
|
||||||
use sea_orm::{entity::*, query::*};
|
use sea_orm::{entity::*, query::*, PaginatorTrait};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::env;
|
use std::env;
|
||||||
use tera::Tera;
|
use tera::Tera;
|
||||||
|
@ -12,7 +12,7 @@ use axum::{
|
|||||||
};
|
};
|
||||||
use flash::{get_flash_cookie, post_response, PostResponse};
|
use flash::{get_flash_cookie, post_response, PostResponse};
|
||||||
use post::Entity as Post;
|
use post::Entity as Post;
|
||||||
use sea_orm::{prelude::*, Database, QueryOrder, Set};
|
use sea_orm::{prelude::*, Database, QueryOrder, Set, PaginatorTrait};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
use std::{env, net::SocketAddr};
|
use std::{env, net::SocketAddr};
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
use super::*;
|
use super::*;
|
||||||
use sea_orm::{entity::*, error::*, query::*, DbConn};
|
use sea_orm::{entity::*, error::*, DbConn};
|
||||||
|
|
||||||
pub async fn all_about_operation(db: &DbConn) -> Result<(), DbErr> {
|
pub async fn all_about_operation(db: &DbConn) -> Result<(), DbErr> {
|
||||||
insert_and_update(db).await?;
|
insert_and_update(db).await?;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
use super::*;
|
use super::*;
|
||||||
use sea_orm::{entity::*, error::*, query::*, DbConn, FromQueryResult};
|
use sea_orm::{entity::*, error::*, query::*, DbConn, FromQueryResult, PaginatorTrait};
|
||||||
|
|
||||||
pub async fn all_about_select(db: &DbConn) -> Result<(), DbErr> {
|
pub async fn all_about_select(db: &DbConn) -> Result<(), DbErr> {
|
||||||
find_all(db).await?;
|
find_all(db).await?;
|
||||||
|
@ -9,7 +9,7 @@ use rocket::response::{Flash, Redirect};
|
|||||||
use rocket::{Build, Request, Rocket};
|
use rocket::{Build, Request, Rocket};
|
||||||
use rocket_dyn_templates::{context, Template};
|
use rocket_dyn_templates::{context, Template};
|
||||||
|
|
||||||
use sea_orm::{entity::*, query::*};
|
use sea_orm::{entity::*, query::*, PaginatorTrait};
|
||||||
use sea_orm_rocket::{Connection, Database};
|
use sea_orm_rocket::{Connection, Database};
|
||||||
|
|
||||||
mod pool;
|
mod pool;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
pub mod common;
|
pub mod common;
|
||||||
|
|
||||||
pub use sea_orm::{entity::*, error::*, query::*, sea_query, tests_cfg::*, Database, DbConn};
|
pub use sea_orm::{entity::*, error::*, query::*, sea_query, tests_cfg::*, Database, DbConn, CountTrait};
|
||||||
|
|
||||||
// cargo test --features sqlx-sqlite,runtime-async-std-native-tls --test basic
|
// cargo test --features sqlx-sqlite,runtime-async-std-native-tls --test basic
|
||||||
#[sea_orm_macros::test]
|
#[sea_orm_macros::test]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user