1881 Commits

Author SHA1 Message Date
Billy Chan
8982d88774
Skip implementing Related if the same related entity is being referenced by a conjunct relation (#1298) 2022-12-17 12:52:04 +08:00
Billy Chan
7757a46c46
clippy 2022-12-16 21:36:00 +08:00
Billy Chan
d6dc3f8a19
CHANGELOG 2022-12-16 21:34:58 +08:00
Antonio Scandurra
df2dcdabac
Prevent returning connections to pool with a positive transaction depth (#1283)
Mark transaction as closed *only* after commit/rollback succeeds.

Previously, `open` on the transaction would be set to `false` prior to attempting
to commit or rollback the transaction. When the operation failed, for example, due
to a serialization failure with a serializable isolation level, this would leave
the transaction in an inconsistent state, where it thought it was closed but really
it was still open. The connection would then be returned to the connection pool with
a transaction depth of 1, causing a savepoint to be erroneously created the next time
a transaction was created for the connection.

By waiting to set `open` to `false` until the commit/rollback succeeds, a failure
to do either will result in us correctly rolling back the transaction when dropping
it, ensuring that the connection is returned to the pool with a transaction depth
of 0. Note that this is consistent with how `sqlx` handles transactions.

We attempted to write a test, but had a very difficult time forcing postgres to fail
to commit a transaction. We found that it would block our requests instead when creating
conflicting updates, and we couldn't find any information about when it blocks vs when
transaction commits fail.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>

Co-authored-by: Nathan Sobo <nathan@zed.dev>
2022-12-16 21:11:51 +08:00
Billy Chan
69eb4b8ea8
Refactor the use of deprecated chrono methods (#1312) 2022-12-16 18:14:25 +08:00
Billy Chan
ccca35ab1a
clippy 2022-12-16 16:48:16 +08:00
Billy Chan
596afd2081
CHANGELOG 2022-12-16 15:53:58 +08:00
Billy Chan
b2185af559
Cleaning up dependency (#1300)
* Dependency version cleanup

* Update build tool

* Disable default features

* [cli] disable default features
2022-12-16 15:52:00 +08:00
Liam
5b9c49a9a0
Add wikipedia-speedrun to COMMUNITY.md (#1302) 2022-12-14 14:32:03 +08:00
Chris Tsang
24388adb59
Update CHANGELOG.md 2022-12-08 00:08:57 +08:00
ttys3
0c40345e1b
chore: upgrade to axum 0.6.1 version (#1285) 2022-12-08 00:06:23 +08:00
Billy Chan
23b6e66c2e
[CI] use dtolnay/rust-toolchain (#1284)
* Try dtolnay/rust-toolchain

* Fixup

* Remove deprecated set-output

* Fixup

* Remove unused
2022-12-06 20:38:23 +08:00
Chris Tsang
86781e1899
Update CHANGELOG.md 2022-12-06 12:04:18 +08:00
Billy Chan
fa94521c25
[issues] fully qualified IdenStatic::as_str() (#1280) 2022-12-06 12:00:43 +08:00
Chris Tsang
ee2afc4b91 Changelog 2022-12-02 14:49:02 +08:00
Chris Tsang
17375e1fe4 Changelog 2022-12-02 14:46:03 +08:00
Chris Tsang
387e8de102 Changelog 2022-12-02 13:42:40 +08:00
Billy Chan
7838782718 Transaction tests 2022-12-02 13:37:37 +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
95157e6e6b
CHANGELOG 2022-12-01 14:02:51 +08:00
Billy Chan
ccb8818365
Add QuerySelect::columns method (#1264) 2022-12-01 14:01:11 +08:00
Billy Chan
f45f487105
CHANGELOG 2022-12-01 13:24:41 +08:00
Billy Chan
3de0078a31
Optimize TryGetableFromJson (#1249) 2022-12-01 13:23:24 +08:00
Billy Chan
cab4b2b037
CHANGELOG 2022-12-01 13:22:19 +08:00
jiayi
8e888eda7b
generate Related for many-to-many relation with extra columns (#1260) 2022-12-01 13:14:20 +08:00
Billy Chan
dd7454a738
CHANGELOG 2022-12-01 12:55:33 +08:00
Billy Chan
08cb44028e
Support bigdecimal::BigDecimal (#1258)
* Fix: fields with type `Option<T>` are always nullable

* Support BigDecimal
2022-12-01 12:53:19 +08:00
Billy Chan
e0974a1cf9
CHANGELOG 2022-12-01 12:52:43 +08:00
Billy Chan
2389a4c83e
Fix: fields with type Option<T> are always nullable (#1257) 2022-12-01 12:27:49 +08:00
Billy Chan
d32e1eb058
[CLI] fixup - generate entity file for all tables by default (#1251) 2022-11-24 20:21:52 +08:00
Chris Tsang
b0979072ae
Update CHANGELOG.md 2022-11-24 16:18:02 +08:00
Chris Tsang
5b931a5f4c
Update CHANGELOG.md 2022-11-24 16:16:10 +08:00
Chris Tsang
029265e410 Changelog 2022-11-24 13:45:04 +08:00
Chris Tsang
ca403da0d9
Mock DbErr (#1241)
* Mock Err

* Test mock errors
2022-11-24 13:42:47 +08:00
Billy Chan
c2e671ded2
CHANGELOG 2022-11-24 12:23:39 +08:00
Billy Chan
d30a5612f8
[CLI] generate entity file for specified tables only (full text matching, not substring matching) (#1245) 2022-11-24 12:21:16 +08:00
Billy Chan
cd672514ab
CHANGELOG 2022-11-24 12:20:05 +08:00
Billy Chan
a7c8970800
[sea-orm-cli] generate entity with relation variant order by name of reference table (#1229) 2022-11-24 12:15:31 +08:00
Chris Tsang
80c81eaffe
Update CHANGELOG.md 2022-11-22 13:55:50 +08:00
Billy Chan
115e19a95e
Close connection explicitly (#1236)
* Close connection and transaction

* Close connection only
2022-11-22 13:55:03 +08:00
Tim de Jager
f65c931751
Added prefix.dev as a startup (#1240) 2022-11-22 10:51:56 +08:00
Chris Tsang
3fed282daf Update my email 2022-11-21 16:02:04 +08:00
Andrei
9e77760376
Update COMMUNITY.md (#1234) 2022-11-18 10:46:37 +08:00
Chris Tsang
19f0ecd0bc Readme 2022-11-16 14:09:48 +08:00
Chris Tsang
0ac8ff8db7 Update Spyglass 2022-11-16 13:53:09 +08:00
Chris Tsang
df5fc02827
Update CHANGELOG.md 2022-11-15 15:13:23 +08:00
Chris Tsang
777aa596a5
Update CHANGELOG.md 2022-11-15 15:11:02 +08:00
Billy Chan
9d2ea8deec
Dependency cleanup (#1213)
* Dependency cleanup

* Bump sea-query dependency

* Bump sea-query-binder
2022-11-15 15:10:03 +08:00
Chris Tsang
1bcc8c7b5e
Update CHANGELOG.md 2022-11-15 14:41:32 +08:00
Billy Chan
4d8645ae8b
Support Vector of enum for Postgres (#1210)
* Support Vector of enum for Postgres

* Fix clippy

* Add tests for integer array

* Fix dependency

* Bump sea-query to 0.27.2

Co-authored-by: Chris Tsang <chris.2y3@outlook.com>
2022-11-15 13:50:05 +08:00