cargo fmt
This commit is contained in:
parent
3e7220aad0
commit
5714bbe915
@ -66,10 +66,7 @@ async fn find_all(db: &DbConn) -> Result<(), QueryErr> {
|
|||||||
async fn find_together(db: &DbConn) -> Result<(), QueryErr> {
|
async fn find_together(db: &DbConn) -> Result<(), QueryErr> {
|
||||||
print!("find cakes and fruits: ");
|
print!("find cakes and fruits: ");
|
||||||
|
|
||||||
let both = Cake::find()
|
let both = Cake::find().find_also_related(Fruit).all(db).await?;
|
||||||
.find_also_related(Fruit)
|
|
||||||
.all(db)
|
|
||||||
.await?;
|
|
||||||
|
|
||||||
println!();
|
println!();
|
||||||
for bb in both.iter() {
|
for bb in both.iter() {
|
||||||
@ -144,10 +141,8 @@ async fn count_fruits_by_cake(db: &DbConn) -> Result<(), QueryErr> {
|
|||||||
async fn find_many_to_many(db: &DbConn) -> Result<(), QueryErr> {
|
async fn find_many_to_many(db: &DbConn) -> Result<(), QueryErr> {
|
||||||
print!("find cakes and fillings: ");
|
print!("find cakes and fillings: ");
|
||||||
|
|
||||||
let both: Vec<(cake::Model, Vec<filling::Model>)> = Cake::find()
|
let both: Vec<(cake::Model, Vec<filling::Model>)> =
|
||||||
.find_with_related(Filling)
|
Cake::find().find_with_related(Filling).all(db).await?;
|
||||||
.all(db)
|
|
||||||
.await?;
|
|
||||||
|
|
||||||
println!();
|
println!();
|
||||||
for bb in both.iter() {
|
for bb in both.iter() {
|
||||||
|
38
src/lib.rs
38
src/lib.rs
@ -1,46 +1,46 @@
|
|||||||
//! <div align="center">
|
//! <div align="center">
|
||||||
//!
|
//!
|
||||||
//! <img src="docs/SeaORM banner.png"/>
|
//! <img src="docs/SeaORM banner.png"/>
|
||||||
//!
|
//!
|
||||||
//! <h1>SeaORM</h1>
|
//! <h1>SeaORM</h1>
|
||||||
//!
|
//!
|
||||||
//! <p>
|
//! <p>
|
||||||
//! <strong>🐚 An async & dynamic ORM for Rust</strong>
|
//! <strong>🐚 An async & dynamic ORM for Rust</strong>
|
||||||
//! </p>
|
//! </p>
|
||||||
//!
|
//!
|
||||||
//! <sub>Built with 🔥 by 🌊🦀🐚</sub>
|
//! <sub>Built with 🔥 by 🌊🦀🐚</sub>
|
||||||
//!
|
//!
|
||||||
//! </div>
|
//! </div>
|
||||||
//!
|
//!
|
||||||
//! # SeaORM
|
//! # SeaORM
|
||||||
//!
|
//!
|
||||||
//! Inspired by ActiveRecord, Eloquent and TypeORM, SeaORM aims to provide you an intuitive and ergonomic
|
//! Inspired by ActiveRecord, Eloquent and TypeORM, SeaORM aims to provide you an intuitive and ergonomic
|
||||||
//! API to make working with databases in Rust a first-class experience.
|
//! API to make working with databases in Rust a first-class experience.
|
||||||
//!
|
//!
|
||||||
//! ```ignore
|
//! ```ignore
|
||||||
//! This is an early WIP of SeaORM, and is not yet published. See [example](examples/sqlx-mysql/src) for demo usage.
|
//! This is an early WIP of SeaORM, and is not yet published. See [example](examples/sqlx-mysql/src) for demo usage.
|
||||||
//! ```
|
//! ```
|
||||||
//!
|
//!
|
||||||
//! ## Features
|
//! ## Features
|
||||||
//!
|
//!
|
||||||
//! 1. Async
|
//! 1. Async
|
||||||
//!
|
//!
|
||||||
//! Relying on SQLx, SeaORM is a new library with async support from day 1.
|
//! Relying on SQLx, SeaORM is a new library with async support from day 1.
|
||||||
//!
|
//!
|
||||||
//! 2. Dynamic
|
//! 2. Dynamic
|
||||||
//!
|
//!
|
||||||
//! Built upon SeaQuery, a dynamic query builder, SeaORM allows you to build complex queries without 'fighting the ORM'.
|
//! Built upon SeaQuery, a dynamic query builder, SeaORM allows you to build complex queries without 'fighting the ORM'.
|
||||||
//!
|
//!
|
||||||
//! 3. Testable
|
//! 3. Testable
|
||||||
//!
|
//!
|
||||||
//! Use mock connections to write unit tests for your logic.
|
//! Use mock connections to write unit tests for your logic.
|
||||||
//!
|
//!
|
||||||
//! 4. API oriented
|
//! 4. API oriented
|
||||||
//!
|
//!
|
||||||
//! Quickly build search models that help you join, filter, sort and paginate data in APIs.
|
//! Quickly build search models that help you join, filter, sort and paginate data in APIs.
|
||||||
//!
|
//!
|
||||||
//! # A quick taste of SeaORM
|
//! # A quick taste of SeaORM
|
||||||
//!
|
//!
|
||||||
//! ## Select
|
//! ## Select
|
||||||
//! ```
|
//! ```
|
||||||
//! # use sea_orm::{DbConn, entity::*, query::*, tests_cfg::*};
|
//! # use sea_orm::{DbConn, entity::*, query::*, tests_cfg::*};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user