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

[examples] entity & application crate depends on SeaORM with minimum required features enabled #723

Merged
merged 1 commit into from
May 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
11 changes: 11 additions & 0 deletions examples/actix3_example/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,14 @@ serde = "1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
entity = { path = "entity" }
migration = { path = "migration" }

[dependencies.sea-orm]
path = "../../" # remove this line in your own project
version = "^0.8.0"
features = [
"debug-print",
"runtime-async-std-native-tls",
"sqlx-mysql",
# "sqlx-postgres",
# "sqlx-sqlite",
]
2 changes: 1 addition & 1 deletion examples/actix3_example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

1. Modify the `DATABASE_URL` var in `.env` to point to your chosen database

1. Turn on the appropriate database feature for your chosen db in `entity/Cargo.toml` (the `"sqlx-mysql",` line)
1. Turn on the appropriate database feature for your chosen db in `Cargo.toml` (the `"sqlx-mysql",` line)

1. Execute `cargo run` to start the server

Expand Down
8 changes: 0 additions & 8 deletions examples/actix3_example/entity/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,3 @@ serde = { version = "1", features = ["derive"] }
[dependencies.sea-orm]
path = "../../../" # remove this line in your own project
version = "^0.8.0"
features = [
"macros",
"debug-print",
"runtime-async-std-native-tls",
"sqlx-mysql",
# "sqlx-postgres",
# "sqlx-sqlite",
]
2 changes: 0 additions & 2 deletions examples/actix3_example/entity/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
pub mod post;

pub use sea_orm;
1 change: 0 additions & 1 deletion examples/actix3_example/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use actix_web::{

use entity::post;
use entity::post::Entity as Post;
use entity::sea_orm;
use listenfd::ListenFd;
use migration::{Migrator, MigratorTrait};
use sea_orm::DatabaseConnection;
Expand Down
11 changes: 11 additions & 0 deletions examples/actix_example/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,14 @@ serde = "1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
entity = { path = "entity" }
migration = { path = "migration" }

[dependencies.sea-orm]
path = "../../" # remove this line in your own project
version = "^0.8.0"
features = [
"debug-print",
"runtime-actix-native-tls",
"sqlx-mysql",
# "sqlx-postgres",
# "sqlx-sqlite",
]
2 changes: 1 addition & 1 deletion examples/actix_example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

1. Modify the `DATABASE_URL` var in `.env` to point to your chosen database

1. Turn on the appropriate database feature for your chosen db in `entity/Cargo.toml` (the `"sqlx-mysql",` line)
1. Turn on the appropriate database feature for your chosen db in `Cargo.toml` (the `"sqlx-mysql",` line)

1. Execute `cargo run` to start the server

Expand Down
8 changes: 0 additions & 8 deletions examples/actix_example/entity/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,3 @@ serde = { version = "1", features = ["derive"] }
[dependencies.sea-orm]
path = "../../../" # remove this line in your own project
version = "^0.8.0"
features = [
"macros",
"debug-print",
"runtime-actix-native-tls",
"sqlx-mysql",
# "sqlx-postgres",
# "sqlx-sqlite",
]
2 changes: 0 additions & 2 deletions examples/actix_example/entity/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
pub mod post;

pub use sea_orm;
1 change: 0 additions & 1 deletion examples/actix_example/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use actix_web::{

use entity::post;
use entity::post::Entity as Post;
use entity::sea_orm;
use listenfd::ListenFd;
use migration::{Migrator, MigratorTrait};
use sea_orm::DatabaseConnection;
Expand Down
11 changes: 11 additions & 0 deletions examples/axum_example/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,14 @@ tera = "1.15.0"
tracing-subscriber = { version = "0.3.11", features = ["env-filter"] }
entity = { path = "entity" }
migration = { path = "migration" }

[dependencies.sea-orm]
path = "../../" # remove this line in your own project
version = "^0.8.0"
features = [
"debug-print",
"runtime-tokio-native-tls",
"sqlx-postgres",
# "sqlx-mysql",
# "sqlx-sqlite",
]
2 changes: 1 addition & 1 deletion examples/axum_example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

1. Modify the `DATABASE_URL` var in `.env` to point to your chosen database

1. Turn on the appropriate database feature for your chosen db in `entity/Cargo.toml` (the `"sqlx-postgres",` line)
1. Turn on the appropriate database feature for your chosen db in `Cargo.toml` (the `"sqlx-postgres",` line)

1. Execute `cargo run` to start the server

Expand Down
8 changes: 0 additions & 8 deletions examples/axum_example/entity/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,3 @@ serde = { version = "1", features = ["derive"] }
[dependencies.sea-orm]
path = "../../../" # remove this line in your own project
version = "^0.8.0"
features = [
"macros",
"debug-print",
"runtime-tokio-native-tls",
"sqlx-postgres",
# "sqlx-mysql",
# "sqlx-sqlite",
]
2 changes: 0 additions & 2 deletions examples/axum_example/entity/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
pub mod post;

pub use sea_orm;
1 change: 0 additions & 1 deletion examples/axum_example/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use axum::{
Router, Server,
};
use entity::post;
use entity::sea_orm;
use flash::{get_flash_cookie, post_response, PostResponse};
use migration::{Migrator, MigratorTrait};
use post::Entity as Post;
Expand Down
10 changes: 10 additions & 0 deletions examples/graphql_example/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,13 @@ dotenv = "0.15.0"
async-graphql-axum = "^3.0.38"
entity = { path = "entity" }
migration = { path = "migration" }

[dependencies.sea-orm]
path = "../../" # remove this line in your own project
version = "^0.8.0"
features = [
"runtime-tokio-native-tls",
# "sqlx-postgres",
# "sqlx-mysql",
"sqlx-sqlite"
]
2 changes: 1 addition & 1 deletion examples/graphql_example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

1. Modify the `DATABASE_URL` var in `.env` to point to your chosen database

1. Turn on the appropriate database feature for your chosen db in `entity/Cargo.toml` (the `"sqlx-sqlite",` line)
1. Turn on the appropriate database feature for your chosen db in `Cargo.toml` (the `"sqlx-sqlite",` line)

1. Execute `cargo run` to start the server

Expand Down
7 changes: 0 additions & 7 deletions examples/graphql_example/entity/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,3 @@ version = "^3.0.38"
[dependencies.sea-orm]
path = "../../../" # remove this line in your own project
version = "^0.8.0"
features = [
"macros",
"runtime-tokio-native-tls",
# "sqlx-postgres",
# "sqlx-mysql",
"sqlx-sqlite"
]
1 change: 0 additions & 1 deletion examples/graphql_example/entity/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
pub mod note;

pub use async_graphql;
pub use sea_orm;
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
use entity::note;
use sea_orm::{DbBackend, EntityTrait, Schema};
use sea_orm_migration::prelude::*;
use entity::{
note,
sea_orm::{DbBackend, EntityTrait, Schema},
};

pub struct Migration;

Expand Down
1 change: 0 additions & 1 deletion examples/graphql_example/src/db.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use entity::sea_orm;
use sea_orm::DatabaseConnection;

pub struct Database {
Expand Down
2 changes: 1 addition & 1 deletion examples/graphql_example/src/graphql/mutation/note.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use async_graphql::{Context, Object, Result};
use entity::async_graphql::{self, InputObject, SimpleObject};
use entity::note;
use entity::sea_orm::{ActiveModelTrait, Set};
use sea_orm::{ActiveModelTrait, Set};

use crate::db::Database;

Expand Down
3 changes: 2 additions & 1 deletion examples/graphql_example/src/graphql/query/note.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use async_graphql::{Context, Object, Result};
use entity::{async_graphql, note, sea_orm::EntityTrait};
use entity::{async_graphql, note};
use sea_orm::EntityTrait;

use crate::db::Database;

Expand Down
13 changes: 12 additions & 1 deletion examples/jsonrpsee_example/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,15 @@ migration = { path = "migration" }
anyhow = "1.0.52"
async-trait = "0.1.52"
log = { version = "0.4", features = ["std"] }
simplelog = "*"
simplelog = "*"

[dependencies.sea-orm]
path = "../../" # remove this line in your own project
version = "^0.8.0"
features = [
"debug-print",
"runtime-tokio-native-tls",
"sqlx-sqlite",
# "sqlx-postgres",
# "sqlx-mysql",
]
2 changes: 1 addition & 1 deletion examples/jsonrpsee_example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

1. Modify the `DATABASE_URL` var in `.env` to point to your chosen database

1. Turn on the appropriate database feature for your chosen db in `entity/Cargo.toml` (the `"sqlx-sqlite",` line)
1. Turn on the appropriate database feature for your chosen db in `Cargo.toml` (the `"sqlx-sqlite",` line)

1. Execute `cargo run` to start the server

Expand Down
8 changes: 0 additions & 8 deletions examples/jsonrpsee_example/entity/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,3 @@ serde = { version = "1", features = ["derive"] }
[dependencies.sea-orm]
path = "../../../" # remove this line in your own project
version = "^0.8.0"
features = [
"macros",
"debug-print",
"runtime-tokio-native-tls",
"sqlx-sqlite",
# "sqlx-postgres",
# "sqlx-mysql",
]
2 changes: 0 additions & 2 deletions examples/jsonrpsee_example/entity/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
pub mod post;

pub use sea_orm;
1 change: 0 additions & 1 deletion examples/jsonrpsee_example/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use std::env;

use anyhow::anyhow;
use entity::post;
use entity::sea_orm;
use jsonrpsee::core::{async_trait, RpcResult};
use jsonrpsee::http_server::HttpServerBuilder;
use jsonrpsee::proc_macros::rpc;
Expand Down
11 changes: 11 additions & 0 deletions examples/poem_example/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,14 @@ tera = "1.8.0"
dotenv = "0.15"
entity = { path = "entity" }
migration = { path = "migration" }

[dependencies.sea-orm]
path = "../../" # remove this line in your own project
version = "^0.8.0"
features = [
"debug-print",
"runtime-tokio-native-tls",
"sqlx-sqlite",
# "sqlx-postgres",
# "sqlx-mysql",
]
2 changes: 1 addition & 1 deletion examples/poem_example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

1. Modify the `DATABASE_URL` var in `.env` to point to your chosen database

1. Turn on the appropriate database feature for your chosen db in `entity/Cargo.toml` (the `"sqlx-sqlite",` line)
1. Turn on the appropriate database feature for your chosen db in `Cargo.toml` (the `"sqlx-sqlite",` line)

1. Execute `cargo run` to start the server

Expand Down
8 changes: 0 additions & 8 deletions examples/poem_example/entity/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,3 @@ serde = { version = "1", features = ["derive"] }
[dependencies.sea-orm]
path = "../../../" # remove this line in your own project
version = "^0.8.0"
features = [
"macros",
"debug-print",
"runtime-tokio-native-tls",
"sqlx-sqlite",
# "sqlx-postgres",
# "sqlx-mysql",
]
2 changes: 0 additions & 2 deletions examples/poem_example/entity/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
pub mod post;

pub use sea_orm;
1 change: 0 additions & 1 deletion examples/poem_example/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::env;

use entity::post;
use entity::sea_orm;
use migration::{Migrator, MigratorTrait};
use poem::endpoint::StaticFilesEndpoint;
use poem::error::{BadRequest, InternalServerError};
Expand Down
10 changes: 10 additions & 0 deletions examples/rocket_example/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,13 @@ migration = { path = "migration" }
[dependencies.sea-orm-rocket]
path = "../../sea-orm-rocket/lib" # remove this line in your own project and use the git line
# git = "https://github.com/SeaQL/sea-orm"

[dependencies.sea-orm]
path = "../../" # remove this line in your own project
version = "^0.8.0"
features = [
"runtime-tokio-native-tls",
"sqlx-postgres",
# "sqlx-mysql",
# "sqlx-sqlite",
]
2 changes: 1 addition & 1 deletion examples/rocket_example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

1. Modify the `url` var in `Rocket.toml` to point to your chosen database

1. Turn on the appropriate database feature for your chosen db in `entity/Cargo.toml` (the `"sqlx-postgres",` line)
1. Turn on the appropriate database feature for your chosen db in `Cargo.toml` (the `"sqlx-postgres",` line)

1. Execute `cargo run` to start the server

Expand Down
7 changes: 0 additions & 7 deletions examples/rocket_example/entity/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,3 @@ rocket = { version = "0.5.0-rc.1", features = [
[dependencies.sea-orm]
path = "../../../" # remove this line in your own project
version = "^0.8.0"
features = [
"macros",
"runtime-tokio-native-tls",
"sqlx-postgres",
# "sqlx-mysql",
# "sqlx-sqlite",
]
2 changes: 0 additions & 2 deletions examples/rocket_example/entity/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@
extern crate rocket;

pub mod post;

pub use sea_orm;
1 change: 0 additions & 1 deletion examples/rocket_example/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use rocket::{Build, Request, Rocket};
use rocket_dyn_templates::Template;
use serde_json::json;

use entity::sea_orm;
use migration::MigratorTrait;
use sea_orm::{entity::*, query::*};
use sea_orm_rocket::{Connection, Database};
Expand Down
1 change: 0 additions & 1 deletion examples/rocket_example/src/pool.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use async_trait::async_trait;
use entity::sea_orm;
use sea_orm::ConnectOptions;
use sea_orm_rocket::{rocket::figment::Figment, Config, Database};
use std::time::Duration;
Expand Down
11 changes: 11 additions & 0 deletions examples/tonic_example/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ migration = { path = "migration" }
prost = "0.10.0"
serde = "1.0"

[dependencies.sea-orm]
path = "../../" # remove this line in your own project
version = "^0.8.0"
features = [
"debug-print",
"runtime-tokio-rustls",
# "sqlx-mysql",
"sqlx-postgres",
# "sqlx-sqlite",
]

[lib]
path = "./src/lib.rs"

Expand Down
Loading