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

Bump SeaQuery and SeaSchema to latest RC version #1661

Merged
merged 1 commit into from
May 18, 2023
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
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ tracing = { version = "0.1", default-features = false, features = ["attributes",
rust_decimal = { version = "1", default-features = false, optional = true }
bigdecimal = { version = "0.3", default-features = false, optional = true }
sea-orm-macros = { version = "0.12.0", path = "sea-orm-macros", default-features = false, features = ["strum"] }
sea-query = { version = "0.29.0-rc.1", features = ["thread-safe"] }
sea-query-binder = { version = "0.4.0-rc.1", default-features = false, optional = true }
sea-query = { version = "0.29.0-rc.2", features = ["thread-safe"] }
sea-query-binder = { version = "0.4.0-rc.2", default-features = false, optional = true }
strum = { version = "0.24", default-features = false }
serde = { version = "1.0", default-features = false }
serde_json = { version = "1.0", default-features = false, optional = true }
Expand Down
2 changes: 1 addition & 1 deletion sea-orm-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ clap = { version = "3.2", default-features = false, features = ["std", "env", "d
dotenvy = { version = "0.15", default-features = false, optional = true }
async-std = { version = "1.9", default-features = false, features = ["attributes", "tokio1"], optional = true }
sea-orm-codegen = { version = "=0.12.0", path = "../sea-orm-codegen", default-features = false, optional = true }
sea-schema = { version = "0.12.0-rc.1" }
sea-schema = { version = "0.12.0-rc.2" }
sqlx = { version = "0.6", default-features = false, features = ["mysql", "postgres"], optional = true }
tracing-subscriber = { version = "0.3.17", default-features = false, features = ["env-filter", "fmt"] }
tracing = { version = "0.1", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion sea-orm-codegen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ name = "sea_orm_codegen"
path = "src/lib.rs"

[dependencies]
sea-query = { version = "0.29.0-rc.1", default-features = false, features = ["thread-safe"] }
sea-query = { version = "0.29.0-rc.2", default-features = false, features = ["thread-safe"] }
syn = { version = "1", default-features = false, features = ["parsing", "proc-macro", "derive", "printing"] }
quote = { version = "1", default-features = false }
heck = { version = "0.4", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion sea-orm-codegen/src/entity/column.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ impl Column {
}
ColumnType::Array(column_type) => {
let column_type = write_col_def(column_type);
quote! { ColumnType::Array(sea_orm::sea_query::SeaRc::new(#column_type)) }
quote! { ColumnType::Array(RcOrArc::new(#column_type)) }
}
#[allow(unreachable_patterns)]
_ => unimplemented!(),
Expand Down
10 changes: 5 additions & 5 deletions sea-orm-codegen/src/entity/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ mod tests {
};
use pretty_assertions::assert_eq;
use proc_macro2::TokenStream;
use sea_query::{ColumnType, ForeignKeyAction, SeaRc};
use sea_query::{ColumnType, ForeignKeyAction, RcOrArc};
use std::io::{self, BufRead, BufReader, Read};

fn setup() -> Vec<Entity> {
Expand Down Expand Up @@ -1258,14 +1258,14 @@ mod tests {
},
Column {
name: "integers".to_owned(),
col_type: ColumnType::Array(SeaRc::new(ColumnType::Integer)),
col_type: ColumnType::Array(RcOrArc::new(ColumnType::Integer)),
auto_increment: false,
not_null: true,
unique: false,
},
Column {
name: "integers_opt".to_owned(),
col_type: ColumnType::Array(SeaRc::new(ColumnType::Integer)),
col_type: ColumnType::Array(RcOrArc::new(ColumnType::Integer)),
auto_increment: false,
not_null: false,
unique: false,
Expand All @@ -1289,14 +1289,14 @@ mod tests {
},
Column {
name: "floats".to_owned(),
col_type: ColumnType::Array(SeaRc::new(ColumnType::Float)),
col_type: ColumnType::Array(RcOrArc::new(ColumnType::Float)),
auto_increment: false,
not_null: true,
unique: false,
},
Column {
name: "doubles".to_owned(),
col_type: ColumnType::Array(SeaRc::new(ColumnType::Double)),
col_type: ColumnType::Array(RcOrArc::new(ColumnType::Double)),
auto_increment: false,
not_null: true,
unique: false,
Expand Down
4 changes: 2 additions & 2 deletions sea-orm-codegen/tests/expanded/collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ impl ColumnTrait for Column {
fn def(&self) -> ColumnDef {
match self {
Self::Id => ColumnType::Integer.def(),
Self::Integers => ColumnType::Array(sea_orm::sea_query::SeaRc::new(ColumnType::Integer)).def(),
Self::IntegersOpt => ColumnType::Array(sea_orm::sea_query::SeaRc::new(ColumnType::Integer)).def().null(),
Self::Integers => ColumnType::Array(RcOrArc::new(ColumnType::Integer)).def(),
Self::IntegersOpt => ColumnType::Array(RcOrArc::new(ColumnType::Integer)).def().null(),
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions sea-orm-codegen/tests/expanded/collection_float.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ impl ColumnTrait for Column {
fn def(&self) -> ColumnDef {
match self {
Self::Id => ColumnType::Integer.def(),
Self::Floats => ColumnType::Array(sea_orm::sea_query::SeaRc::new(ColumnType::Float)).def(),
Self::Doubles => ColumnType::Array(sea_orm::sea_query::SeaRc::new(ColumnType::Double)).def(),
Self::Floats => ColumnType::Array(RcOrArc::new(ColumnType::Float)).def(),
Self::Doubles => ColumnType::Array(RcOrArc::new(ColumnType::Double)).def(),
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions sea-orm-codegen/tests/expanded_with_schema_name/collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ impl ColumnTrait for Column {
fn def(&self) -> ColumnDef {
match self {
Self::Id => ColumnType::Integer.def(),
Self::Integers => ColumnType::Array(sea_orm::sea_query::SeaRc::new(ColumnType::Integer)).def(),
Self::IntegersOpt => ColumnType::Array(sea_orm::sea_query::SeaRc::new(ColumnType::Integer)).def().null(),
Self::Integers => ColumnType::Array(RcOrArc::new(ColumnType::Integer)).def(),
Self::IntegersOpt => ColumnType::Array(RcOrArc::new(ColumnType::Integer)).def().null(),
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ impl ColumnTrait for Column {
fn def(&self) -> ColumnDef {
match self {
Self::Id => ColumnType::Integer.def(),
Self::Floats => ColumnType::Array(sea_orm::sea_query::SeaRc::new(ColumnType::Float)).def(),
Self::Doubles => ColumnType::Array(sea_orm::sea_query::SeaRc::new(ColumnType::Double)).def(),
Self::Floats => ColumnType::Array(RcOrArc::new(ColumnType::Float)).def(),
Self::Doubles => ColumnType::Array(RcOrArc::new(ColumnType::Double)).def(),
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion sea-orm-migration/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ clap = { version = "3.2", default-features = false, features = ["std", "env", "d
dotenvy = { version = "0.15", default-features = false, optional = true }
sea-orm = { version = "0.12.0", path = "../", default-features = false, features = ["macros"] }
sea-orm-cli = { version = "0.12.0", path = "../sea-orm-cli", default-features = false, optional = true }
sea-schema = { version = "0.12.0-rc.1" }
sea-schema = { version = "0.12.0-rc.2" }
tracing = { version = "0.1", default-features = false, features = ["log"] }
tracing-subscriber = { version = "0.3.17", default-features = false, features = ["env-filter", "fmt"] }
futures = { version = "0.3", default-features = false, features = ["std"] }
Expand Down
5 changes: 1 addition & 4 deletions src/entity/active_enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ use sea_query::{DynIden, Expr, Nullable, SimpleExpr, Value, ValueType};
/// > See [DeriveActiveEnum](sea_orm_macros::DeriveActiveEnum) for the full specification of macro attributes.
///
/// ```rust
/// use sea_orm::{
/// entity::prelude::*,
/// sea_query::{DynIden, SeaRc},
/// };
/// use sea_orm::entity::prelude::*;
///
/// // Using the derive macro
/// #[derive(Debug, PartialEq, EnumIter, DeriveActiveEnum)]
Expand Down
12 changes: 7 additions & 5 deletions src/entity/prelude.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
pub use crate::{
error::*, sea_query::BlobSize, ActiveEnum, ActiveModelBehavior, ActiveModelTrait, ColumnDef,
ColumnTrait, ColumnType, ColumnTypeTrait, ConnectionTrait, CursorTrait, DatabaseConnection,
DbConn, EntityName, EntityTrait, EnumIter, ForeignKeyAction, Iden, IdenStatic, Linked,
LoaderTrait, ModelTrait, PaginatorTrait, PrimaryKeyToColumn, PrimaryKeyTrait, QueryFilter,
QueryResult, Related, RelationDef, RelationTrait, Select, Value,
error::*,
sea_query::{BlobSize, DynIden, RcOrArc, SeaRc},
ActiveEnum, ActiveModelBehavior, ActiveModelTrait, ColumnDef, ColumnTrait, ColumnType,
ColumnTypeTrait, ConnectionTrait, CursorTrait, DatabaseConnection, DbConn, EntityName,
EntityTrait, EnumIter, ForeignKeyAction, Iden, IdenStatic, Linked, LoaderTrait, ModelTrait,
PaginatorTrait, PrimaryKeyToColumn, PrimaryKeyTrait, QueryFilter, QueryResult, Related,
RelationDef, RelationTrait, Select, Value,
};

#[cfg(feature = "macros")]
Expand Down
4 changes: 2 additions & 2 deletions tests/bits_tests.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
pub mod common;

use common::{features::*, TestContext};
use common::features::*;
use pretty_assertions::assert_eq;
use sea_orm::{entity::prelude::*, entity::*, DatabaseConnection};

#[sea_orm_macros::test]
#[cfg(feature = "sqlx-postgres")]
async fn main() -> Result<(), DbErr> {
let ctx = TestContext::new("bits_tests").await;
let ctx = common::TestContext::new("bits_tests").await;
create_tables(&ctx.db).await?;
create_and_update(&ctx.db).await?;
ctx.delete().await;
Expand Down
64 changes: 64 additions & 0 deletions tests/common/features/collection_expanded.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
use sea_orm::entity::prelude::*;

#[derive(Copy, Clone, Default, Debug, DeriveEntity)]
pub struct Entity;

impl EntityName for Entity {
fn schema_name(&self) -> Option<&str> {
Some("schema_name")
}

fn table_name(&self) -> &str {
"collection"
}
}

#[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Eq)]
pub struct Model {
pub id: i32,
pub integers: Vec<i32>,
pub integers_opt: Option<Vec<i32>>,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
pub enum Column {
Id,
Integers,
IntegersOpt,
}

#[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
pub enum PrimaryKey {
Id,
}

impl PrimaryKeyTrait for PrimaryKey {
type ValueType = i32;
fn auto_increment() -> bool {
true
}
}

#[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {}

impl ColumnTrait for Column {
type EntityName = Entity;
fn def(&self) -> ColumnDef {
match self {
Self::Id => ColumnType::Integer.def(),
Self::Integers => ColumnType::Array(RcOrArc::new(ColumnType::Integer)).def(),
Self::IntegersOpt => ColumnType::Array(RcOrArc::new(ColumnType::Integer))
.def()
.null(),
}
}
}

impl RelationTrait for Relation {
fn def(&self) -> RelationDef {
panic!("No RelationDef")
}
}

impl ActiveModelBehavior for ActiveModel {}
4 changes: 2 additions & 2 deletions tests/common/features/event_trigger.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use sea_orm::entity::prelude::*;
use sea_orm::{
sea_query::{ArrayType, ColumnType, SeaRc, ValueType},
sea_query::{ArrayType, ColumnType, ValueType},
TryGetError, TryGetable,
};

Expand Down Expand Up @@ -65,6 +65,6 @@ impl ValueType for Events {
}

fn column_type() -> ColumnType {
ColumnType::Array(SeaRc::new(ColumnType::String(None)))
ColumnType::Array(RcOrArc::new(ColumnType::String(None)))
}
}
2 changes: 2 additions & 0 deletions tests/common/features/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pub mod binary;
pub mod bits;
pub mod byte_primary_key;
pub mod collection;
pub mod collection_expanded;
pub mod custom_active_model;
pub mod dyn_table_name_lazy_static;
pub mod edit_log;
Expand All @@ -30,6 +31,7 @@ pub use binary::Entity as Binary;
pub use bits::Entity as Bits;
pub use byte_primary_key::Entity as BytePrimaryKey;
pub use collection::Entity as Collection;
pub use collection_expanded::Entity as CollectionExpanded;
pub use dyn_table_name_lazy_static::Entity as DynTableNameLazyStatic;
pub use edit_log::Entity as EditLog;
pub use event_trigger::Entity as EventTrigger;
Expand Down
2 changes: 1 addition & 1 deletion tests/dyn_table_name_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use sea_orm::{
entity::prelude::*, DatabaseConnection, Delete, IntoActiveModel, Iterable, QueryTrait, Set,
Update,
};
use sea_query::{Expr, IntoIden, Query};
use sea_query::{Expr, Query};

#[sea_orm_macros::test]
#[cfg(any(
Expand Down