fix(database/gdb): Fix GetArray return type and add Bools method#4452
Merged
fix(database/gdb): Fix GetArray return type and add Bools method#4452
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the return type inconsistency in the GetArray method throughout the database package and adds a new Bools method to the gvar.Vars type for converting variables to boolean slice.
- Changed GetArray method return type from []Value to Array across database interfaces and implementations
- Added Bools method to gvar.Vars for converting variables to []bool
- Improved memory allocation efficiency in existing conversion methods by pre-allocating slices with capacity
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| frame/gins/gins_database.go | Updated database configuration method calls to use GetConfigGroup |
| database/gdb/gdb_type_result.go | Changed Array method return type from []Value to Array |
| database/gdb/gdb_model_select.go | Updated Model.Array return type from []Value to Array |
| database/gdb/gdb_core.go | Changed Core.GetArray return type from []Value to Array |
| database/gdb/gdb.go | Updated DB interface GetArray signature and added Array type alias |
| container/gvar/gvar_z_unit_vars_test.go | Added comprehensive test cases for new Bools method |
| container/gvar/gvar_vars.go | Added Bools method and optimized slice allocation in conversion methods |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Contributor
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
houseme
reviewed
Sep 28, 2025
houseme
approved these changes
Sep 28, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Change the return type of the GetArray method to Array for consistency in data structure. Introduce a new Bools method to convert Vars to a slice of bools, along with corresponding test cases to validate the functionality.