Skip to content

Commit

Permalink
Merge branch 'master' into issue_396_v2
Browse files Browse the repository at this point in the history
  • Loading branch information
tyt2y3 authored Sep 28, 2024
2 parents cebdfbc + 9c1318f commit 6118879
Show file tree
Hide file tree
Showing 43 changed files with 602 additions and 215 deletions.
17 changes: 8 additions & 9 deletions .github/workflows/diesel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
Expand All @@ -42,10 +42,9 @@ jobs:
name: Build `sea-query-diesel`
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- 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
- 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
- run: cargo build --manifest-path sea-query-diesel/Cargo.toml --workspace --features postgres,sqlite,mysql --features=with-rust_decimal
Expand All @@ -57,6 +56,7 @@ jobs:
- run: cargo build --manifest-path sea-query-diesel/Cargo.toml --workspace --features postgres,sqlite,mysql --features=with-ipnetwork
- run: cargo build --manifest-path sea-query-diesel/Cargo.toml --workspace --features postgres,sqlite,mysql --features=with-mac_address
- run: cargo build --manifest-path sea-query-diesel/Cargo.toml --workspace --features postgres,sqlite,mysql --features=postgres-array
- run: cargo build --manifest-path sea-query-diesel/Cargo.toml --workspace --features postgres,sqlite,mysql --features=postgres-vector

sqlite:
name: SQLite
Expand All @@ -66,7 +66,7 @@ jobs:
matrix:
example: [diesel_sqlite]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --manifest-path examples/${{ matrix.example }}/Cargo.toml
- run: cargo run --manifest-path examples/${{ matrix.example }}/Cargo.toml
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
--health-timeout=5s
--health-retries=3
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --manifest-path examples/${{ matrix.example }}/Cargo.toml
- run: cargo run --manifest-path examples/${{ matrix.example }}/Cargo.toml
Expand Down Expand Up @@ -126,7 +126,7 @@ jobs:
--health-timeout=5s
--health-retries=3
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --manifest-path examples/${{ matrix.example }}/Cargo.toml
- run: cargo run --manifest-path examples/${{ matrix.example }}/Cargo.toml
Expand Down Expand Up @@ -155,8 +155,7 @@ jobs:
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- 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
39 changes: 22 additions & 17 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
Expand All @@ -51,21 +51,21 @@ jobs:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: clippy
- run: cargo clippy --features=all-features --workspace -- -D warnings
- run: cargo clippy --manifest-path sea-query-binder/Cargo.toml --workspace --features runtime-async-std-rustls --features=with-chrono,with-json,with-rust_decimal,with-bigdecimal,with-uuid,with-time,with-ipnetwork,with-mac_address,postgres-array -- -D warnings
- run: cargo clippy --manifest-path sea-query-binder/Cargo.toml --workspace --features runtime-async-std-rustls --features=with-chrono,with-json,with-rust_decimal,with-bigdecimal,with-uuid,with-time,with-ipnetwork,with-mac_address,postgres-array,postgres-vector -- -D warnings
- run: cargo clippy --manifest-path sea-query-rusqlite/Cargo.toml --all-features --workspace -- -D warnings
- run: cargo clippy --manifest-path sea-query-postgres/Cargo.toml --all-features --workspace -- -D warnings

build:
name: Build `sea-query`
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --workspace --no-default-features
- run: cargo build --workspace --all-features
Expand All @@ -78,6 +78,7 @@ jobs:
- run: cargo build --workspace --features=with-ipnetwork
- run: cargo build --workspace --features=with-mac_address
- run: cargo build --workspace --features=postgres-array
- run: cargo build --workspace --features=postgres-vector
- run: cargo build --workspace --features=thread-safe

binder-build:
Expand All @@ -89,9 +90,9 @@ jobs:
runtime: [async-std]
tls: [rustls]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --manifest-path sea-query-binder/Cargo.toml --workspace --features sqlx-postgres,sqlx-sqlite,sqlx-any,sqlx-mysql --features=runtime-${{ matrix.runtime }}-${{ matrix.tls }} --features=with-chrono,with-json,with-rust_decimal,with-bigdecimal,with-uuid,with-time,with-ipnetwork,with-mac_address,postgres-array
- run: cargo build --manifest-path sea-query-binder/Cargo.toml --workspace --features sqlx-postgres,sqlx-sqlite,sqlx-any,sqlx-mysql --features=runtime-${{ matrix.runtime }}-${{ matrix.tls }} --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-binder/Cargo.toml --workspace --features sqlx-postgres,sqlx-sqlite,sqlx-any,sqlx-mysql --features=runtime-${{ matrix.runtime }}-${{ matrix.tls }} --features=with-chrono
- run: cargo build --manifest-path sea-query-binder/Cargo.toml --workspace --features sqlx-postgres,sqlx-sqlite,sqlx-any,sqlx-mysql --features=runtime-${{ matrix.runtime }}-${{ matrix.tls }} --features=with-json
- run: cargo build --manifest-path sea-query-binder/Cargo.toml --workspace --features sqlx-postgres,sqlx-sqlite,sqlx-any,sqlx-mysql --features=runtime-${{ matrix.runtime }}-${{ matrix.tls }} --features=with-rust_decimal
Expand All @@ -101,14 +102,15 @@ jobs:
- run: cargo build --manifest-path sea-query-binder/Cargo.toml --workspace --features sqlx-postgres,sqlx-sqlite,sqlx-any,sqlx-mysql --features=runtime-${{ matrix.runtime }}-${{ matrix.tls }} --features=with-ipnetwork
- run: cargo build --manifest-path sea-query-binder/Cargo.toml --workspace --features sqlx-postgres,sqlx-sqlite,sqlx-any,sqlx-mysql --features=runtime-${{ matrix.runtime }}-${{ matrix.tls }} --features=with-mac_address
- run: cargo build --manifest-path sea-query-binder/Cargo.toml --workspace --features sqlx-postgres,sqlx-sqlite,sqlx-any,sqlx-mysql --features=runtime-${{ matrix.runtime }}-${{ matrix.tls }} --features=postgres-array
- run: cargo build --manifest-path sea-query-binder/Cargo.toml --workspace --features sqlx-postgres,sqlx-sqlite,sqlx-any,sqlx-mysql --features=runtime-${{ matrix.runtime }}-${{ matrix.tls }} --features=postgres-vector

rusqlite-build:
name: Build `sea-query-rusqlite`
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --manifest-path sea-query-rusqlite/Cargo.toml --workspace --features=with-chrono,with-json,with-rust_decimal,with-bigdecimal,with-uuid,with-time,with-ipnetwork,with-mac_address,postgres-array
- run: cargo build --manifest-path sea-query-rusqlite/Cargo.toml --workspace --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-rusqlite/Cargo.toml --workspace --features=with-chrono
- run: cargo build --manifest-path sea-query-rusqlite/Cargo.toml --workspace --features=with-json
- run: cargo build --manifest-path sea-query-rusqlite/Cargo.toml --workspace --features=with-rust_decimal
Expand All @@ -118,14 +120,15 @@ jobs:
- run: cargo build --manifest-path sea-query-rusqlite/Cargo.toml --workspace --features=with-ipnetwork
- run: cargo build --manifest-path sea-query-rusqlite/Cargo.toml --workspace --features=with-mac_address
- run: cargo build --manifest-path sea-query-rusqlite/Cargo.toml --workspace --features=postgres-array
- run: cargo build --manifest-path sea-query-rusqlite/Cargo.toml --workspace --features=postgres-vector

postgres-build:
name: Build `sea-query-postgres`
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --manifest-path sea-query-postgres/Cargo.toml --workspace --features=with-chrono,with-json,with-rust_decimal,with-bigdecimal,with-uuid,with-time,with-ipnetwork,with-mac_address,postgres-array
- run: cargo build --manifest-path sea-query-postgres/Cargo.toml --workspace --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-postgres/Cargo.toml --workspace --features=with-chrono
- run: cargo build --manifest-path sea-query-postgres/Cargo.toml --workspace --features=with-json
- run: cargo build --manifest-path sea-query-postgres/Cargo.toml --workspace --features=with-rust_decimal
Expand All @@ -135,14 +138,16 @@ jobs:
- run: cargo build --manifest-path sea-query-postgres/Cargo.toml --workspace --features=with-ipnetwork
- run: cargo build --manifest-path sea-query-postgres/Cargo.toml --workspace --features=with-mac_address
- run: cargo build --manifest-path sea-query-postgres/Cargo.toml --workspace --features=postgres-array
- run: cargo build --manifest-path sea-query-postgres/Cargo.toml --workspace --features=postgres-vector

test:
name: Unit Test
runs-on: ubuntu-latest
needs: ["build"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo test
- run: cargo test --features=all-features
- run: cargo test --test option-more-parentheses --features=tests-cfg,option-more-parentheses

Expand All @@ -151,7 +156,7 @@ jobs:
runs-on: ubuntu-latest
needs: ["build"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --package sea-query-derive
- run: cargo test --package sea-query-derive
Expand All @@ -164,7 +169,7 @@ jobs:
matrix:
example: [rusqlite, sqlx_sqlite]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --manifest-path examples/${{ matrix.example }}/Cargo.toml
- run: cargo run --manifest-path examples/${{ matrix.example }}/Cargo.toml
Expand Down Expand Up @@ -194,7 +199,7 @@ jobs:
--health-timeout=5s
--health-retries=3
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --manifest-path examples/${{ matrix.example }}/Cargo.toml
- run: cargo run --manifest-path examples/${{ matrix.example }}/Cargo.toml
Expand Down Expand Up @@ -224,7 +229,7 @@ jobs:
--health-timeout=5s
--health-retries=3
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --manifest-path examples/${{ matrix.example }}/Cargo.toml
- run: cargo run --manifest-path examples/${{ matrix.example }}/Cargo.toml
Expand Down Expand Up @@ -253,7 +258,7 @@ jobs:
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --manifest-path examples/${{ matrix.example }}/Cargo.toml
- run: cargo run --manifest-path examples/${{ matrix.example }}/Cargo.toml
Expand All @@ -263,6 +268,6 @@ jobs:
runs-on: ubuntu-latest
needs: ["test", "derive-test", "binder-build"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --manifest-path examples/sqlx_any/Cargo.toml
50 changes: 49 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,50 @@ 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.32.0 - Pending

### Versions

+ `sea-query`/`0.32.0-rc.1`: 2024-08-09
+ `sea-query-binder`/`0.7.0-rc.1`: 2024-08-09
+ `sea-query-binder`/`0.7.0-rc.2`: 2024-08-09
+ `sea-query-rusqlite`/`0.7.0-rc.1`: 2024-08-09
+ `sea-query-postgres`/`0.5.0-rc.1`: 2024-08-09

### New Features

* Construct Postgres query with vector extension https://github.com/SeaQL/sea-query/pull/774
```rust
assert_eq!(
Query::select()
.columns([Char::Character])
.from(Char::Table)
.and_where(
Expr::col(Char::Character).eq(Expr::val(pgvector::Vector::from(vec![1.0, 2.0])))
)
.to_string(PostgresQueryBuilder),
r#"SELECT "character" FROM "character" WHERE "character" = '[1,2]'"#
);
```
* Added `postgres-vector` feature https://github.com/SeaQL/sea-query/pull/774
* Added `Value::Vector` https://github.com/SeaQL/sea-query/pull/774
* Added `ColumnType::Vector` https://github.com/SeaQL/sea-query/pull/774
* Added `ColumnDef::vector()` https://github.com/SeaQL/sea-query/pull/774
* Added `PgBinOper::EuclideanDistance`, `PgBinOper::NegativeInnerProduct` and `PgBinOper::CosineDistance` https://github.com/SeaQL/sea-query/pull/774

### Upgrades

* Upgrade `sqlx` to `0.8` https://github.com/SeaQL/sea-query/pull/798
* Upgrade `bigdecimal` to `0.4` https://github.com/SeaQL/sea-query/pull/798

## 0.31.1 - Pending

### Enhancements

* Added Md5 function https://github.com/SeaQL/sea-query/pull/786
* Added Postgres Json functions: `JSON_BUILD_OBJECT` and `JSON_AGG` https://github.com/SeaQL/sea-query/pull/787

## 0.31.0 - 2024-08-02

### Versions

Expand All @@ -18,8 +61,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
+ `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

Expand Down Expand Up @@ -152,6 +199,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
9 changes: 6 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.8"
version = "0.32.0-rc.1"
authors = [
"Chris Tsang <chris.2y3@outlook.com>",
"Billy Chan <ccw.billy.123@gmail.com>",
Expand Down Expand Up @@ -35,10 +35,11 @@ serde_json = { version = "1", default-features = false, optional = true, feature
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.4", default-features = false, optional = true }
rust_decimal = { version = "1", default-features = false, optional = true }
bigdecimal = { version = "0.3", default-features = false, optional = true }
bigdecimal = { version = "0.4", 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 All @@ -58,6 +59,7 @@ derive = ["sea-query-derive"]
attr = ["sea-query-attr"]
hashable-value = ["educe", "ordered-float"]
postgres-array = []
postgres-vector = ["pgvector"]
postgres-interval = []
thread-safe = []
with-chrono = ["chrono"]
Expand All @@ -80,6 +82,7 @@ all-features = [
"all-types",
] # everything except option-*
all-types = [
"postgres-vector",
"postgres-array",
"postgres-interval",
"with-chrono",
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
4 changes: 2 additions & 2 deletions examples/diesel_postgres/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ 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" }
mac_address = { version = "1.1" }
rust_decimal = { version = "1" }
bigdecimal = { version = "0.3" }
bigdecimal = { version = "0.4" }
diesel = { version = "2.1.1", features = ["postgres"] }
sea-query = { path = "../.." }
sea-query-diesel = { path = "../../sea-query-diesel", features = [
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
Loading

0 comments on commit 6118879

Please sign in to comment.