Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
28Smiles authored Aug 5, 2024
2 parents 606a5af + d898d77 commit 2357418
Show file tree
Hide file tree
Showing 34 changed files with 216 additions and 186 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/diesel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: cargo update --manifest-path sea-query-diesel/Cargo.toml --workspace -p bigdecimal:0.4.2 --precise 0.3.1
- run: cargo update --manifest-path sea-query-diesel/Cargo.toml --workspace -p bigdecimal:0.4.5 --precise 0.3.1
- run: cargo build --manifest-path sea-query-diesel/Cargo.toml --workspace --features postgres,sqlite,mysql --features=with-chrono,with-json,with-rust_decimal,with-bigdecimal,with-uuid,with-time,with-ipnetwork,with-mac_address,postgres-array,postgres-vector
- run: cargo build --manifest-path sea-query-diesel/Cargo.toml --workspace --features postgres,sqlite,mysql --features=with-chrono
- run: cargo build --manifest-path sea-query-diesel/Cargo.toml --workspace --features postgres,sqlite,mysql --features=with-json
Expand Down Expand Up @@ -158,6 +158,6 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: cargo update --manifest-path examples/${{ matrix.example }}/Cargo.toml -p bigdecimal:0.4.2 --precise 0.3.1
- run: cargo update --manifest-path examples/${{ matrix.example }}/Cargo.toml -p bigdecimal:0.4.5 --precise 0.3.1
- run: cargo build --manifest-path examples/${{ matrix.example }}/Cargo.toml
- run: cargo run --manifest-path examples/${{ matrix.example }}/Cargo.toml
19 changes: 16 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,30 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## 0.31.0 - Pending
## 0.31.0 - 2024-08-02

### Versions

+ `sea-query`/`0.31.0-rc.1`: 2024-01-31
+ `sea-query`/`0.31.0-rc.4`: 2024-02-02
+ `sea-query`/`0.31.0-rc.5`: 2024-04-14
+ `sea-query`/`0.31.0-rc.6`: 2024-05-03
+ `sea-query`/`0.31.0-rc.7`: 2024-06-02
+ `sea-query`/`0.31.0-rc.8`: 2024-06-19
+ `sea-query-binder`/`0.6.0-rc.1`: 2024-01-31
+ `sea-query-binder`/`0.6.0-rc.2`: 2024-04-14
+ `sea-query-binder`/`0.6.0-rc.3`: 2024-06-19
+ `sea-query-binder`/`0.6.0-rc.4`: 2024-06-25
+ `sea-query-binder`/`0.6.0`: 2024-08-02
+ `sea-query-rusqlite`/`0.6.0-rc.1`: 2024-02-19
+ `sea-query-rusqlite`/`0.6.0`: 2024-08-02
+ `sea-query-attr`/`0.1.2`: 2024-04-14
+ `sea-query-diesel`/`0.2.0`: 2024-08-02

### New Features

* Added `table_name` attribute to `enum_def` macro https://github.com/SeaQL/sea-query/pull/759
* Added `ColumnType::Blob` https://github.com/SeaQL/sea-query/pull/777

### Breaking Changes

Expand Down Expand Up @@ -52,6 +61,7 @@ assert_eq!(
.col(ColumnDef::new(Alias::new("boolean_col")).boolean())
.col(ColumnDef::new(Alias::new("binary2")).binary_len(1024))
.col(ColumnDef::new(Alias::new("binary3")).var_binary(1024))
.col(ColumnDef::new(Alias::new("binary4")).blob())
.to_string(SqliteQueryBuilder),
[
r#"CREATE TABLE "strange" ( "id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,"#,
Expand All @@ -77,7 +87,8 @@ assert_eq!(
r#""datetime_col" datetime_text,"#,
r#""boolean_col" boolean,"#,
r#""binary2" blob(1024),"#,
r#""binary3" varbinary_blob(1024)"#,
r#""binary3" varbinary_blob(1024),"#,
r#""binary4" blob"#,
r#")"#,
]
.join(" ")
Expand All @@ -91,7 +102,7 @@ assert_eq!(
.table(BinaryType::Table)
.col(ColumnDef::new(BinaryType::BinaryLen).binary_len(32))
.col(ColumnDef::new(BinaryType::Binary).binary())
.col(ColumnDef::new(BinaryType::Blob).custom(MySqlType::Blob))
.col(ColumnDef::new(BinaryType::Blob).blob())
.col(ColumnDef::new(BinaryType::TinyBlob).custom(MySqlType::TinyBlob))
.col(ColumnDef::new(BinaryType::MediumBlob).custom(MySqlType::MediumBlob))
.col(ColumnDef::new(BinaryType::LongBlob).custom(MySqlType::LongBlob))
Expand Down Expand Up @@ -135,6 +146,7 @@ pub enum StringLen {
* Added `IntoColumnDef` trait, allowing `&mut ColumnDef` / `ColumnDef` as argument
* Added `ColumnType::string()` and `ColumnType::var_binary()` as shim for old API
* Added `ON DUPLICATE KEY DO NOTHING` polyfill for MySQL https://github.com/SeaQL/sea-query/pull/765
* Added non-TLS runtime https://github.com/SeaQL/sea-query/pull/783

### House keeping

Expand All @@ -144,6 +156,7 @@ pub enum StringLen {
### Upgrades

* Upgrade `rusqlite` to `0.31` https://github.com/SeaQL/sea-query/pull/755
* Upgrade `time` to `0.3.36` https://github.com/SeaQL/sea-query/pull/788

## 0.30.8 - Pending

Expand Down
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ members = [".", "sea-query-derive"]

[package]
name = "sea-query"
version = "0.31.0-rc.5"
version = "0.31.0"
authors = [
"Chris Tsang <[email protected]>",
"Billy Chan <[email protected]>",
Expand Down Expand Up @@ -32,14 +32,14 @@ inherent = "1.0"
sea-query-attr = { version = "0.1.1", path = "sea-query-attr", default-features = false, optional = true }
sea-query-derive = { version = "0.4.0", path = "sea-query-derive", default-features = false, optional = true }
serde_json = { version = "1", default-features = false, optional = true, features = ["std"] }
educe = { version = "0.5.11", default-features = false, optional = true, features = ["Hash", "PartialEq", "Eq"] }
educe = { version = "=0.5.11", default-features = false, optional = true, features = ["Hash", "PartialEq", "Eq"] }
chrono = { version = "0.4.27", default-features = false, optional = true, features = ["clock"] }
postgres-types = { version = "0", default-features = false, optional = true }
pgvector = { version = "0", default-features = false, optional = true }
rust_decimal = { version = "1", default-features = false, optional = true }
bigdecimal = { version = "0.3", default-features = false, optional = true }
uuid = { version = "1", default-features = false, optional = true }
time = { version = "0.3", default-features = false, optional = true, features = ["macros", "formatting"] }
time = { version = "0.3.36", default-features = false, optional = true, features = ["macros", "formatting"] }
ipnetwork = { version = "0.20", default-features = false, optional = true }
mac_address = { version = "1.1", default-features = false, optional = true }
ordered-float = { version = "3.4", default-features = false, optional = true }
Expand Down
2 changes: 1 addition & 1 deletion examples/diesel_mysql/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ edition = "2021"

[dependencies]
chrono = { version = "0.4", default-features = false, features = ["clock"] }
time = { version = "0.3", features = ["parsing", "macros"] }
time = { version = "0.3.36", features = ["parsing", "macros"] }
serde_json = { version = "1" }
uuid = { version = "1", features = ["serde", "v4"] }
diesel = { version = "2.1.1", features = ["mysql"] }
Expand Down
2 changes: 1 addition & 1 deletion examples/diesel_postgres/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ edition = "2021"

[dependencies]
chrono = { version = "0.4", default-features = false, features = ["clock"] }
time = { version = "0.3", features = ["parsing", "macros"] }
time = { version = "0.3.36", features = ["parsing", "macros"] }
serde_json = { version = "1" }
uuid = { version = "1", features = ["serde", "v4"] }
ipnetwork = { version = "0.20" }
Expand Down
2 changes: 1 addition & 1 deletion examples/diesel_sqlite/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ edition = "2021"

[dependencies]
chrono = { version = "0.4", default-features = false, features = ["clock"] }
time = { version = "0.3", features = ["parsing", "macros"] }
time = { version = "0.3.36", features = ["parsing", "macros"] }
serde_json = { version = "1" }
uuid = { version = "1", features = ["serde", "v4"] }
diesel = { version = "2.1.1", features = ["sqlite"] }
Expand Down
2 changes: 1 addition & 1 deletion examples/postgres/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ publish = false

[dependencies]
chrono = { version = "0.4", default-features = false, features = ["clock"] }
time = { version = "0.3", features = ["macros"] }
time = { version = "0.3.36", features = ["macros"] }
uuid = { version = "1", features = ["serde", "v4"] }
serde_json = "1"
rust_decimal = { version = "1" }
Expand Down
2 changes: 1 addition & 1 deletion examples/rusqlite/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ publish = false

[dependencies]
chrono = { version = "0.4", default-features = false, features = ["clock"] }
time = { version = "0.3", features = ["parsing", "macros"] }
time = { version = "0.3.36", features = ["parsing", "macros"] }
serde_json = { version = "1" }
uuid = { version = "1", features = ["serde", "v4"] }
rusqlite = { version = "0.31" }
Expand Down
2 changes: 1 addition & 1 deletion examples/sqlx_any/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ publish = false

[dependencies]
chrono = { version = "0.4", default-features = false, features = ["clock"] }
time = "0.3"
time = "0.3.36"
uuid = { version = "1", features = ["serde", "v4"] }
serde_json = "1"
rust_decimal = { version = "1" }
Expand Down
2 changes: 1 addition & 1 deletion examples/sqlx_mysql/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ publish = false

[dependencies]
chrono = { version = "0.4", default-features = false, features = ["clock"] }
time = { version = "0.3", features = ["macros"] }
time = { version = "0.3.36", features = ["macros"] }
uuid = { version = "1", features = ["serde", "v4"] }
serde_json = "1"
rust_decimal = { version = "1" }
Expand Down
2 changes: 1 addition & 1 deletion examples/sqlx_postgres/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ publish = false

[dependencies]
chrono = { version = "0.4", default-features = false, features = ["clock"] }
time = { version = "0.3", features = ["macros"] }
time = { version = "0.3.36", features = ["macros"] }
uuid = { version = "1", features = ["serde", "v4"] }
serde_json = "1"
rust_decimal = { version = "1" }
Expand Down
2 changes: 1 addition & 1 deletion examples/sqlx_sqlite/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ publish = false

[dependencies]
chrono = { version = "0.4", default-features = false, features = ["clock"] }
time = { version = "0.3", features = ["macros"] }
time = { version = "0.3.36", features = ["macros"] }
uuid = { version = "1", features = ["serde", "v4"] }
serde_json = "1"
async-std = { version = "1.8", features = [ "attributes" ] }
Expand Down
2 changes: 1 addition & 1 deletion sea-query-attr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ darling = { version = "0.14", default-features = false }

[dev-dependencies]
trybuild = "1.0"
sea-query = { version = "0.31.0-rc.4", path = ".." }
sea-query = { version = "0.31.0", path = ".." }
strum = { version = "0.25", features = ["derive"] }
2 changes: 2 additions & 0 deletions sea-query-attr/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(clippy::manual_unwrap_or_default)]

use darling::FromMeta;
use heck::{ToPascalCase, ToSnakeCase};
use proc_macro::TokenStream;
Expand Down
9 changes: 6 additions & 3 deletions sea-query-binder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

[package]
name = "sea-query-binder"
version = "0.6.0-rc.2"
version = "0.6.0"
authors = [ "Valentin Tolmer <[email protected]>", "Ivan Krivosheev <[email protected]>" ]
edition = "2021"
description = "Driver library for using SeaQuery with SQLx"
Expand All @@ -17,14 +17,14 @@ rust-version = "1.60"
[lib]

[dependencies]
sea-query = { version = "0.31.0-rc.4", path = "..", default-features = false, features = ["thread-safe"] }
sea-query = { version = "0.31.0", path = "..", default-features = false, features = ["thread-safe"] }
sqlx = { version = "<0.7.5", default-features = false, optional = true }
serde_json = { version = "1", default-features = false, optional = true, features = ["std"] }
chrono = { version = "0.4", default-features = false, optional = true, features = ["clock"] }
rust_decimal = { version = "1", default-features = false, optional = true }
bigdecimal = { version = "0.3", default-features = false, optional = true }
uuid = { version = "1", default-features = false, optional = true }
time = { version = "<0.3.35", default-features = false, optional = true, features = ["macros", "formatting"] }
time = { version = "0.3.36", default-features = false, optional = true, features = ["macros", "formatting"] }
ipnetwork = { version = "0.20", default-features = false, optional = true }
mac_address = { version = "1.1", default-features = false, optional = true }
pgvector = { version = "0", default-features = false, optional = true }
Expand All @@ -44,9 +44,12 @@ with-ipnetwork = ["sqlx?/ipnetwork", "sea-query/with-ipnetwork", "ipnetwork"]
with-mac_address = ["sqlx?/mac_address", "sea-query/with-mac_address", "mac_address"]
postgres-array = ["sea-query/postgres-array"]
postgres-vector = ["sea-query/postgres-vector", "pgvector/sqlx"]
runtime-async-std = ["sqlx?/runtime-async-std"]
runtime-async-std-native-tls = ["sqlx?/runtime-async-std-native-tls"]
runtime-async-std-rustls = ["sqlx?/runtime-async-std-rustls", ]
runtime-actix = ["sqlx?/runtime-tokio"]
runtime-actix-native-tls = ["sqlx?/runtime-tokio-native-tls"]
runtime-actix-rustls = ["sqlx?/runtime-tokio-rustls"]
runtime-tokio = ["sqlx?/runtime-tokio"]
runtime-tokio-native-tls = ["sqlx?/runtime-tokio-native-tls"]
runtime-tokio-rustls = ["sqlx?/runtime-tokio-rustls"]
51 changes: 27 additions & 24 deletions sea-query-binder/src/sqlx_any.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,86 +8,89 @@ impl<'q> sqlx::IntoArguments<'q, sqlx::any::Any> for SqlxValues {
use sqlx::Arguments;
match arg {
Value::Bool(b) => {
args.add(b);
let _ = args.add(b);
}
Value::TinyInt(i) => {
args.add(i.map(Into::<i32>::into));
let _ = args.add(i.map(Into::<i32>::into));
}
Value::SmallInt(i) => {
args.add(i.map(Into::<i32>::into));
let _ = args.add(i.map(Into::<i32>::into));
}
Value::Int(i) => {
args.add(i);
let _ = args.add(i);
}
Value::BigInt(i) => {
args.add(i);
let _ = args.add(i);
}
Value::TinyUnsigned(i) => {
args.add(i.map(Into::<i32>::into));
let _ = args.add(i.map(Into::<i32>::into));
}
Value::SmallUnsigned(i) => {
args.add(i.map(Into::<i32>::into));
let _ = args.add(i.map(Into::<i32>::into));
}
Value::Unsigned(i) => {
args.add(i.map(Into::<i64>::into));
let _ = args.add(i.map(Into::<i64>::into));
}
Value::BigUnsigned(i) => {
args.add(i.map(|i| <i64 as std::convert::TryFrom<u64>>::try_from(i).unwrap()));
let _ = args
.add(i.map(|i| <i64 as std::convert::TryFrom<u64>>::try_from(i).unwrap()));
}
Value::Float(f) => {
args.add(f);
let _ = args.add(f);
}
Value::Double(d) => {
args.add(d);
let _ = args.add(d);
}
Value::String(s) => {
args.add(s.map(|s| *s));
let _ = args.add(s.map(|s| *s));
}
Value::Char(c) => {
args.add(c.map(|c| c.to_string()));
let _ = args.add(c.map(|c| c.to_string()));
}
Value::Bytes(b) => {
args.add(b.map(|b| *b));
let _ = args.add(b.map(|b| *b));
}
#[cfg(feature = "with-chrono")]
Value::ChronoDate(t) => {
args.add(Value::ChronoDate(t).chrono_as_naive_utc_in_string());
let _ = args.add(Value::ChronoDate(t).chrono_as_naive_utc_in_string());
}
#[cfg(feature = "with-chrono")]
Value::ChronoTime(t) => {
args.add(Value::ChronoTime(t).chrono_as_naive_utc_in_string());
let _ = args.add(Value::ChronoTime(t).chrono_as_naive_utc_in_string());
}
#[cfg(feature = "with-chrono")]
Value::ChronoDateTime(t) => {
args.add(Value::ChronoDateTime(t).chrono_as_naive_utc_in_string());
let _ = args.add(Value::ChronoDateTime(t).chrono_as_naive_utc_in_string());
}
#[cfg(feature = "with-chrono")]
Value::ChronoDateTimeUtc(t) => {
args.add(Value::ChronoDateTimeUtc(t).chrono_as_naive_utc_in_string());
let _ = args.add(Value::ChronoDateTimeUtc(t).chrono_as_naive_utc_in_string());
}
#[cfg(feature = "with-chrono")]
Value::ChronoDateTimeLocal(t) => {
args.add(Value::ChronoDateTimeLocal(t).chrono_as_naive_utc_in_string());
let _ = args.add(Value::ChronoDateTimeLocal(t).chrono_as_naive_utc_in_string());
}
#[cfg(feature = "with-chrono")]
Value::ChronoDateTimeWithTimeZone(t) => {
args.add(Value::ChronoDateTimeWithTimeZone(t).chrono_as_naive_utc_in_string());
let _ = args
.add(Value::ChronoDateTimeWithTimeZone(t).chrono_as_naive_utc_in_string());
}
#[cfg(feature = "with-time")]
Value::TimeDate(t) => {
args.add(Value::TimeDate(t).time_as_naive_utc_in_string());
let _ = args.add(Value::TimeDate(t).time_as_naive_utc_in_string());
}
#[cfg(feature = "with-time")]
Value::TimeTime(t) => {
args.add(Value::TimeTime(t).time_as_naive_utc_in_string());
let _ = args.add(Value::TimeTime(t).time_as_naive_utc_in_string());
}
#[cfg(feature = "with-time")]
Value::TimeDateTime(t) => {
args.add(Value::TimeDateTime(t).time_as_naive_utc_in_string());
let _ = args.add(Value::TimeDateTime(t).time_as_naive_utc_in_string());
}
#[cfg(feature = "with-time")]
Value::TimeDateTimeWithTimeZone(t) => {
args.add(Value::TimeDateTimeWithTimeZone(t).time_as_naive_utc_in_string());
let _ =
args.add(Value::TimeDateTimeWithTimeZone(t).time_as_naive_utc_in_string());
}
#[cfg(feature = "with-uuid")]
Value::Uuid(_) => {
Expand Down
Loading

0 comments on commit 2357418

Please sign in to comment.