feat(derive): Add better string parsing support #155
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes several enhancements and new features to the
geekorm-derive
library. The most important changes involve adding new attribute keys, improving parsing logic, and extending support for additional data types and functionalities.Enhancements to attribute keys and parsing logic:
geekorm-derive/src/attr.rs
: Added new attribute keys (Key
,Aliases
,OnValidate
,Disable
) and updated theGeekAttribute
struct to include aVec<String>
type. Improved parsing logic to handle these new keys and their respective values. [1] [2] [3] [4] [5] [6] [7]Enhancements to
ColumnDerive
:geekorm-derive/src/derive/column.rs
: Added handling for theOnValidate
attribute key to set thesave
andupdate
properties accordingly. Updated logic to skip certain attribute keys (Key
,Disable
,Aliases
). [1] [2]Support for custom key attributes in enums:
geekorm-derive/src/lib.rs
: Demonstrated usage of thekey
attribute in documentation comments and updated thedata_derive
function to includegeekorm
attributes. [1] [2]geekorm-derive/src/parsers.rs
: Addedgenerate_strings
function to support custom key attributes for enum variants, and integrated this function into theenum_parser
. [1] [2]Miscellaneous improvements:
geekorm-derive/src/parsers/tablebuilder.rs
: Removed unnecessary logging code in thegenerate_backend
function.geekorm-derive/src/parsers/values.rs
: Added support for custom key attributes in thegenerate_from_value
function and implementedgenerate_strings
forToString
andDisplay
traits. Improvedserde
serialization and deserialization implementations. [1] [2] [3] [4] [5] [6] [7] [8]