From f4bf5787edbd51417047359eaa5ce54828bd3ebc Mon Sep 17 00:00:00 2001 From: Billy Chan Date: Wed, 22 Mar 2023 16:06:10 +0800 Subject: [PATCH 1/2] Upgrade `sea-query` to 0.29 --- Cargo.toml | 4 ++-- src/mysql/writer/column.rs | 4 ++-- src/mysql/writer/table.rs | 2 +- src/postgres/writer/table.rs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 253b60c2..8a9ebb77 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,8 +36,8 @@ path = "src/lib.rs" [dependencies] futures = { version = "0.3", default-features = false, optional = true, features = ["alloc"] } sea-schema-derive = { version = "0.2.0", path = "sea-schema-derive", default-features = false } -sea-query = { version = "0.28.0", default-features = false, features = ["derive"] } -sea-query-binder = { version = "0.3", default-features = false, optional = true } +sea-query = { version = "0.29.0-rc.1", default-features = false, features = ["derive"] } +sea-query-binder = { version = "0.4.0-rc.1", default-features = false, optional = true } serde = { version = "1", default-features = false, optional = true, features = ["derive"] } sqlx = { version = "0.6", default-features = false, optional = true } log = { version = "0.4", default-features = false, optional = true } diff --git a/src/mysql/writer/column.rs b/src/mysql/writer/column.rs index 7f60ba98..bd55b0e3 100644 --- a/src/mysql/writer/column.rs +++ b/src/mysql/writer/column.rs @@ -251,10 +251,10 @@ impl ColumnInfo { Type::Decimal(_) | Type::Float(_) | Type::Double(_) ) && num_attr.unsigned.is_some() { - col_def.extra("UNSIGNED".into()); + col_def.extra("UNSIGNED"); } if num_attr.zero_fill.is_some() { - col_def.extra("ZEROFILL".into()); + col_def.extra("ZEROFILL"); } col_def } diff --git a/src/mysql/writer/table.rs b/src/mysql/writer/table.rs index 4a6b1ba7..8c3f68b7 100644 --- a/src/mysql/writer/table.rs +++ b/src/mysql/writer/table.rs @@ -4,7 +4,7 @@ use sea_query::{Alias, Iden, Table, TableCreateStatement}; impl TableDef { pub fn write(&self) -> TableCreateStatement { let mut table = Table::create(); - table.table(Alias::new(self.info.name.as_ref())); + table.table(Alias::new(&self.info.name)); for col in self.columns.iter() { table.col(&mut col.write()); } diff --git a/src/postgres/writer/table.rs b/src/postgres/writer/table.rs index f4cd5958..b097424b 100644 --- a/src/postgres/writer/table.rs +++ b/src/postgres/writer/table.rs @@ -4,7 +4,7 @@ use sea_query::{Alias, Table, TableCreateStatement}; impl TableDef { pub fn write(&self) -> TableCreateStatement { let mut table = Table::create(); - table.table(Alias::new(self.info.name.as_ref())); + table.table(Alias::new(&self.info.name)); for col in self.columns.iter() { table.col(&mut col.write()); } From 761fbafb6a64f1e22f4e5f47af38db73636ea5c3 Mon Sep 17 00:00:00 2001 From: Billy Chan Date: Wed, 22 Mar 2023 16:14:32 +0800 Subject: [PATCH 2/2] clippy --- src/mysql/writer/index.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mysql/writer/index.rs b/src/mysql/writer/index.rs index be211dc9..301aa07d 100644 --- a/src/mysql/writer/index.rs +++ b/src/mysql/writer/index.rs @@ -44,12 +44,12 @@ impl IndexInfo { } IndexType::RTree => { index.index_type(sea_query::IndexType::Custom(SeaRc::new(Alias::new( - &self.idx_type.to_string(), + self.idx_type.to_string(), )))); } IndexType::Spatial => { index.index_type(sea_query::IndexType::Custom(SeaRc::new(Alias::new( - &self.idx_type.to_string(), + self.idx_type.to_string(), )))); } }