43 Commits

Author SHA1 Message Date
Chris Tsang
0670827148 Improve test cases 2023-02-02 07:46: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
Chris Tsang
bb5dead0c8 Docs 2023-01-12 13:55:39 +08:00
Billy Chan
e246d3faaf
Cont. Upgrade to SeaQuery 0.28.0 (#1366)
* Upgrade to SeaQuery 0.28.0

* Remove unnecessary heap allocation

* Upgrade sea-query-binder

* Upgrade sea-schema

* Fix

* Upgrade sea-schema

* refactoring

Co-authored-by: Ivan Krivosheev <py.krivosheev@gmail.com>
2023-01-05 20:41:28 +08:00
Chris Tsang
7e630157a0
Docs 2023-01-01 19:23:38 +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
f6672137a2
cargo fmt 2022-07-26 12:20:40 +08:00
Chris Tsang
12d3e602f2 Test 2022-07-23 14:55:47 +08:00
Chris Tsang
b48f43bc09 Docs 2022-07-21 23:39:27 +08:00
Billy Chan
83c6e4a4db
RelationDef & RelationBuilder are Send & Sync (#898)
* `RelationDef` & `RelationBuilder` are `Send` & `Sync`

* [issues] add tests

Co-authored-by: Chris Tsang <chris.2y3@outlook.com>
2022-07-21 23:35:20 +08:00
Billy Chan
75cb269ceb
Custom join on conditions (#793)
* Custom join on conditions

* Try lambda approach

* Implement debug for relation

* Add example without `rev`

* Add more examples

* Docs
2022-06-29 00:27:55 +08:00
Billy Chan
76c0d7fff5
Name conflict of foreign key constraints when two entities have more than one foreign keys (#417)
* fix: name conflict of foreign key constraints when two entities have more than one fk

* test: update test case's foreign keys

* feat: override default name of foreign key constraint
2022-01-28 01:03:24 +08:00
Charles Chege
db098d1a03 Documetation for the entity module 2021-10-29 10:39:16 +03:00
Chris Tsang
8a4996300f Refactor Link 2021-09-15 12:17:21 +08:00
Billy Chan
7f38621c3c
Set clippy deny 2021-09-03 14:26:57 +08:00
Billy Chan
8cde6e46e4
Merge branch 'master' into linked-api 2021-09-03 12:14:39 +08:00
Billy Chan
5073c6f4aa
Relation with optional ForeignKeyAction 2021-09-01 10:35:51 +08:00
Billy Chan
5fbc7b146a
Refactoring & Testing 2021-08-31 18:31:01 +08:00
Billy Chan
9db0748c64
Non-static link 2021-08-28 20:20:34 +08:00
Billy Chan
447947e355
Fix find_linked join direction 2021-08-26 23:28:27 +08:00
Billy Chan
31941d3af6
WIP: Linked (#89) 2021-08-23 23:11:08 +08:00
Billy Chan
38ace07e83 Schema prefix in table join 2021-08-14 18:43:07 +08:00
Billy Chan
e76928f1cc Support join on multiple columns 2021-08-14 00:01:40 +08:00
Chris Tsang
cbf16102c0 has_one and belongs_to 2021-06-22 15:52:22 +08:00
Chris Tsang
d77a7c8ab4 Has many relation to be auto defined 2021-06-22 01:30:21 +08:00
Billy Chan
cab4b5a3f7
Codegen: Entity Generator (#23) 2021-06-19 19:47:59 +08:00
Chris Tsang
b308486192 Refactor Query traits 2021-06-08 22:10:27 +08:00
Chris Tsang
f26e95c9e3 Use SeaRc 2021-06-07 21:20:23 +08:00
Chris Tsang
89c743d5a7 QueryTrait 2021-06-01 18:08:18 +08:00
Chris Tsang
8a1329a7b5 SelectHelper 2021-06-01 17:31:32 +08:00
Chris Tsang
d3ee74cbe5 Insert POC 2021-05-28 00:38:34 +08:00
Chris Tsang
8886269616 Many to many by reverse relation 2021-05-19 21:48:51 +08:00
Chris Tsang
d5cdeb1fe0 Test case 2021-05-18 00:37:47 +08:00
Chris Tsang
7bf8ab0202 Many to many prototype 2021-05-18 00:18:55 +08:00
Chris Tsang
acdee45744 Trait bound RelationBuilder 2021-05-17 23:34:29 +08:00
Chris Tsang
1bec83ff64 Join APIs 2021-05-12 14:41:09 +08:00
Chris Tsang
486a081509 Improve API 2021-05-09 21:11:32 +08:00
Chris Tsang
c72d7b0289 Rename 2021-05-09 02:43:40 +08:00
Chris Tsang
df03a78702 Find related 2021-05-09 02:14:40 +08:00
Chris Tsang
89af820f2c Reverse join 2021-05-09 00:39:38 +08:00
Chris Tsang
3f5b0080da Rename traits 2021-05-08 14:58:41 +08:00
Chris Tsang
7d99d33aa2 Select 2021-05-07 05:57:51 +08:00
Chris Tsang
af4fb2ab7d Initial Commit 2021-05-07 03:35:46 +08:00