diff --git a/README.md b/README.md index 7b35f3ab..993a7900 100644 --- a/README.md +++ b/README.md @@ -3,14 +3,14 @@

SeaORM

- An [adjective] ORM for Rust + An intuitive ORM for Rust

Built with ❤️ by 🌊🦀🐠 -# SeaORM - An [adjective] ORM for Rust +# SeaORM - An intuitive ORM for Rust ## Features @@ -22,11 +22,26 @@ SeaORM is new to the party and rely on SQLx, so async support is not an aftertho Built upon SeaQuery (a dynamic query builder), SeaORM allows you to build complex queries without 'fighting the ORM'. - 3. Testable -Use mock connection to write unit tests for your logic. +Use mock connections to write unit tests for your logic. 4. API oriented Quickly build search models that help you filter, sort and paginate data in APIs. + +## Goals + +1. Intuitive and familiar + +Inspired by ActiveRecord, Eloquent and TypeORM, SeaORM aims to provide you an ergonomic and intuitive +API to make working with databases in Rust a first-class experience. + +2. Forwarding looking + +We are ready to embrace Rocket 0.5 to make building web services in Rust productive and enjoyable. + +3. Strong typed and dynamic + +SeaORM construct queries at runtime, allowing you to develop flexible and powerful queries. While +the expressive Rust type system would help you in maintaining a complex codebase. diff --git a/src/entity/base.rs b/src/entity/base.rs index b116dd0a..d8f55af7 100644 --- a/src/entity/base.rs +++ b/src/entity/base.rs @@ -2,14 +2,14 @@ use super::{Column, Identity, Model, Relation}; use crate::Select; use sea_query::Iden; use std::fmt::Debug; -use strum::IntoEnumIterator; +pub use strum::IntoEnumIterator as Iterable; pub trait Entity: Iden + Default + Debug { type Model: Model; - type Column: Column + IntoEnumIterator; + type Column: Column + Iterable; - type Relation: Relation + IntoEnumIterator; + type Relation: Relation + Iterable; fn primary_key() -> Identity; diff --git a/src/query/select.rs b/src/query/select.rs index dcfc186d..b04bd6f7 100644 --- a/src/query/select.rs +++ b/src/query/select.rs @@ -1,11 +1,9 @@ -use crate::Statement; -use crate::{entity::*, RelationDef}; +use crate::{entity::*, Iterable, RelationDef, Statement}; use core::fmt::Debug; use core::marker::PhantomData; pub use sea_query::JoinType; use sea_query::{Expr, Iden, IntoIden, QueryBuilder, SelectStatement}; use std::rc::Rc; -use strum::IntoEnumIterator; #[derive(Debug)] pub struct Select<'s, E: 'static>