`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`.
* 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>
* WIP, implementing Iden
* completed implementation for DeriveIden and added basic test cases
* added feature flag to prevent sea-orm::sea-query::DeriveIden from crashing when sea-query is not used
* fixed doc test and adjusted test case
* enable `sea-query-derive`'s `sea-orm` feature
* Bump `sea-query-derive` to v0.4
* Update Cargo.toml
* Update Cargo.toml
* adjusted test cases and updated so that iden attribute will not be snake cased
* Update Cargo.toml
* Update main.rs
---------
Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>
Co-authored-by: Chris Tsang <chris.2y3@outlook.com>
* imported bae2 into sea-orm local system
* doc update
* fix doc
* Remove sea-bae from the workspace
* Use sea-bae
---------
Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>
* WIP
* WIP
* WIP
* changed from storing ident to storing TokenStream internally
* Push for code sharing
* fmt
* changing test target to string
* updated Display not showing extra single quote, fixed clippy
* removed DeriveDisplay for test case not using display trait
* added test cases for display_value attribute
* Remove useless clone
* Add comment
* Remove useless clone
* Rename method
* Refactoring
---------
Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>
* progress (WIP)
* WIP
* WIP, finished structure except impl programming
* WIP
* revert event_trigger modification
* adding tests and mods
* completed derive value type
* fixed tests, adjusted code position and completed error messages
* column type commit
* added attribute array_type and column_type for specification
* renamed items and files, and removed debug messages
* move attributes outside of the wrapper struct
* refactored code for type matching, and restructured code in test cases
* clippy fix
* fix(doc): fix salvo framework name (#1731)
Co-authored-by: 黄景祥 <jingxiang.huang@baishancloud.com>
* fmt
* changed json_vec_test to use DeriveValueType
* fmt
* Revert "changed json_vec_test to use DeriveValueType"
This reverts commit 92bbf3b6e4eca72e0af0af35776aeec3ee035602.
* added test cases for inserting StringVec in a model
* fmt
* Try non-public wrapped type
* Refactoring
---------
Co-authored-by: joelhy <joelhy@gmail.com>
Co-authored-by: 黄景祥 <jingxiang.huang@baishancloud.com>
Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>
* resetted and re-did the changes
* fmt
* upgraded to syn2 for sea-orm-codegen
* Rename `bae2`
* Drop the use of `#[sea_orm(table_name = "col_name")]` in `DeriveColumn`
* unified derived input metadata parsing filter
* Propagate errors
---------
Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>
* Add DeriveRelatedEntity macro
* Add generation for related enum and seaography
* Add seaography cli param
* update codegen tests
* Fix DeriveRelatedEntity macro doc and includes
* Fix all RelatedEntity variants for RelationBuilder
* Add tests for code
* Cargo format
* Fix clippy code
* Fix format
* Fix unit tests
* Fix unit tests
* Provide default for seaography::RelationBuilder
* Update changelog
* Update tests
* Modify code to match feedback
* Bring old Related Impl trait generation
* Modify DeriveRelatedEntity to gen impl seaography::RelationBuilder
* Generate RelatedEntity enum when seaography flag is enabled
* Update documentation
* Update Changelog
* Fix format errors
* Fix code generation
* relations with suffix are definition based
* Rev => Reverse easier to read
* snake_case to cameCase for name generation
* Fix unit tests
* Update lib.rs
* derive `seaography::RelationBuilder` only when `seaography` feature is enabled
* Try constructing async-graphql root for "related entity" and "entity" without relation
* Update demo
* CHANGELOG
* Update Cargo.toml
Co-authored-by: Chris Tsang <chris.2y3@outlook.com>
* Revert "Update Cargo.toml"
This reverts commit 6b1669836a4fb5040bfb08999f0cf640c74dc64d.
---------
Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>
Co-authored-by: Chris Tsang <chris.2y3@outlook.com>
Add `stream_partial_model` to `Select<E>` and `SelectTwo<E,F>`
Minor refactoring
fmt
Add `into_partial_model` to `Cursor<S>`
refactoring
Add test cases
Fix test cases
More test cases
Move partial_model tests
add `PartialModelTrait` for a part of model
re-export `PartialModelTrait`
cargo fmt
add fn`into_partial_model` on `Select`&`SelectTwo`
add `DerivePartialModel` to impl `PartialModel`
add macro `DerivePartialModel` to `sea-orm`
disambiguate `SelectColumns` function
fix macro error
cargo fmt && cargo clippy
move `SelectColumns` from helper.rs to traits.rs
cargo fmt
Reduce nest hell of load attribute argument fetch
✅ test `DerivePartialModel` input parse
`DerivePartialModel` not derive with generic
fix `DerivePartialModel` code generate error
remove unused use
cargo fmt
add `into_partial_model` for `SelectTwoMany`
* Added escaping to ActiveEnum to allow for non-Unicode Standard Annex #31 characters, as well as addressing issues with ' ' and '_' causing potential identifier conflicts.
* Improved docstring for camel_case_with_escaped_non_xid.
* Moved underscore prepending to camel_case_with_escaped_non_xid.
* cargo fmt and code fixes to resolve CI failures.
* Added unittest to sea_orm_macros::util for new function.
* Fixed a typo in a doc code block.
* clippy
* Test cases
---------
Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>
* Update heck dependency
* Fix formatter error
* Drop the use of `sea-strum` and depends on the original `strum` with a tailored `EnumIter` provided
* fmt
* Depends on `strum` 0.23
* Depends on `strum` 0.24
* Source code adapted from https://github.com/Peternator7/strum
* Update LICENSE
---------
Co-authored-by: Sergei Ivankov <sergeiivankov@pm.me>
Co-authored-by: Sergei Ivankov <96142843+sergeiivankov@users.noreply.github.com>
Co-authored-by: Chris Tsang <chris.2y3@outlook.com>