1917 Commits

Author SHA1 Message Date
Billy Chan
8781c03a35
CHANGELOG 2023-01-05 15:43:43 +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
Chris Tsang
d80e61ed7e
Add files via upload 2023-01-02 18:26:20 +08:00
Chris Tsang
7e630157a0
Docs 2023-01-01 19:23:38 +08:00
Chris Tsang
bef37c3e2d
Update CHANGELOG.md 2022-12-28 21:50:15 +08:00
Chris Tsang
26ee7fcf98
Update CHANGELOG.md 2022-12-28 21:49:41 +08:00
Chris Tsang
eeec2cf06f
Merge pull request #1238 from karatakis/dataloader
[PIP] Simple data loader
2022-12-28 15:59:04 +08:00
Chris Tsang
7f96418fa3
Small tweak 2022-12-28 15:57:40 +08:00
Billy Chan
db6be517b1
CHANGELOG 2022-12-23 18:33:11 +08:00
Billy Chan
863c81d7ab
CHANGELOG 2022-12-23 18:00:02 +08:00
Billy Chan
83d46d9786
CHANGELOG 2022-12-20 15:00:09 +08:00
Billy Chan
384ac1bea6
Cont. sea-orm-cli Implement derives & attributes parameters for entity generation (#1321)
* sea-orm-cli Implement derives & attributes parameters for entity generation (#1124)

* implement derives & attributes for cli

* fmt and clippy fix

* use comma delimiter for attributes arg

* Update help message use `'` instead of `"` to quote

* Refactoring

* remove unnecessary cloning

Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>

* [CLI] generate model with extra derives and attributes

* clippy

Co-authored-by: Isaiah Gamble <77396670+tsar-boomba@users.noreply.github.com>
2022-12-20 12:59:42 +08:00
Billy Chan
9282ce2ded
Cont. Add serde skip options for hidden columns to the CLI (#1320)
* Add serde skip options for hidden columns to the CLI (#1171)

* Add serde skip options for hidden columns to the CLI

* Resolve rustfmt and clippy issues

* Use SerdeDeriveOptions instead of WithSerde in tests

* Resolve upstream conflict

Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>

* [CLI] serde_skip_hidden_column

* clippy

* clippy

Co-authored-by: Jacob Trueb <jtrueb@northwestern.edu>
2022-12-20 00:43:21 +08:00
Billy Chan
3f00725ee2
Cli serde skip deserialize for primary key option (#1186) (#1318)
* Cli serde skip deserialize for primary key option (#1186)

* Add CLI option to skip primary keys with serde

Implements: https://github.com/SeaQL/sea-orm/issues/841

* Codegen: fix tests

* complete skip_deserialize cli feature

* run fmt

* fix tests

Co-authored-by: witcher <witcher@wiredspace.de>

* [cli] should be `#[serde(skip_deserializing)]`

* [CLI] code refactor

* [cli] rename

Co-authored-by: Isaiah Gamble <77396670+tsar-boomba@users.noreply.github.com>
Co-authored-by: witcher <witcher@wiredspace.de>
2022-12-19 22:11:45 +08:00
mohs8421
1f27837f49
refactoring Schema to expose functions for database updates (#1256)
* extracting get_column_def from create_table_from_entity to make it available for database upgrade processes.

* Align code example formatting

* Converting the foreign key related code from create_table_from_entity into From<RelationDef> implementations to make its usage easier in different context, like updating a database.

* Refactor

* Fixup

Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>
2022-12-19 17:24:11 +08:00
Billy Chan
17ed7156c4
Fix: update many cast enum values (#1178) 2022-12-19 17:09:18 +08:00
Billy Chan
d205338f3f
Try custom vector field (#1273) 2022-12-19 17:08:32 +08:00
Billy Chan
0e3a7c84ae
CHANGELOG 2022-12-17 13:08:27 +08:00
Billy Chan
5809535fb0
CHANGELOG 2022-12-17 13:02:05 +08:00
Billy Chan
33a665c683
[CLI] sea-orm-cli depends on codegen of the same version (#1299) 2022-12-17 12:59:16 +08:00
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