130 Commits

Author SHA1 Message Date
Marco Napetti
9d25ee9ac1
use GAT to elide StreamTrait lifetime (#1161) 2022-11-06 12:55:21 +08:00
Marco Napetti
9f2a6dc40b
Fix transaction metrics (#1165) 2022-10-28 01:00:04 +08:00
Billy Chan
b5b9790252
Support array datatype in PostgreSQL (#1132)
* PostgreSQL array (draft)

* Fixup

* Fixup

* Fixup

* Fixup

* Fixup

* Refactoring

* generate entity for Postgres array fields

* Add tests

* Update Cargo.toml

Co-authored-by: Chris Tsang <chris.2y3@outlook.com>
2022-10-23 18:26:57 +08:00
Billy Chan
b22db842e4
Run migrations on PostgreSQL schema (#1056)
* Run migrations on PostgreSQL schema

* fmt

* fmt & clippy

* clippy

* [cli] update helper text
2022-10-17 17:16:00 +08:00
Chris Tsang
5d752e60b9
Merge pull request #1002 from SeaQL/better-errors
Better error system
2022-10-07 00:24:41 +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
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
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
43495de0aa
Fix clippy warnings - 1 (#967)
* Fix clippy warnings

* cargo fmt

* Fix clippy warnings

* cargo fmt
2022-08-12 20:02:53 +08:00
sjud
3d409608e1
removing async_trait from non async trait in connection.rs (#737) 2022-07-17 15:12:25 +08:00
Billy Chan
1a3e8c456a
[CI] run clippy checks & fix clippy warnings (#840)
* Run clippy checks

* Fix clippy warnings

* Clippy checks for `sea-orm-*` crates

* Fix clippy warnings

* Fixup
2022-07-10 15:38:38 +08:00
Billy Chan
d6831e5295
Bump version of sqlx, sea-query, sea-schema, time and uuid (#834)
* Bump version of sqlx, sea-query, sea-schema, time and uuid

* PostgreSQL `u32` was wrapped in `Oid` (launchbadge/sqlx#1602)

* Update test cases

* Fix clippy warnings

* cargo fmt

* Fix clippy warnings

* Bump sea-schema to ^0.9.2

* Update test cases

* Pin on sea-query minor version
2022-07-05 01:05:11 +08:00
Billy Chan
80d35a9d18
cargo fmt 2022-06-28 16:13:38 +08:00
Chris Tsang
d074fafdde
Merge pull request #778 from nappa85/master
Stream metrics
2022-06-26 21:18:00 +08:00
SandaruKasa
4f26b4a585
sqlx_logging_level, a wrapper around sqlx::ConnectOptions::log_statements (#800)
* sqlx_logging_level

* ` = { version = "..." }`
2022-06-26 18:29:44 +08:00
cache-missing
73af72200a feat(sqlite3): support set sqlcipher key 2022-06-13 08:42:14 +08:00
Marco Napetti
0e1c825e9e Stream metrics 2022-05-31 12:38:38 +02:00
Marco Napetti
e80aa07c7c
Add Send to StreamTrait (#622)
* update ouroboros

* Add Send to StreamTrait
2022-03-22 17:17:07 +08:00
Billy Chan
f3a7a1398a
Merge branch 'master' into pulls/471 2022-03-07 15:52:12 +08:00
Bastian
47f2f4cec8
Easy joins with MockDatabase #447 (#455)
* Easy joins with MockDatabase #447

* fix MR

* add unit test

* Add test cases

* Cargo fmt

Co-authored-by: Bastian Schubert <bastian.schubert@crosscard.com>
Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>
Co-authored-by: Chris Tsang <chris.2y3@outlook.com>
2022-02-06 14:45:51 +08:00
Chris Tsang
e305c6669c
Merge pull request #493 from SeaQL/max-lifetime-connection-opt
Add `max_lifetime` connection option
2022-02-05 20:50:39 +08:00
Billy Chan
8eb095385d Migration (#335)
* Refactor `ConnectionTrait`

* Refactoring

* Build index & foreign key statements

* Fix imports

* Fixup

* Rocket example with migration

* async-std compatible with the tokio 1.0 runtime

* Use reexported dependency

* Compile without selecting any db backend

* Updating sea-orm-cli dep

* sea-orm-cli migrate commands

* cargo fmt

* Test [cli]

* Refactoring

* Clap app name should be "sea-orm-cli"

* Correctly capture MIGRATION_DIR

* Rename README

* Add `sea-orm-cli migrate init` command

* Update README

* Try restructured sea-query dependency (SeaQL/sea-schema#41)

* Set `DATABASE_URL` environment variable
2022-02-05 20:34:54 +08:00
Billy Chan
15dc9576ea
Add max_lifetime connection option 2022-01-28 11:51:44 +08:00
Sebastian Pütz
949e3115f5 Make TransactionStream::build sync 2022-01-19 23:55:26 +01:00
Sebastian Pütz
f012ccaec3 Add Send bound to streams. 2022-01-19 20:46:10 +01:00
Billy Chan
006d35313b
Fix clippy warnings 2021-12-17 11:39:53 +08:00
Billy Chan
4072e74284
cargo fmt 2021-12-17 11:14:54 +08:00
Marco Napetti
9a342546f3 use macro to simplify code, add failure boolean 2021-12-10 10:09:09 +01:00
Marco Napetti
aaf11dd265 Into doesn't works 2021-12-09 19:17:41 +01:00
Marco Napetti
4abe8310a5 Per-connection metric 2021-12-09 19:03:46 +01:00
Marco Napetti
6b94673dd9 First metric and tracing implementation 2021-12-09 15:12:41 +01:00
Billy Chan
fd50ffd5ea
Merge remote-tracking branch 'origin/master' into returning 2021-11-16 14:44:12 +08:00
Billy Chan
f4008f9f7c
Suppress ouroboros missing docs warnings (#288)
* Suppress `ouroboros` missing docs warnings

* Suppress warnings
2021-11-15 11:14:32 +08:00
Chris Tsang
5f2fa55253 Edit docs 2021-11-14 16:58:52 +08:00
Billy Chan
66c23c85db
Revert MySQL & SQLite returning support 2021-11-10 14:42:19 +08:00
Billy Chan
cc035d7aa7
Refactoring 2021-11-09 18:14:13 +08:00
Chris Tsang
03d90d8630 Docs 2021-11-09 16:21:12 +08:00
Billy Chan
ec637b26a0
Returning support for SQLite 2021-11-09 16:10:52 +08:00
Billy Chan
533c3cf175
Try 2021-11-09 15:38:28 +08:00
Billy Chan
24fab66d17
Try 2021-11-09 12:11:00 +08:00
Billy Chan
429b920ded
Fixup 2021-11-09 11:05:55 +08:00
Billy Chan
3e6423aa8a
This will fail loll 2021-11-08 22:55:00 +08:00
Billy Chan
17232063b3
This will fail loll 2021-11-08 22:29:18 +08:00
Billy Chan
afdb1afeb8
This will fail loll 2021-11-08 22:12:09 +08:00
Billy Chan
2f0ac4ca1d
Fixup 2021-11-08 20:11:44 +08:00
Billy Chan
30f43b64c6
Fixup 2021-11-08 19:03:06 +08:00
Billy Chan
80c0d69733
Merge remote-tracking branch 'origin/master' into returning 2021-11-08 17:37:54 +08:00
Billy Chan
0eafacc2a1
Try returning on MariaDB 2021-11-08 17:36:30 +08:00