emehrkay / Pypher

Python Cypher Querybuilder
MIT License
164 stars 29 forks source link

Quoting label names #50

Closed akloster closed 2 years ago

akloster commented 2 years ago

I am trying to construct queries for another Cypher compatible database, specifically AgensGraph, and the first problem I ran into is the quotation of labels when creating nodes or edges.

The issue is that this particular dialect doesn't like the ` quotation mark, it would prefer double quotes or no quotes.

emehrkay commented 2 years ago

It makes sense to make the quotes configurable. It seems that Labels, Map keys, and Properties have them. I would do something like this:

QUOTE = {
    'label': '`',
    'map_key': '`',
    'property': '`',
}

and it would be configurable at runtime. What do you think?

emehrkay commented 2 years ago

0.20.0 has been released with the update

import pyper
pyper.builder.QUOTES['propery'] = '"' # this will quote properties with a " instead of `
akloster commented 2 years ago

But apparently it was also an issue of "Agensgraph" vs "Apache AGE", the latter now requires the ` form ...

Thank you for your reply!