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
93
stars
3
forks
source link
9 Enhancement of Data Type Definitions in SurrealDB: Implementation of Comprehensive Data Types and Parse Functions #10
This Pull Request aims to enhance the data type definitions in SurrealDB. It provides extensive support for a variety of data types and implements parsing functionalities to ensure smooth and efficient data handling, making Surreal-orm more versatile and robust.
Main Features:
Extended Data Types:
Surreal-orm now supports a plethora of more explicit/specific data types including but not limited to Geometry Types, Array Types, Set Types, and more.
Parsing Functionality:
Implemented parsing functions for various data types ensuring seamless integration and interaction with SurrealDB.
Explicit Data Type Definitions:
Enhanced the definition of data types, allowing users to explicitly set the data type of a field in SurrealDB.
Comprehensive Testing:
The implementation is thoroughly tested ensuring that each data type and parse function works as intended.
Detailed Overview:
New Data Types:
GeometryTypee supports multiple geometric types like point, line, polygon, and their respective collections.
FieldTypee accommodates various data types including primitive types, record types, geometry types, etc.
Array and Set Types support defining the types of items they can store along with the maximum length, with automatic deduplication for Set items.
Parsing and Display:
The implemented parsing functions, parse_db_field_type and associated functions, handle the conversion of string inputs to the corresponding data types effectively.
The Display trait for GeometryTypee and FieldTypee ensures the correct representation of each data type.
Utility Functions:
Utility functions are provided to check the kind of a field type, like is_primitive, is_record, is_geometry, etc., facilitating more informed and precise data handling.
Testing:
Comprehensive testing is done for each data type and parse function, ensuring their correctness and reliability.
This enhancement will significantly impact the versatility of surreal-orm, allowing users to handle various data types efficiently, and ensuring more robust and flexible data management.
Future Work:
Further optimization/refactoring of parse functions.
How to Test:
Ensure that you have the latest version of SurrealDB and all its dependencies installed.
Run the provided test cases in your local environment to verify the correctness of the new data types and parsing functions.
Reviewers:
N/A
Notes to Reviewers:
Please pay close attention to the parsing functions and their handling of different data types.
Verify the implementation against the provided test cases and ensure all edge cases are covered.
Changes:
Added new data types in FieldTypee and GeometryTypee.
Implemented parsing functions.
Provided display traits for newly added data types.
Added comprehensive test cases for each new data type and parse function.
Files Changed:
field_type_new.rs added
Checklist:
[x] I have performed a self-review of my own code.
[x] I have commented on my code, particularly in hard-to-understand areas.
[x] I have made corresponding changes to the documentation.
[x] My changes generate no new warnings.
[x] I have added tests that prove my fix is effective or that my feature works.
[x] New and existing unit tests pass locally with my changes.
Description:
This Pull Request aims to enhance the data type definitions in SurrealDB. It provides extensive support for a variety of data types and implements parsing functionalities to ensure smooth and efficient data handling, making Surreal-orm more versatile and robust.
Main Features:
Extended Data Types: Surreal-orm now supports a plethora of more explicit/specific data types including but not limited to Geometry Types, Array Types, Set Types, and more.
Parsing Functionality: Implemented parsing functions for various data types ensuring seamless integration and interaction with SurrealDB.
Explicit Data Type Definitions: Enhanced the definition of data types, allowing users to explicitly set the data type of a field in SurrealDB.
Comprehensive Testing: The implementation is thoroughly tested ensuring that each data type and parse function works as intended.
Detailed Overview:
New Data Types:
GeometryTypee
supports multiple geometric types like point, line, polygon, and their respective collections.FieldTypee
accommodates various data types including primitive types, record types, geometry types, etc.Array
andSet
Types support defining the types of items they can store along with the maximum length, with automatic deduplication for Set items.Parsing and Display:
parse_db_field_type
and associated functions, handle the conversion of string inputs to the corresponding data types effectively.GeometryTypee
andFieldTypee
ensures the correct representation of each data type.Utility Functions:
is_primitive
,is_record
,is_geometry
, etc., facilitating more informed and precise data handling.Testing:
Example:
Impact:
This enhancement will significantly impact the versatility of surreal-orm, allowing users to handle various data types efficiently, and ensuring more robust and flexible data management.
Future Work:
How to Test:
Reviewers:
Notes to Reviewers:
Changes:
FieldTypee
andGeometryTypee
.Files Changed:
field_type_new.rs
addedChecklist:
Acknowledgements:
-
Screenshots: