1872 Commits

Author SHA1 Message Date
Billy Chan
597f515c07
CHANGELOG (#1019) 2022-09-25 10:20:40 +08:00
Billy Chan
6ba8e1b9f1
DeriveRelation on empty Relation enum (#1019) 2022-09-25 10:17:39 +08:00
Daniel Porteous (dport)
d77cf24e06
Fix typos in ORM CLI help messages (#1060) 2022-09-23 15:36:10 +08:00
Billy Chan
9e57574de2
Run migration script defined in SeaQuery (#1063) 2022-09-23 15:32:18 +08:00
Billy Chan
75e2570811
Fix Rust 1.64 clippy (#1064) 2022-09-23 15:32:03 +08:00
Sanford Pun
5143307b3e
Demonstrate how to mock test SeaORM by separating core implementation from the web API (#890)
* Move core implementations to a standalone crate

* Set up integration test skeleton in `core`

* Demonstrate mock testing with query

* Move Rocket api code to a standalone crate

* Add mock execution

* Add MyDataMyConsent in COMMUNITY.md (#889)

* Add MyDataMyConsent in COMMUNITY.md

* Update MyDataMyConsent description in COMMUNITY.md

* Update COMMUNITY.md

Chronological order

* [cli] bump sea-schema to 0.9.3 (SeaQL/sea-orm#876)

* Update CHNAGELOG PR links

* 0.9.1 CHANGELOG

* Auto discover and run all issues & examples CI (#903)

* Auto discover and run all [issues] CI

* Auto discover and run all examples CI

* Fixup

* Testing

* Test [issues]

* Compile prepare_mock_db() conditionally based on "mock" feature

* Update workflow job to run mock test if `core` folder exists

* Update Actix3 example

* Fix merge conflict human error

* Update usize used in paginate to u64 (PR#789)

* Update sea-orm version in the Rocket example to 0.10.0

* Fix GitHub workflow to run mock test for core crates

* Increase the robustness of core crate check by verifying that the `core` folder is a crate

* Update Actix(4) example

* Update Axum example

* Update GraphQL example

* Update Jsonrpsee example

* Update Poem example

* Update Tonic example

* Cargo fmt

* Update Salvo example

* Update path of core/Cargo.toml in README.md

* Add mock test instruction in README.md

* Refactoring

* Fix Rocket examples

Co-authored-by: Amit Goyani <63532626+itsAmitGoyani@users.noreply.github.com>
Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>
2022-09-23 12:57:43 +08:00
Billy Chan
77bddd85a5
Fixup 2022-09-22 15:07:37 +08:00
Chris Tsang
f3fb355647
Update CHANGELOG.md 2022-09-19 23:51:35 +08:00
Billy Chan
968fc2e678
Configure acquire timeout for connection pool (#897)
* Reproduce "failed to acquire connection from pool" error

* Configure acquire_timeout

* Add tests

* Fixup

* Remove tests
2022-09-19 23:50:11 +08:00
Chris Tsang
6f7529b0be
[cli] Changelog 2022-09-19 23:45:31 +08:00
Remo Senekowitsch
be0d846d8f
Enable migration generation in modules (#933)
* Enable migration generation in modules

Previously, migration generation expected migrations
to be at the crate root.

* Fix migration backup file extension

* Document behavior of migration_dir
2022-09-19 23:42:46 +08:00
Chris Tsang
4e51b8837a
Merge pull request #1041 from jimmycuadra/with-time-into-active-model
Implement `IntoActiveValue` for `time` types.
2022-09-18 18:13:59 +08:00
jimmycuadra
dbc0c72e92
Merge pull request #1 from billy1624/pr/1041
Pr/1041
2022-09-15 02:09:53 -07:00
Billy Chan
1035bbb431
Fixup 2022-09-15 16:44:31 +08:00
Billy Chan
7c591049be
Add docs 2022-09-15 16:18:13 +08:00
Billy Chan
0d31a012cc
Add tests to double check and prevent it from happening again 2022-09-15 15:41:13 +08:00
Billy Chan
8ecb4fccba
Implement IntoActiveValue for Vec<u8> types 2022-09-15 15:40:34 +08:00
Jimmy Cuadra
bde43f51f8 Implement IntoActiveValue for time types.
I tried to implement a [custom active
model](https://www.sea-ql.org/SeaORM/docs/advanced-query/custom-active-model/),
and one of the columns was `Option<TimeDateTimeWithTimeZone>`. I got a
compiler error:

```
error[E0277]: the trait bound `std::option::Option<sea_orm::prelude::TimeDateTimeWithTimeZone>: IntoActiveValue<_>` is not satisfied
```

Looking into the source code, it seemed a simple oversight that this
trait was implemented for the `chrono` types but not the `time` types,
and it was easy enough to fix since there's already a macro to implement
it for new types.

I also noticed that the `time` types are not accounted for in
`src/query/json.rs` while the `chrono` types are, which I assume is also
an oversight. However, I don't have a need for that at this point and
the fix for that seemed less trivial, so I'm just bringing it to your
attention.

Thanks for SeaORM!
2022-09-14 22:58:05 -07:00
Chris Tsang
1225255431 Address comments 2022-09-14 00:28:24 +08:00
Zoe Faltibà
2f4c481280
Community.md (#1027) 2022-09-13 11:58:13 +08:00
Ivan Krivosheev
c2e98b56a8 issues-969 Patch sea-orm-codegen 2022-09-09 21:00:01 +03:00
Ivan Krivosheev
52531db70f
Merge pull request #970 from ikrivosheev/feature/issues-969_sea-query-binder
issues-969 Replace sea-query-driver to sea-query-binder
2022-09-09 11:34:27 +03:00
Ivan Krivosheev
ab5b488860
Merge branch 'sea-query-v0.27' into feature/issues-969_sea-query-binder 2022-09-08 12:59:09 +03:00
Ivan Krivosheev
ecbd7c2713 issues-969 Update dependencies
issues-969 Fix sqlx_query function
2022-09-08 12:56:32 +03:00
Ivan Krivosheev
bac22d30c5 issues-969 sea-query-binder make optional
Update Cargo.toml

Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>
2022-09-08 12:55:27 +03:00
Ivan Krivosheev
581684c441 issues-969 Replace sea-query-driver to sea-query-binder 2022-09-08 12:54:37 +03:00
Billy Chan
d532deb636
Update COMMUNITY.md
Shout out to @bkonkle for the great article
2022-09-05 15:33:02 +08:00
Michael Lohr
5d785ca908
Update COMMUNITY.md (#1014)
Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>
2022-09-05 12:03:05 +08:00
Dionysus
967fd68649
Add MoonRamp under Built with SeaORM (#1013)
Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>
2022-09-05 12:02:19 +08:00
Wyatt Herkamp
dd2dc5dd56
Add's Nitro_Repo (#1012)
Closes https://github.com/wyatt-herkamp/nitro_repo/issues/478

Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>
2022-09-05 12:00:52 +08:00
Chris Tsang
e919831e72
Update CHANGELOG.md 2022-09-05 00:41:51 +08:00
Billy Chan
a80c33ef4c
Rewrite enum and text casting (#973)
* Rewrite enum and text casting

* Add doc tests

* Refactoring
2022-09-05 00:38:12 +08:00
Chris Tsang
a0bd359c65
Update COMMUNITY.md 2022-09-04 23:41:01 +08:00
Chris Tsang
9ea34984fb
Update COMMUNITY.md 2022-09-04 23:30:59 +08:00
Samuel Boyden
1ff53d81d8
Add CodeCTRL to COMMUNITY.md (#1015) 2022-09-04 23:15:16 +08:00
Chris Tsang
36f09c524e
Update src/error.rs
Co-authored-by: Sculas <contact@sculas.xyz>
2022-09-03 20:45:17 +08:00
Chris Tsang
4993c6ab2d
Update src/error.rs
Co-authored-by: Sculas <contact@sculas.xyz>
2022-09-03 20:45:09 +08:00
Chris Tsang
4d95218430
Update src/error.rs
Co-authored-by: Sculas <contact@sculas.xyz>
2022-09-03 20:44:59 +08:00
Chris Tsang
1c8ef33544
Update src/error.rs
Co-authored-by: Sculas <contact@sculas.xyz>
2022-09-03 20:44:45 +08:00
Billy Chan
d016f66a5f
Cargo.toml specify SeaORM homepage 2022-09-02 15:12:16 +08:00
Billy Chan
5f3210c62a
Fix [issues] 2022-09-01 16:52:03 +08:00
Billy Chan
6564ddac15
Testing [issues] [cli] 2022-09-01 16:39:18 +08:00
Billy Chan
4e835f2ee1
. 2022-09-01 16:38:47 +08:00
Billy Chan
0efdfc6742
Typo 2022-09-01 15:57:58 +08:00
Chris Tsang
85533a3bb3 Give up and fix tests 2022-08-28 14:54:26 +08:00
Chris Tsang
0ce0f49551 Refactor SqlxError; 2022-08-28 13:51:21 +08:00
Chris Tsang
348e841139 Refactor ColumnFromStrErr 2022-08-28 13:30:51 +08:00
Chris Tsang
0b754eab0b Refactor Type Errors 2022-08-28 12:59:33 +08:00
mohs8421
fe6c40dd75
Introducing sqlx-error feature (#750)
* feat: Introducing feature "sqlx-error"

Purpose of this feature is to not convert errors given from sqlx into strings to ease further analysis of the error and react to it accordingly. This implementation uses a feature switch and an additional error kind to avoid interfering with existing implementations without this feature enabled.
See discussion https://github.com/SeaQL/sea-orm/discussions/709

* fix: Align feature "sqlx-error" with merged Migration error kind

Due to the merge, an other error kind had been introduced and the DbErr became Eq and Clone, however Eq cannot easily be derived from, so I went back to PartialEq, and since the sqlx error does not implement clone, this was converted into an Arc, to allow cloning of the new kind too.

* fix: Repairing failing jobs

Several jobs had failed as I missed to correct the return values of a few methods in transaction.rs and had a wrong understanding of map_err at that point.

* feat: realigning with latest changes in sea-orm, different approach

Instead of the former approach to introduce a new error kind, now the existing error types get extended, for now only Exec and Query, because these are the most relevant for the requirement context.
Afterwards it might still be possible to add some further detail information.
See discussion https://github.com/SeaQL/sea-orm/discussions/709

* Update src/driver/sqlx_mysql.rs

Integrating fixes done by @Sculas

Co-authored-by: Sculas <contact@sculas.xyz>

* Update src/driver/sqlx_postgres.rs

Integrating fixes done by @Sculas

Co-authored-by: Sculas <contact@sculas.xyz>

* Update src/driver/sqlx_sqlite.rs

Integrating fixes done by @Sculas

Co-authored-by: Sculas <contact@sculas.xyz>

* feat: reworking feature with thiserror

Following the latest suggestions I changed the implementation to utilize `thiserror`.
Now there are more error kinds to be able to see the different kinds directly in src/error.rs
To ensure the behaviour is as expected, I also introduce a further test, which checks for a uniqueness failure.

Co-authored-by: Sculas <contact@sculas.xyz>
2022-08-28 11:13:51 +08:00
Billy Chan
9b6b879122
Migrator test cases with tracing_subscriber 2022-08-25 13:56:41 +08:00