-
-
Notifications
You must be signed in to change notification settings - Fork 521
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into active-model-behavior
- Loading branch information
Showing
45 changed files
with
818 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ members = [".", "sea-orm-macros", "sea-orm-codegen"] | |
|
||
[package] | ||
name = "sea-orm" | ||
version = "0.2.4" | ||
version = "0.2.6" | ||
authors = ["Chris Tsang <[email protected]>"] | ||
edition = "2018" | ||
description = "🐚 An async & dynamic ORM for Rust" | ||
|
@@ -29,8 +29,8 @@ futures = { version = "^0.3" } | |
futures-util = { version = "^0.3" } | ||
log = { version = "^0.4", optional = true } | ||
rust_decimal = { version = "^1", optional = true } | ||
sea-orm-macros = { version = "^0.2.4", path = "sea-orm-macros", optional = true } | ||
sea-query = { version = "^0.16.5", features = ["thread-safe"] } | ||
sea-orm-macros = { version = "^0.2.6", path = "sea-orm-macros", optional = true } | ||
sea-query = { version = "^0.17.0", features = ["thread-safe"] } | ||
sea-strum = { version = "^0.21", features = ["derive", "sea-orm"] } | ||
serde = { version = "^1.0", features = ["derive"] } | ||
serde_json = { version = "^1", optional = true } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
|
||
[package] | ||
name = "sea-orm-cli" | ||
version = "0.2.4" | ||
version = "0.2.6" | ||
authors = [ "Billy Chan <[email protected]>" ] | ||
edition = "2018" | ||
description = "Command line utility for SeaORM" | ||
|
@@ -21,7 +21,7 @@ path = "src/main.rs" | |
clap = { version = "^2.33.3" } | ||
dotenv = { version = "^0.15" } | ||
async-std = { version = "^1.9", features = [ "attributes" ] } | ||
sea-orm-codegen = { version = "^0.2.4", path = "../sea-orm-codegen" } | ||
sea-orm-codegen = { version = "^0.2.6", path = "../sea-orm-codegen" } | ||
sea-schema = { version = "^0.2.9", default-features = false, features = [ | ||
"debug-print", | ||
"sqlx-mysql", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "sea-orm-codegen" | ||
version = "0.2.4" | ||
version = "0.2.6" | ||
authors = ["Billy Chan <[email protected]>"] | ||
edition = "2018" | ||
description = "Code Generator for SeaORM" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
mod entity; | ||
mod error; | ||
mod util; | ||
|
||
pub use entity::*; | ||
pub use error::*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
pub(crate) fn escape_rust_keyword<T>(string: T) -> String | ||
where | ||
T: ToString, | ||
{ | ||
let string = string.to_string(); | ||
if RUST_KEYWORDS.iter().any(|s| s.eq(&string)) { | ||
format!("r#{}", string) | ||
} else if RUST_SPECIAL_KEYWORDS.iter().any(|s| s.eq(&string)) { | ||
format!("{}_", string) | ||
} else { | ||
string | ||
} | ||
} | ||
|
||
pub(crate) const RUST_KEYWORDS: [&str; 49] = [ | ||
"as", "async", "await", "break", "const", "continue", "dyn", "else", "enum", "extern", "false", | ||
"fn", "for", "if", "impl", "in", "let", "loop", "match", "mod", "move", "mut", "pub", "ref", | ||
"return", "static", "struct", "super", "trait", "true", "type", "union", "unsafe", "use", | ||
"where", "while", "abstract", "become", "box", "do", "final", "macro", "override", "priv", | ||
"try", "typeof", "unsized", "virtual", "yield", | ||
]; | ||
|
||
pub(crate) const RUST_SPECIAL_KEYWORDS: [&str; 3] = ["crate", "Self", "self"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
//! SeaORM Entity. Generated by sea-orm-codegen 0.1.0 | ||
use sea_orm::entity::prelude::*; | ||
|
||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel)] | ||
#[sea_orm(table_name = "rust_keyword")] | ||
pub struct Model { | ||
#[sea_orm(primary_key)] | ||
pub id: i32, | ||
pub testing: i32, | ||
pub rust: i32, | ||
pub keywords: i32, | ||
pub r#type: i32, | ||
pub r#typeof: i32, | ||
pub crate_: i32, | ||
pub self_: i32, | ||
} | ||
|
||
#[derive(Copy, Clone, Debug, EnumIter)] | ||
pub enum Relation {} | ||
|
||
impl RelationTrait for Relation { | ||
fn def(&self) -> RelationDef { | ||
match self { | ||
_ => panic!("No RelationDef"), | ||
} | ||
} | ||
} | ||
|
||
impl ActiveModelBehavior for ActiveModel {} |
Oops, something went wrong.