Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added support for string array #22

Merged
merged 2 commits into from
Nov 25, 2019
Merged

added support for string array #22

merged 2 commits into from
Nov 25, 2019

Conversation

DvirDukhan
Copy link
Contributor

No description provided.

@DvirDukhan DvirDukhan requested a review from swilly22 November 25, 2019 08:19
@codecov
Copy link

codecov bot commented Nov 25, 2019

Codecov Report

Merging #22 into master will increase coverage by 0.23%.
The diff coverage is 90%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #22      +/-   ##
==========================================
+ Coverage   71.39%   71.63%   +0.23%     
==========================================
  Files           7        7              
  Lines         486      483       -3     
==========================================
- Hits          347      346       -1     
+ Misses        125      124       -1     
+ Partials       14       13       -1
Impacted Files Coverage Δ
graph.go 76.36% <0%> (ø) ⬆️
utils.go 64.28% <94.73%> (+2.06%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 45f2eab...d1279e7. Read the comment docs.

utils.go Outdated
@@ -3,18 +3,17 @@ package redisgraph
import (
"crypto/rand"
"fmt"
"reflect"
"strings"
)

// go array to string is [1 2 3] for [1, 2, 3] array
// cypher expects comma separated array
func arrayToString(arr interface{}) interface{} {
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be
func arrayToString(arr []interface{}) interface{} {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed

utils.go Outdated

switch i.(type) {
case string:
s := i.(string)
if len(s) == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we wrap s in " s " regardless if s is: "..." e.g. s value contains "

utils.go Outdated
strArray := []string{}
for i := 0; i < arrayLength; i++ {
strArray = append(strArray, fmt.Sprintf("%v", ToString(v.Index(i))))
strArray = append(strArray, fmt.Sprintf("%v", ToString(v[i])))
Copy link
Contributor

Choose a reason for hiding this comment

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

I think what we want here is to wrap v[i] in quotes if v[i] is of type string,
if this is indeed the case, use a different function, e.g. QuoteString(v[i])

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The ToString method does it

@DvirDukhan DvirDukhan merged commit 3430ace into master Nov 25, 2019
@DvirDukhan DvirDukhan deleted the parameters_support branch November 25, 2019 09:45
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.

2 participants