Powerful & expressive ORM/query-builder/static checker for raw queries/Fully Automated migration tooling , designed to offer an intuitive API, strict type-checking, novel features, & full specification support. It provides a fresh perspective in data management. Currently supports SurrealDB engine. RDMSs(PG, MYSQL etc) and others coming soon
This PR introduces a series of enhancements and cleanups to the attribute handling and serialization logic specifically focusing on improving integration with the serde library for serialization and deserialization processes. The updates include rigorous validation, error handling improvements, and more intuitive usage patterns for developers working with relational fields and serialization attributes.
Key Changes
Attribute Handling Enhancements: Introduced and validated new attributes for better control and specification, ensuring that both default and skip_serializing are properly handled to meet our serialization requirements.
Links and Relates Default value: made sure that we don't require that the foreign node requires default implementation as links and relates fields can default to null or empty vector with e.g LinkMany::null() or Relate::null().
Didn't realize the Default trait derive macro automatically creates a bound for every generics of Self to implement Default and we dont necessarily want to impose that restriction for links types since we can derive the types without know ing the type of the generic e.g for: LinkMany<T>, or LinkOne<T>, we can default to empty vector or null respectively
Error Message Improvements: Refined the error messages related to required attributes, making them more informative and helpful in debugging and development processes.
Serde Integration: Made significant updates to ensure that serialization and deserialization behaviors are correctly managed, reinstating the default attribute where necessary to avoid deserialization errors.
Code Cleanup and Documentation: Conducted thorough cleanups to structure and spacing of the code for better readability and maintainability. Enhanced Rust documentation comments to clarify the functionality and usage of relational types.
Testing and Updates: Updated tests to cover new scenarios and ensure that all changes are robust and stable across various use cases. This includes updates to snapshot tests and query relation tests.
Optimization and Refactoring: Removed unused code and imports, utilized macros for defaults, and applied annotations to ignore unused code temporarily for easier search and future refactoring.
Technical Details
Reconfigured the handling of non-serializable fields to ensure they are appropriately skipped during serialization, thus preventing runtime errors and maintaining data integrity.
Adjusted field definitions and included defaults for relational fields to prevent null errors during deserialization.
Enhanced the workspace resolver settings and synchronized feature updates across all related crates.
This PR makes sure the serialization logic is both robust and efficient, facilitating better maintainability and future-proofing the codebase against potential serialization-related issues.
Summary
This PR introduces a series of enhancements and cleanups to the attribute handling and serialization logic specifically focusing on improving integration with the
serde
library for serialization and deserialization processes. The updates include rigorous validation, error handling improvements, and more intuitive usage patterns for developers working with relational fields and serialization attributes.Key Changes
Attribute Handling Enhancements: Introduced and validated new attributes for better control and specification, ensuring that both
default
andskip_serializing
are properly handled to meet our serialization requirements.Links and Relates Default value: made sure that we don't require that the foreign node requires default implementation as links and relates fields can default to null or empty vector with e.g
LinkMany::null()
orRelate::null()
. Didn't realize theDefault
trait derive macro automatically creates a bound for every generics ofSelf
to implement Default and we dont necessarily want to impose that restriction for links types since we can derive the types without know ing the type of the generic e.g for:LinkMany<T>
, orLinkOne<T>
, we can default to empty vector or null respectivelyError Message Improvements: Refined the error messages related to required attributes, making them more informative and helpful in debugging and development processes.
Serde Integration: Made significant updates to ensure that serialization and deserialization behaviors are correctly managed, reinstating the
default
attribute where necessary to avoid deserialization errors.Code Cleanup and Documentation: Conducted thorough cleanups to structure and spacing of the code for better readability and maintainability. Enhanced Rust documentation comments to clarify the functionality and usage of relational types.
Testing and Updates: Updated tests to cover new scenarios and ensure that all changes are robust and stable across various use cases. This includes updates to snapshot tests and query relation tests.
Optimization and Refactoring: Removed unused code and imports, utilized macros for defaults, and applied annotations to ignore unused code temporarily for easier search and future refactoring.
Technical Details
This PR makes sure the serialization logic is both robust and efficient, facilitating better maintainability and future-proofing the codebase against potential serialization-related issues.
Example: