264 Commits

Author SHA1 Message Date
Billy Chan
651c419b1b
Fix clippy warnings 2024-08-02 14:45:14 +08:00
Billy Chan
dbf475bf9d
1.0.0-rc.7 2024-06-25 11:50:11 +08:00
Billy Chan
3758f0c51d
1.0.0-rc.6 2024-06-19 20:41:58 +08:00
Billy Chan
9e93107bb8
Fix 2024-06-19 19:06:17 +08:00
Chris Tsang
987cb38aaf 1.0.0-rc.5 2024-05-29 13:46:38 +01:00
Chris Tsang
562778f61d One last refactor 2024-05-29 01:01:12 +01:00
Chris Tsang
e3f64b1892 Refactor 2024-05-29 01:00:14 +01:00
Chris Tsang
461aa925f6 Fix bug and update changelog 2024-05-29 00:53:09 +01:00
Chris Tsang
9152d8cac9 Refactor 2024-05-28 20:30:13 +01:00
Chris Tsang
3e45ac42a2 Revert case_style.rs 2024-05-28 20:18:25 +01:00
Anshul Sanghi
33230ab3ad
Auto Generated ActiveEnum String Values And Model Column Names (#2170)
* WIP: Add Basic Support For Providing String Value For ActiveEnum Variants Based On Renaming Rules #2160

* WIP: Use Existing Case Style Handlers For Enum Rename Rules, Add Unit Tests For DeriveActiveEnum rename rules #2160

* WIP: Improve Implementation Of Name Case Parameters In ActiveEnum Macros #2160

* WIP: Implement Case Styles Based Name Generation For Columns In A Model #2160

* Fix Formatting #2160

* Rename Column Name And Enum Variant Renaming Macro Attributes #2160

* Revert Adding `Rename` Attribute For Column Names #2160

* Revert Unintended Formatting Changes #2160

* Fix formatting

---------

Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>
2024-05-28 20:02:41 +01:00
Chris Tsang
e77cc5fa65
Merge pull request #2186 from SeaQL/entity-behavior
Associate `ActiveModel` to `EntityTrait`
2024-05-09 17:53:31 +01:00
Billy Chan
0798bf2037
1.0.0-rc.4 2024-05-03 16:07:49 +08:00
Billy Chan
33f4659db7
clippy 2024-05-03 13:46:38 +08:00
Chris Tsang
3b3a4463ad fmt 2024-04-03 21:33:35 +01:00
Chris Tsang
1c269a081f Associate ActiveModel to EntityTrait 2024-04-03 21:14:22 +01:00
Billy Chan
cdf216ccb1
1.0.0-rc.3 2024-03-27 00:17:41 +08:00
Albert Marashi
96917c5a1a
Use full qualifier in derives (#1665)
* Update active_model.rs

* Update active_model.rs

Added missing sea_orm qualifier
2024-03-24 00:23:45 +00:00
Chris Tsang
65de9f929c 1.0.0-rc.2 2024-03-15 23:31:56 +00:00
凊弦凝绝
a0a7e74ae9
Fix DerivePartialModel attr entity not support syn::Type token (#2137)
* 🐛 fix macro attr `entity` only accept `Ident`

* 🎨 cargo fmt

*  fix test
2024-03-10 18:20:24 +00:00
Billy Chan
f3967fdaca
Upstream Changes - 1 (#2145)
* upstream changes

* universal `#[sea_orm_macros::test]`

* fix

* fix

* `ColumnTrait::into_returning_expr`

* fix

* fix

* Do not pub sqlx_common

---------

Co-authored-by: Chris Tsang <chris.2y3@outlook.com>
2024-03-10 18:14:46 +00:00
Billy Chan
b775027fee
Explicit StringLen on ColumnType::String (#2123) 2024-03-05 15:31:58 +08:00
Wyatt Herkamp
0adcd3b36c
Update Strum (#2088)
* Update Strum

* Change log update

* Fetch updates from upstream Strum

* build-tools/update-strum-macros.sh

* Revert "Fetch updates from upstream Strum"

This reverts commit 32cf8f7ac96f9b0431d2bde682b69ec44b4f5b2e.

* Update enum_iter.rs

---------

Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>
2024-02-06 18:33:20 +08:00
Billy Chan
42553b6624
1.0.0-rc.1 2024-02-06 14:14:09 +08:00
Billy Chan
cef380b977
SQLite type mappings (#2077)
* sqlite: deps

* sqlite: update data type mappings

* sqlite: decimal test cases

* sqlite: try negative numbers

* fixup

* fixup

* fmt

* clippy

* fixup

* fixup

* fixup

* refactor

* fix

* Drop the use of `rust_decimal_macros` (#2078)

* sqlite: decimal -> real

* revert

* Bump dependencies

* Fixup

* Fixup

* Fixup

* Fixup

* Refactor

* Refactor

* Refactor
2024-02-05 14:42:55 +08:00
Chris Tsang
59e987453d fmt 2024-01-27 19:43:04 +00:00
Chris Tsang
8e6316c90e fmt 2024-01-27 19:32:39 +00:00
Chris Tsang
3c07c91d54 Doc #2083 2024-01-27 19:31:43 +00:00
Chris Tsang
70d4278598 0.12.12 2024-01-22 09:48:29 +00:00
Chris Tsang
260b8a4076 0.12.11 2024-01-14 16:10:33 +00:00
bobogei81123
13d383e43c
fix: fully qualify types in DeriveValueType macro (#2054)
`DeriveValueType` proc macro relies on several sea-orm types to be
imported. This is partially fixed in #1855 by fully qualifying
`sea_orm::QueryResult`, but others like `sea_orm::Value` is still not
being qualified. Also, if use defined a type alias on
`std::result::Result`, it can cause the proc macro to generate code that
won't compile.

- Fully qualify `sea_orm::Value`, `std::string::String`, and
  `std::result::Result` in `DeriveValueType` proc macro.
- Add some simple integration tests for this.
- Add doc and doc test in `sea_orm_macro::derive_value_type`.
2024-01-14 23:06:40 +08:00
Chris Tsang
f54683d365
Refactor/fix clippy errors (#2056) (#2057)
* chore: add clippy config file

* refactor: fix clippy errors and wornings of runtime-async-std-native-tls,sqlx-all

* refactor: fix clippy errors and wornings of sqlx-sqlite, sqlx-mysql, sqlx-postgres

* chore: format

* refactor: fix clippy

* fix: import path

* refactor: fix clippy errors and wornings of sqlx-sqlite, sqlx-mysql, sqlx-postgres

* fix: revert some space and comma removal

* fix: revert some space and comma removal

* refactor: add feature flag

* fix: import path

* test: remove mismatch feature flag

* test: remove mismatch feature flag

* chore: add proper feature flag

* chore: remove feature flag

* refactor: remove clippy.toml file

* fix: re-export driver

* fix: re-export JoinType

* fix: remove feature flag

* chore: add #[allow(unused_imports)] for driver

Co-authored-by: Shogo Nakano <61229807+shogo-nakano-desu@users.noreply.github.com>
2024-01-11 00:21:22 +08:00
Chris Tsang
4a59ca681b 0.12.10 2023-12-14 19:42:32 +00:00
94eac96513
create_table_from_entity support comment (#2009)
* support table and column comment

* create_table_from_entity support comment

* fmt code

* fmt code

* add comment test

* fix test
2023-12-14 18:22:36 +08:00
Chris Tsang
1ce3778c61 0.12.6 2023-11-13 09:03:26 +00:00
Wyatt Herkamp
b4010ecb64
Add #[sea_orm(skip)] for FromQueryResult macro (#1954)
* Add #[sea_orm(skip)] for FromQueryResult macro

* Update sea-orm-rocket

* Revert "Update sea-orm-rocket"

This reverts commit b7226bb44dbdbab9782524feb0303c4c166d3050.
2023-11-08 23:45:38 +08:00
Chris Tsang
0cffeb62a0 sea-orm-macros 0.12.5 2023-11-05 12:47:14 +00:00
Chris Tsang
42babea318 Hotfix: conditionally impl impl_try_getable_array 2023-10-23 10:08:32 +01:00
Chris Tsang
240620176c 0.12.4 2023-10-19 19:28:46 +01:00
Chris Tsang
93623f0d02 Support MySQL / SQLite 2023-10-16 09:55:30 +01:00
Anshul Sanghi
201d6fe9f9
Add Tests And Fix Build Issue For "Rework active enum" PR (#1900)
* Add Tests For Root JSON Arrays And Active Enum Vectors

* Fix Build Issue When Using `DeriveActiveEnum`
2023-10-12 16:23:29 +08:00
Chris Tsang
b2cb51380a Introduce TryGetableArray 2023-10-04 03:52:40 +01:00
Chris Tsang
f9db14c686 0.12.3 2023-09-22 18:13:25 +01:00
Chris Tsang
4804170208 Fix DeriveValueType by qualifying QueryResult #1855 2023-09-12 19:40:55 +01:00
Chris Tsang
242237aa51 0.12.2 2023-08-04 20:44:05 +01:00
Chris Tsang
1e6b10b532 0.12.1 2023-07-27 15:01:42 +01:00
Chris Tsang
97ee0a9703 Test derive FromJsonQueryResult 2023-07-26 20:17:55 +01:00
Chris Tsang
96087291c2 0.12.0-rc.5 2023-07-25 16:28:35 +08:00
Chris Tsang
3629b91d01 Do not deprecate default_value 2023-07-13 15:16:55 +01:00
Diwakar Gupta
1ba37b61d5
Add default_expr support for ColumnDef (#1474)
* Add default_expr support for ColumnDef

* added test for attribute `default_value`

* Implements `PartialEq` for `sea_query::SimpleExpr`

* RcOrArc

* Re-export `sea_query::Expr` in `sea_orm::entity::prelude`

* Add default_expr support for ColumnDef

* added test for attribute `default_value`

* Implements `PartialEq` for `sea_query::SimpleExpr`

* RcOrArc

* Re-export `sea_query::Expr` in `sea_orm::entity::prelude`

* Deprecate `ColumnDef::default_value()`

* Add `ColumnDef::default()`

---------

Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>
2023-07-13 22:09:53 +08:00