Add Column Casting Support to Filter Nodes #9
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.
Description
This PR introduces functionality to support database-level casting for columns in filter nodes using
sea-query. It allows users to specify a casting type for columns through theFilterNodeOptionsand ensures proper integration with SeaQuery queries.Key Changes
New
cast_column_asOption inFilterNodeOptions:cast_column_as, toFilterNodeOptionsfor specifying the cast type of a column.cast_column_asinmodqlattributes.Column Casting Implementation in
sea_utils:into_node_column_exprto handle casting forColumnRefinstances.Version Upgrades:
sea-query: Bumped from0.31to0.32.rusqlite: Bumped from0.31to0.32.sea-query-rusqlite: Updated from0.6to0.7.Macro Updates:
derive_filter_nodes_innerto generate code for settingcast_column_asin filter node options.utils.rsto handle the newcast_column_asattribute.Filter Operation Updates:
op_val_string.rs,op_val_value.rs) to useinto_node_column_exprfor consistent column handling with casting.Example
Using the new feature in a filter:
Generates SQL like:
@jeremychone let me know what you think of this addition and feel free to add any feedback to it! Thanks!