Billy Chan
9b54797dd7
Upgrade SQLx to v0.7 ( #1742 )
...
* Upgrade SQLx to v0.7
* Refactoring
* Fixup
* Bump SeaSchema version
* Fixup
* Refactoring
* Refactoring
* dep
* Bump
* Update sea-schema
* Update sea-schema
---------
Co-authored-by: Chris Tsang <chris.2y3@outlook.com>
2023-07-22 01:56:48 +08:00
darkmmon
fd4aab7a8c
Connection acquire expand ( #1737 )
...
* Try connection pool acquire timeout
* expanded ConnectionAcquire Errors, and adjusted relevant functions
* updated to include ClosedConnection
removed unknown as variant of ConnectionAcquireError
updated DbErr Eq
* revert mistakenly edited code
* prolonged the timeout time for connection timeout tests
* Revert "prolonged the timeout time for connection timeout tests"
This reverts commit 04d98cf1fdafe64dbe6168b3bbcdcc813329ac4c.
* Error PartialEq & Eq
* fn conn_acquire_err
* refactor code with conn_acquire_err
* fmt
* error msg
---------
Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>
2023-07-13 23:24:12 +08:00
Billy Chan
acca634e03
Revert "Upgrade SQLx to v0.7"
...
This reverts commit 832fabf8ff296896231c0d00bc42ecde779c6d5f.
2023-07-07 16:31:15 +08:00
Billy Chan
832fabf8ff
Upgrade SQLx to v0.7
2023-07-07 16:30:21 +08:00
Clément Guiton
3ccb9cdbf7
Feat: Expose ping method from SQLx ( #1627 )
...
* feat: add connection.ping method
* fmt
* impl `ConnectionTrait::ping` method for `SchemaManagerConnection`
* Mock connection should always be online
* remove needless clippy lint
* fmt
* Remove needless instrument
* Update src/driver/sqlx_sqlite.rs
* <feat>(Ping) removed ping() from ConnectionTrait
* removed ping from transaction
* removed unused imports
* Revert
---------
Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>
Co-authored-by: Chris Tsang <chris.2y3@outlook.com>
2023-06-01 18:21:38 +08:00
Billy Chan
91c4930391
Cleanup panic and unwrap ( #1231 )
...
* Add clippy linter checks
* Mock
* InnerConnection
* panic -> Err
* panic -> Err
* More panic -> Err
* Replace unwrap
* Fix clippy
* add clippy linters
* Refactor
* Dump DbErr::Mock
* Revert if...else rewrite
* Remove except
* DbErr helper functions
* Fix clippy
* Negative SQLite last_insert_rowid throw unreachable
* Update panics docs
* Fixup
* Fixup
* Fixup
* Fixup
* Revert adding `ExecResultHolder::Disconnected`
* More fixup
* Fix
* Revert adding `QueryResultRow::Disconnected`
* Fix
* Refactoring
* Fix
* Refactoring
* More refactoring
* More refactoring
* Fix
* Revert `InnerConnection::Disconnected`
* Revert breaking changes
* Fix
* Fix
* Fix
* Refactor `.take().expect()`
* Revert changing `if ... else` to `match` block
* Revert changing return type of `MockDatabaseConnection` transaction method
* Borrow sqlcipher_key
* Fetching unsupported type from query result will thrown `DbErr::Type(...)` error
* Revert adding `DatabaseConnection::try_into_transaction_log()` method
* Refactoring
* Refactoring
2023-02-02 00:02:53 +08:00
Billy Chan
b21abf617f
Fix clippy warnings ( #1437 )
2023-01-31 16:46:44 +08:00
Billy Chan
e927a0e5f5
Execute unprepared statement ( #1327 )
2023-01-05 14:08:18 +08:00
Billy Chan
d332afa99c
Get SQLx connection pool ( #1297 )
2023-01-05 14:08:10 +08:00
Marco Napetti
824158457b
Transactions Isolation level and Access mode ( #1230 )
...
* Transactions Isolation level and Access mode
* Fix typo
* Fix clippy lints
2022-12-02 13:09:23 +08:00
Billy Chan
115e19a95e
Close connection explicitly ( #1236 )
...
* Close connection and transaction
* Close connection only
2022-11-22 13:55:03 +08:00
Billy Chan
29da37b4f2
Merge branch 'master' into sea-query-v0.27
2022-10-17 17:53:41 +08:00
Billy Chan
671d79469a
Fixup
2022-10-17 17:25:35 +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
Billy Chan
77bddd85a5
Fixup
2022-09-22 15:07:37 +08:00
Chris Tsang
1225255431
Address comments
2022-09-14 00:28:24 +08:00
Ivan Krivosheev
ecbd7c2713
issues-969 Update dependencies
...
issues-969 Fix sqlx_query function
2022-09-08 12:56:32 +03:00
Ivan Krivosheev
581684c441
issues-969 Replace sea-query-driver to sea-query-binder
2022-09-08 12:54:37 +03: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
Ryuma Taguchi
d262501a44
fix typo in SqlxPostgresConnector::connect()
doc ( #968 )
2022-08-15 23:30:27 +08:00
Horu
3a3fdf49a1
Fix small typo ( #928 )
2022-08-01 15:03:08 +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
Sebastian Pütz
f012ccaec3
Add Send bound to streams.
2022-01-19 20:46:10 +01: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
f9d04fc73f
Hotfix - separate counter for mock exec & query
2021-11-16 17:21:44 +08:00
Chris Tsang
5f768aa436
Merge pull request #312 from SeaQL/detailed-conn-errors
...
Detailed connection errors
2021-11-15 10:47:50 +08:00
Chris Tsang
5f2fa55253
Edit docs
2021-11-14 16:58:52 +08:00
Billy Chan
da705f6629
Detailed connection errors
2021-11-11 16:58:11 +08:00
Billy Chan
fcf3ea9407
Try fixing some doctest errors
2021-10-31 14:40:36 +08:00
Charles Chege
e0023611a2
Improve documentation for the drivers and the entity
...
Provide module level code example on how to create an Entity, Model, ActiveModel, Column and PrimaryKey
2021-10-30 11:15:43 +03:00
Charles Chege
a1382b1b41
Fix merge conflicts from SeaQL/sea-orm master branch
2021-10-29 10:44:09 +03:00
Charles Chege
e4d115b5b0
Document the database drivers
2021-10-29 10:39:37 +03:00
Chris Tsang
8338c23341
Do not override max_connections for SQLite
2021-10-29 14:24:54 +08:00
Chris Tsang
1d6e6066cd
Allow disable SQLx logging
2021-10-13 16:41:51 +08:00
Chris Tsang
c673017b97
ConnectOptions
2021-10-13 02:40:33 +08:00
Chris Tsang
7bc6477091
Merge branch 'master' into transaction-3
2021-10-12 14:24:35 +08:00
Chris Tsang
eb87b7c2ce
Test case
2021-10-08 16:56:36 +08:00
Chris Tsang
a2ec6cd351
Rename MockTransaction -> Transaction
2021-10-07 18:00:11 +08:00
Chris Tsang
c7532bcc08
Basic MockTransaction implementation
...
TODO: nested transaction
2021-10-05 19:33:41 +08:00
Chris Tsang
8d0ba28b7e
Fix clippy warning
2021-10-04 22:40:17 +08:00
Chris Tsang
df4df87d09
Rename Transaction -> MockTransaction
2021-10-04 21:37:12 +08:00
Chris Tsang
e7b822c65d
cargo fmt
2021-10-04 11:44:02 +08:00
Marco Napetti
02ebc9745c
Transaction 3
2021-10-04 11:39:16 +08:00
Billy Chan
a1a7a98a5c
Set SqlxSqlit pool max connection to 1
2021-09-28 18:21:00 +08:00