37 Commits

Author SHA1 Message Date
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
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
4072e74284
cargo fmt 2021-12-17 11:14:54 +08:00
Marco Napetti
6b94673dd9 First metric and tracing implementation 2021-12-09 15:12:41 +01:00
Charles Chege
91b9e542af Documetation for the database modeule 2021-10-29 10:37:10 +03:00
Chris Tsang
09324db1b0 Stream example 2021-10-16 01:02:25 +08:00
Chris Tsang
75882b34cb Transaction with BEGIN 2021-10-14 18:33:13 +08:00
Chris Tsang
ecaa0dca18 Edit 2021-10-11 18:50:05 +08:00
Chris Tsang
1a2bd13158 Nested transaction unit tests 2021-10-11 18:39:46 +08:00
Chris Tsang
f94c33d1ea Explicit COMMIT and ROLLBACK in Mock 2021-10-11 12:11:40 +08:00
Chris Tsang
91efa1fae2 Test streaming in transaction 2021-10-09 21:45:25 +08:00
Chris Tsang
018f7dd19f Streaming for MockConnection 2021-10-09 21:14:24 +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
df4df87d09 Rename Transaction -> MockTransaction 2021-10-04 21:37:12 +08:00
Chris Tsang
6b98a6f395 Move code 2021-10-04 20:40:44 +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
b22753bebf Test try_join! 2021-09-20 18:30:31 +08:00
Chris Tsang
303a0f32d6 cargo fmt 2021-07-19 11:15:31 +08:00
Chris Tsang
9334d4ff5d DbBackend alias 2021-07-17 22:03:41 +08:00
Billy Chan
e83cc63e3a Replacing Syntax & *BuilderBackend with DatabaseBackend 2021-07-16 00:28:03 +08:00
Billy Chan
d59ee1e298 Mock any database 2021-07-14 21:31:59 +08:00
Chris Tsang
6ff5a32b7a cargo fmt 2021-07-11 22:08:37 +08:00
Chris Tsang
f5ac84f915 Rework DbErr 2021-06-30 23:56:26 +08:00
Chris Tsang
30ac326d5c Rename to DbErr::Exec and DbErr::Conn 2021-06-30 21:21:06 +08:00
Chris Tsang
0298cfb6af Rename to DbErr 2021-06-30 21:17:23 +08:00
Billy Chan
2a1173c174
Add & use OrmError (#36)
* Add & use OrmError

* Rename to SeaErr
2021-06-30 21:08:41 +08:00
Chris Tsang
5002c62b40 Use DatabaseConnection in place of Database 2021-06-19 17:28:07 +08:00
Chris Tsang
f9ba6eeb1f Transaction 2021-06-19 16:42:11 +08:00
Chris Tsang
820bbad9de impl IntoMockRow 2021-06-19 02:47:36 +08:00
Chris Tsang
f4611c4939 Refactor 2021-06-19 02:24:45 +08:00
Billy Chan
62fb43c605
Add unit test for pagination (#20)
* Add unit test for pagination

* End with empty page

* Add more test cases

* Assert transaction log

* Test utils

* Feature gated

* IntoMockRow, derive macro with into MockRow

* Revert derive macro

* WIP

* WIP

* assert_transaction_log
2021-06-18 23:43:07 +08:00
Chris Tsang
5c3bd08b99 For verification 2021-06-13 23:58:01 +08:00
Chris Tsang
faffc518ae Mock test case 2021-06-13 23:38:21 +08:00
Chris Tsang
6b7ea75393 Mock Database Connection 2021-06-13 22:20:50 +08:00