Skip to content

Commit

Permalink
issues-336 Rebase from master
Browse files Browse the repository at this point in the history
  • Loading branch information
ikrivosheev committed Oct 9, 2022
1 parent 105bada commit 79fab4a
Show file tree
Hide file tree
Showing 9 changed files with 419 additions and 287 deletions.
34 changes: 17 additions & 17 deletions sea-query-binder/src/sqlx_any.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl<'q> sqlx::IntoArguments<'q, sqlx::any::Any> for SqlxValues {
Value::Bytes(b) => {
args.add(b.map(|b| *b));
}
#[cfg(feature = "with-array")]
#[cfg(feature = "postgres-array")]
Value::BoolArray(_)
| Value::TinyIntArray(_)
| Value::SmallIntArray(_)
Expand All @@ -67,103 +67,103 @@ impl<'q> sqlx::IntoArguments<'q, sqlx::any::Any> for SqlxValues {
Value::ChronoDate(d) => {
args.add(d.map(|d| *d));
}
#[cfg(all(feature = "with-chrono", feature = "with-array"))]
#[cfg(all(feature = "with-chrono", feature = "postgres-array"))]
Value::ChronoDateArray(_) => panic!("Array support not implemented for Any"),
#[cfg(feature = "with-chrono")]
Value::ChronoTime(t) => {
args.add(t.map(|t| *t));
}
#[cfg(all(feature = "with-chrono", feature = "with-array"))]
#[cfg(all(feature = "with-chrono", feature = "postgres-array"))]
Value::ChronoTimeArray(_) => panic!("Array support not implemented for Any"),
#[cfg(feature = "with-chrono")]
Value::ChronoDateTime(t) => {
args.add(t.map(|t| *t));
}
#[cfg(all(feature = "with-chrono", feature = "with-array"))]
#[cfg(all(feature = "with-chrono", feature = "postgres-array"))]
Value::ChronoDateTimeArray(_) => panic!("Array support not implemented for Any"),
#[cfg(feature = "with-chrono")]
Value::ChronoDateTimeUtc(t) => {
args.add(t.map(|t| *t));
}
#[cfg(all(feature = "with-chrono", feature = "with-array"))]
#[cfg(all(feature = "with-chrono", feature = "postgres-array"))]
Value::ChronoDateTimeUtcArray(_) => panic!("Array support not implemented for Any"),
#[cfg(feature = "with-chrono")]
Value::ChronoDateTimeLocal(t) => {
args.add(t.map(|t| *t));
}
#[cfg(all(feature = "with-chrono", feature = "with-array"))]
#[cfg(all(feature = "with-chrono", feature = "postgres-array"))]
Value::ChronoDateTimeLocalArray(_) => {
panic!("Array support not implemented for Any")
}
#[cfg(feature = "with-chrono")]
Value::ChronoDateTimeWithTimeZone(t) => {
args.add(Value::ChronoDateTimeWithTimeZone(t).chrono_as_naive_utc_in_string());
}
#[cfg(all(feature = "with-chrono", feature = "with-array"))]
#[cfg(all(feature = "with-chrono", feature = "postgres-array"))]
Value::ChronoDateTimeWithTimeZoneArray(_) => {
panic!("Array support not implemented for Any")
}
#[cfg(feature = "with-time")]
Value::TimeDate(t) => {
args.add(Value::TimeDate(t).time_as_naive_utc_in_string());
}
#[cfg(all(feature = "with-chrono", feature = "with-array"))]
#[cfg(all(feature = "with-chrono", feature = "postgres-array"))]
Value::TimeDateArray(_) => panic!("Array support not implemented for Any"),
#[cfg(feature = "with-time")]
Value::TimeTime(t) => {
args.add(Value::TimeTime(t).time_as_naive_utc_in_string());
}
#[cfg(all(feature = "with-chrono", feature = "with-array"))]
#[cfg(all(feature = "with-chrono", feature = "postgres-array"))]
Value::TimeTimeArray(_) => panic!("Array support not implemented for Any"),
#[cfg(feature = "with-time")]
Value::TimeDateTime(t) => {
args.add(Value::TimeDateTime(t).time_as_naive_utc_in_string());
}
#[cfg(all(feature = "with-chrono", feature = "with-array"))]
#[cfg(all(feature = "with-chrono", feature = "postgres-array"))]
Value::TimeDateTimeArray(_) => panic!("Array support not implemented for Any"),
#[cfg(feature = "with-time")]
Value::TimeDateTimeWithTimeZone(t) => {
args.add(Value::TimeDateTimeWithTimeZone(t).time_as_naive_utc_in_string());
}
#[cfg(all(feature = "with-chrono", feature = "with-array"))]
#[cfg(all(feature = "with-chrono", feature = "postgres-array"))]
Value::TimeDateTimeWithTimeZoneArray(_) => {
panic!("Array support not implemented for Any")
}
#[cfg(feature = "with-uuid")]
Value::Uuid(_) => {
panic!("UUID support not implemented for Any");
}
#[cfg(all(feature = "with-chrono", feature = "with-array"))]
#[cfg(all(feature = "with-chrono", feature = "postgres-array"))]
Value::UuidArray(_) => panic!("Array support not implemented for Any"),
#[cfg(feature = "with-rust_decimal")]
Value::Decimal(_) => {
panic!("Sqlite doesn't support decimal arguments");
}
#[cfg(all(feature = "with-chrono", feature = "with-array"))]
#[cfg(all(feature = "with-chrono", feature = "postgres-array"))]
Value::DecimalArray(_) => panic!("Array support not implemented for Any"),
#[cfg(feature = "with-bigdecimal")]
Value::BigDecimal(_) => {
panic!("Sqlite doesn't support bigdecimal arguments");
}
#[cfg(all(feature = "with-chrono", feature = "with-array"))]
#[cfg(all(feature = "with-chrono", feature = "postgres-array"))]
Value::BigDecimalArray(_) => panic!("Array support not implemented for Any"),
#[cfg(feature = "with-json")]
Value::Json(_) => {
panic!("Json support not implemented for Any");
}
#[cfg(all(feature = "with-chrono", feature = "with-array"))]
#[cfg(all(feature = "with-chrono", feature = "postgres-array"))]
Value::JsonArray(_) => panic!("Array support not implemented for Any"),
#[cfg(feature = "with-ipnetwork")]
Value::IpNetwork(_) => {
panic!("SeaQuery doesn't support IpNetwork arguments for Any");
}
#[cfg(all(feature = "with-chrono", feature = "with-array"))]
#[cfg(all(feature = "with-chrono", feature = "postgres-array"))]
Value::IpNetworkArray(_) => panic!("Array support not implemented for Any"),
#[cfg(feature = "with-mac_address")]
Value::MacAddress(_) => {
panic!("SeaQuery doesn't support MacAddress arguments for Any");
}
#[cfg(all(feature = "with-chrono", feature = "with-array"))]
#[cfg(all(feature = "with-chrono", feature = "postgres-array"))]
Value::MacAddressArray(_) => panic!("Array support not implemented for Any"),
}
}
Expand Down
34 changes: 17 additions & 17 deletions sea-query-binder/src/sqlx_mysql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl<'q> sqlx::IntoArguments<'q, sqlx::mysql::MySql> for SqlxValues {
Value::Bytes(b) => {
args.add(b.as_deref());
}
#[cfg(feature = "with-array")]
#[cfg(feature = "postgres-array")]
Value::BoolArray(_)
| Value::TinyIntArray(_)
| Value::SmallIntArray(_)
Expand All @@ -67,97 +67,97 @@ impl<'q> sqlx::IntoArguments<'q, sqlx::mysql::MySql> for SqlxValues {
Value::ChronoDate(d) => {
args.add(d.as_deref());
}
#[cfg(all(feature = "with-chrono", feature = "with-array"))]
#[cfg(all(feature = "with-chrono", feature = "postgres-array"))]
Value::ChronoDateArray(_) => panic!("Mysql doesn't support array"),
#[cfg(feature = "with-chrono")]
Value::ChronoTime(t) => {
args.add(t.as_deref());
}
#[cfg(all(feature = "with-chrono", feature = "with-array"))]
#[cfg(all(feature = "with-chrono", feature = "postgres-array"))]
Value::ChronoTimeArray(_) => panic!("Mysql doesn't support array"),
#[cfg(feature = "with-chrono")]
Value::ChronoDateTime(t) => {
args.add(t.as_deref());
}
#[cfg(all(feature = "with-chrono", feature = "with-array"))]
#[cfg(all(feature = "with-chrono", feature = "postgres-array"))]
Value::ChronoDateTimeArray(_) => panic!("Mysql doesn't support array"),
#[cfg(feature = "with-chrono")]
Value::ChronoDateTimeUtc(t) => {
args.add(t.as_deref());
}
#[cfg(all(feature = "with-chrono", feature = "with-array"))]
#[cfg(all(feature = "with-chrono", feature = "postgres-array"))]
Value::ChronoDateTimeUtcArray(_) => panic!("Mysql doesn't support array"),
#[cfg(feature = "with-chrono")]
Value::ChronoDateTimeLocal(t) => {
args.add(t.as_deref());
}
#[cfg(all(feature = "with-chrono", feature = "with-array"))]
#[cfg(all(feature = "with-chrono", feature = "postgres-array"))]
Value::ChronoDateTimeLocalArray(_) => panic!("Mysql doesn't support array"),
#[cfg(feature = "with-chrono")]
Value::ChronoDateTimeWithTimeZone(t) => {
args.add(Value::ChronoDateTimeWithTimeZone(t).chrono_as_naive_utc_in_string());
}
#[cfg(all(feature = "with-chrono", feature = "with-array"))]
#[cfg(all(feature = "with-chrono", feature = "postgres-array"))]
Value::ChronoDateTimeWithTimeZoneArray(_) => panic!("Mysql doesn't support array"),
#[cfg(feature = "with-time")]
Value::TimeDate(t) => {
args.add(t.as_deref());
}
#[cfg(all(feature = "with-chrono", feature = "with-array"))]
#[cfg(all(feature = "with-chrono", feature = "postgres-array"))]
Value::TimeDateArray(_) => panic!("Mysql doesn't support array"),
#[cfg(feature = "with-time")]
Value::TimeTime(t) => {
args.add(t.as_deref());
}
#[cfg(all(feature = "with-chrono", feature = "with-array"))]
#[cfg(all(feature = "with-chrono", feature = "postgres-array"))]
Value::TimeTimeArray(_) => panic!("Mysql doesn't support array"),
#[cfg(feature = "with-time")]
Value::TimeDateTime(t) => {
args.add(t.as_deref());
}
#[cfg(all(feature = "with-chrono", feature = "with-array"))]
#[cfg(all(feature = "with-chrono", feature = "postgres-array"))]
Value::TimeDateTimeArray(_) => panic!("Mysql doesn't support array"),
#[cfg(feature = "with-time")]
Value::TimeDateTimeWithTimeZone(t) => {
args.add(t.as_deref());
}
#[cfg(all(feature = "with-chrono", feature = "with-array"))]
#[cfg(all(feature = "with-chrono", feature = "postgres-array"))]
Value::TimeDateTimeWithTimeZoneArray(_) => panic!("Mysql doesn't support array"),
#[cfg(feature = "with-uuid")]
Value::Uuid(uuid) => {
args.add(uuid.as_deref());
}
#[cfg(all(feature = "with-chrono", feature = "with-array"))]
#[cfg(all(feature = "with-chrono", feature = "postgres-array"))]
Value::UuidArray(_) => panic!("Mysql doesn't support array"),
#[cfg(feature = "with-rust_decimal")]
Value::Decimal(d) => {
args.add(d.as_deref());
}
#[cfg(all(feature = "with-chrono", feature = "with-array"))]
#[cfg(all(feature = "with-chrono", feature = "postgres-array"))]
Value::DecimalArray(_) => panic!("Mysql doesn't support array"),
#[cfg(feature = "with-bigdecimal")]
Value::BigDecimal(d) => {
args.add(d.as_deref());
}
#[cfg(all(feature = "with-chrono", feature = "with-array"))]
#[cfg(all(feature = "with-chrono", feature = "postgres-array"))]
Value::BigDecimalArray(_) => panic!("Mysql doesn't support array"),
#[cfg(feature = "with-json")]
Value::Json(j) => {
args.add(j.as_deref());
}
#[cfg(all(feature = "with-chrono", feature = "with-array"))]
#[cfg(all(feature = "with-chrono", feature = "postgres-array"))]
Value::JsonArray(_) => panic!("Mysql doesn't support array"),
#[cfg(feature = "with-ipnetwork")]
Value::IpNetwork(_) => {
panic!("Mysql doesn't support IpNetwork arguments");
}
#[cfg(all(feature = "with-chrono", feature = "with-array"))]
#[cfg(all(feature = "with-chrono", feature = "postgres-array"))]
Value::IpNetworkArray(_) => panic!("Mysql doesn't support array"),
#[cfg(feature = "with-mac_address")]
Value::MacAddress(_) => {
panic!("Mysql doesn't support MacAddress arguments");
}
#[cfg(all(feature = "with-chrono", feature = "with-array"))]
#[cfg(all(feature = "with-chrono", feature = "postgres-array"))]
Value::MacAddressArray(_) => panic!("Mysql doesn't support array"),
}
}
Expand Down
Loading

0 comments on commit 79fab4a

Please sign in to comment.