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

Add new type that can be parametrized. #54

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

thinkofher
Copy link

Hello,

When using redisgraph-go you cannot simply pass time.Now().Unix() as ParameterizedQuery parameter, which I though is common behavior. Example code below.

if _, err := graph.ParameterizedQuery(query, map[string]interface{}{
	"task_id":   id,
        "now":       time.Now().Unix(),
}); err != nil {
        return fmt.Errorf("graph.ParameterizedQuery: %w", err)
}

Probably I can use toInteger RedisGraphs function in query, but I still won't be able to pass int64 as property in Properties field of Nodes.

What do you think about that?

This commit adds new type: "int64" that can be used by
(*Graph).ParameterizedQuery method. According to the
"Cypher Coverage" section from RedisGraph documentation:
64-bit signed integer is supported literal type.

This change will allow, for example, to use time.Now().Unix()
as parameter for previously mentioned ParameterizedQuery.

Before this change, using int64 as parameter for ParameterizedQuery
result with panic, although using int64 is very common when writing
go code.
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.

1 participant