38 Commits

Author SHA1 Message Date
Billy Chan
9ca01b3e7c
Upgrade tracing-subscriber dependency to 0.3.17 (#1609)
* Upgrade `tracing-subscriber` dependency to 0.3.17

* Revert "fix: `regex` dep should enable `unicode` feature (#1605)"

This reverts commit 41d9a853342155e0b7df4afb15990225b1c8a981.
2023-04-24 14:21:15 +08:00
Chris Tsang
f50dc1dd1c [issues] test case 2023-01-18 19:23:29 +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
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
Billy Chan
fa94521c25
[issues] fully qualified IdenStatic::as_str() (#1280) 2022-12-06 12:00:43 +08:00
Billy Chan
1497c2c7f0
Fix DeriveActiveEnum requires additional imports (#1154)
* fix: Support deriving ActiveEnum without importing EnumIter, Iden, and ActiveEnum

* style: Fix format

* DeriveActiveEnum without depending on sea_query::Iden derive macros

* [issues] add tests

* Fix [issues] features

Co-authored-by: Naoki Ikeguchi <me@s6n.jp>
2022-10-27 00:17:46 +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
Chris Tsang
5d752e60b9
Merge pull request #1002 from SeaQL/better-errors
Better error system
2022-10-07 00:24:41 +08:00
Horu
d9ac2f1509
fix(deps): dotenv -> dotenvy (#1085) 2022-10-05 23:19:48 +08:00
Billy Chan
6ba8e1b9f1
DeriveRelation on empty Relation enum (#1019) 2022-09-25 10:17:39 +08:00
Chris Tsang
1225255431 Address comments 2022-09-14 00:28:24 +08:00
Billy Chan
5f3210c62a
Fix [issues] 2022-09-01 16:52:03 +08:00
Chris Tsang
0b754eab0b Refactor Type Errors 2022-08-28 12:59:33 +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
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
9983e5d498
Update [issues] 2022-07-06 17:07:07 +08:00
Billy Chan
74b4d80f9d
Update [issues] 2022-07-06 17:02:59 +08:00
Billy Chan
840f8f6148
DeriveEntityModel macros override column name (#695)
* Override column name with the name of model field in `DeriveEntityModel` macros [issues]

* Fixup: trim prefix and tailing underscore

Co-authored-by: Chris Tsang <chris.2y3@outlook.com>
2022-05-09 22:08:59 +08:00
Billy Chan
5a123b36aa
DerivePrimaryKey with custom primary key column name (#694)
* `DerivePrimaryKey` with custom primary key column name

* Add test cases [issues]
2022-05-09 22:00:04 +08:00
Chris Tsang
929b85131c [issues] 2022-03-21 01:12:54 +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
2e038a7eae
feat: allow model with generics attribute (#400) 2022-01-14 01:18:13 +08:00
Chris Tsang
2bc5863977 Remove issues/386 2021-12-25 11:33:21 +08:00
Billy Chan
9036d27da7
Codegen SQLite (#386)
* Codegen SQLite

* Remove debugging

* Fixup

* Add SQLite "sakila.db" demo [issues]
2021-12-25 11:31:47 +08:00
Billy Chan
2d5aa2a61b
Log with tracing-subscriber (#399)
* chore: log examples with tracing-subscriber

* chore: log [issues] with tracing-subscriber

* chore: log [cli] with tracing-subscriber

* feat: tracing will emit log if tracing-subscriber is not setup
2021-12-24 23:59:37 +08:00
Emile Fugulin
aaec1bc845 Use attribute instead of compilation flag 2021-12-08 13:50:34 -05:00
Billy Chan
90122374aa
Add test cases [issues] 2021-12-07 16:13:25 +08:00
Billy Chan
1229287fd8
Support Up to 6 Values Composite Primary Key (#353)
* Support up to 6 composite primary key

* Test [issues]

* Test [issues]
2021-12-04 20:57:05 +08:00
Billy Chan
f809242c1f
Test [issues] 2021-11-16 18:40:37 +08:00
Billy Chan
1c4fc11efe
Test [issues] 2021-11-15 21:27:54 +08:00
Carter Snook
058f6d5d2b
chore: update to Rust Edition 2021 (#273) 2021-10-26 17:27:53 +08:00
Billy Chan
e911d2f5f4
Unify case-transform using the same crate 2021-10-21 11:36:57 +08:00
Chris Tsang
43509afb31 Edit 2021-10-20 17:46:35 +08:00
Chris Tsang
7b58c227e1 Readme 2021-10-20 17:39:10 +08:00
Chris Tsang
45f3548d4f #249 Demo of 'pure' crate depending on SeaORM 2021-10-20 17:37:02 +08:00
Chris Tsang
55dbdb7626 #249 Build with mock only 2021-10-15 23:04:14 +08:00
Chris Tsang
c24d7704d9 Move examples #232 2021-10-09 14:38:43 +08:00