Skip to content

Conversation

xav-db
Copy link
Member

@xav-db xav-db commented Sep 1, 2025

Description

Related Issues

Closes #

Checklist when merging to main

  • No compiler warnings (if applicable)
  • Code is formatted with rustfmt
  • No useless or dead code (if applicable)
  • Code is easy to understand
  • Doc comments are used for all functions, enums, structs, and fields (where appropriate)
  • All tests pass
  • Performance has not regressed (assuming change was not to fix a bug)
  • Version number has been updated in helix-cli/Cargo.toml and helixdb/Cargo.toml

Additional Notes

xav-db and others added 12 commits August 29, 2025 21:58
## Description
Well, my query with `!EXIST` was not working as expected anymore after
the docker feature update
so I went to see the changes.. found little whoopsie

## Related Issues
<!-- Link to any related issues using #issue_number -->

Closes #

## Checklist when merging to main
<!-- Mark items with "x" when completed -->

- [ ] No compiler warnings (if applicable)
- [ ] Code is formatted with `rustfmt`
- [ ] No useless or dead code (if applicable)
- [ ] Code is easy to understand
- [ ] Doc comments are used for all functions, enums, structs, and
fields (where appropriate)
- [ ] All tests pass
- [ ] Performance has not regressed (assuming change was not to fix a
bug)
- [ ] Version number has been updated in `helix-cli/Cargo.toml` and
`helixdb/Cargo.toml`

## Additional Notes
<!-- Add any additional information that would be helpful for reviewers
-->
@xav-db xav-db marked this pull request as ready for review September 1, 2025 21:56
@Copilot Copilot AI review requested due to automatic review settings September 1, 2025 21:56
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements HQL object wrapping functionality and adds support for the IS_IN operator. The changes introduce array literal support in the parser, enhance value type conversion through From trait implementations, and add new boolean operations for checking if values are contained within arrays.

  • Replaces the CastValue trait with standard From trait implementations for better type conversion
  • Adds array literal support and IS_IN operator for HQL queries
  • Implements IntoPrimitive trait for extracting references to underlying values

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
helix-db/src/protocol/value.rs Major refactoring replacing CastValue trait with From implementations and adding IntoPrimitive trait
helix-db/src/helixc/parser/helix_parser.rs Adds array literal parsing and new boolean operations (CONTAINS, IS_IN)
helix-db/src/helixc/generator/utils.rs Adds Array variant to GeneratedValue enum
helix-db/src/helixc/generator/statements.rs Adds Array variant to Statement enum for code generation
helix-db/src/helixc/generator/bool_op.rs Implements IsIn boolean operation and updates display formatting
helix-db/src/helixc/analyzer/methods/traversal_validation.rs Handles validation for new CONTAINS and IS_IN operations
helix-db/src/helixc/analyzer/methods/infer_expr_type.rs Adds type inference support for array literals
helix-db/src/helix_gateway/mcp/tools.rs Code formatting improvements for error messages
helix-db/src/grammar.pest Grammar updates for array literals and new boolean operations
helix-cli/src/instance_manager.rs Minor import reorganization
Comments suppressed due to low confidence (1)

helix-db/src/helixc/analyzer/methods/infer_expr_type.rs:1

  • The unwrap() call could panic if stmt is None. The TODO comments indicate this case needs proper handling. Consider using stmt.ok_or_else(|| error) or implementing proper error handling.
//! Semantic analyzer for Helix‑QL.

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@@ -2458,6 +2467,13 @@ impl HelixParser {
}
}

fn parse_array_literal(&self, pair: Pair<Rule>) -> Result<Vec<Expression>, ParserError> {
println!("pair: {pair:?}");
Copy link
Preview

Copilot AI Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug print statement should be removed from production code. This appears to be leftover debugging code that will clutter the output.

Suggested change
println!("pair: {pair:?}");

Copilot uses AI. Check for mistakes.

pub fn is_in<T>(&self, values: &[T]) -> bool
where
T: PartialEq,
Value: IntoPrimitive<T> + Into<T>,
Copy link
Preview

Copilot AI Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The trait bounds IntoPrimitive<T> + Into<T> are potentially confusing since both traits serve similar purposes. Consider using only IntoPrimitive<T> which returns a reference, or clarify the intended usage pattern.

Suggested change
Value: IntoPrimitive<T> + Into<T>,
Value: IntoPrimitive<T>,

Copilot uses AI. Check for mistakes.

T: PartialEq,
Value: IntoPrimitive<T> + Into<T>,
{
values.contains(self.into_primitive())
Copy link
Preview

Copilot AI Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not compile because values.contains() expects &T but into_primitive() returns &T, so values.contains(&self.into_primitive()) would be correct, or better yet use values.iter().any(|v| v == self.into_primitive()).

Suggested change
values.contains(self.into_primitive())
values.iter().any(|v| v == &self.into_primitive())

Copilot uses AI. Check for mistakes.

};
BoolOp::IsIn(IsIn { value: v })
}
_ => unreachable!("shouldve been caught earlier"),
Copy link
Preview

Copilot AI Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"shouldve" should be "should've" or "should have".

Suggested change
_ => unreachable!("shouldve been caught earlier"),
_ => unreachable!("should've been caught earlier"),

Copilot uses AI. Check for mistakes.

xav-db and others added 6 commits September 2, 2025 09:51
## Description
<!-- Provide a brief description of the changes in this PR -->

## Related Issues
<!-- Link to any related issues using #issue_number -->

Closes #

## Checklist when merging to main
<!-- Mark items with "x" when completed -->

- [ ] No compiler warnings (if applicable)
- [ ] Code is formatted with `rustfmt`
- [ ] No useless or dead code (if applicable)
- [ ] Code is easy to understand
- [ ] Doc comments are used for all functions, enums, structs, and
fields (where appropriate)
- [ ] All tests pass
- [ ] Performance has not regressed (assuming change was not to fix a
bug)
- [ ] Version number has been updated in `helix-cli/Cargo.toml` and
`helixdb/Cargo.toml`

## Additional Notes
<!-- Add any additional information that would be helpful for reviewers
-->
## Description
<!-- Provide a brief description of the changes in this PR -->

## Related Issues
<!-- Link to any related issues using #issue_number -->

Closes #

## Checklist when merging to main
<!-- Mark items with "x" when completed -->

- [ ] No compiler warnings (if applicable)
- [ ] Code is formatted with `rustfmt`
- [ ] No useless or dead code (if applicable)
- [ ] Code is easy to understand
- [ ] Doc comments are used for all functions, enums, structs, and
fields (where appropriate)
- [ ] All tests pass
- [ ] Performance has not regressed (assuming change was not to fix a
bug)
- [ ] Version number has been updated in `helix-cli/Cargo.toml` and
`helixdb/Cargo.toml`

## Additional Notes
<!-- Add any additional information that would be helpful for reviewers
-->
@xav-db xav-db merged commit 339f5d5 into main Sep 3, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants