Simple ES6/7-oriented lib to work with neo4j and (in future) with OpenCypher-compatible databases
this software is early alpha stage and is not supposed to be used in production
Intended to be used as backing layer for other libraries
Usage example
console.log(Cypher.tag`test: ${'testVar'}`.getRawQuery())
and embedded requests:
const req = Cypher.tag`test2: ${`testVar`}`
console.log(Cypher.tag`test${req}`.getRawQuery())
Utility helpers:
Cypher.tag`CREATE (entry:${Cypher.raw(label)})`
Cypher.tag`MATCH (target ${Cypher.literal(props)})`
API
export class Connection {
constructor()
}
export class Cypher {
static defaultPrefix: string = 'v'
static raw(string): Cypher.Raw
static tag(Array<string>, ...Array<any>): Cypher
static literal(Object): Cypher
getRawQuery(): {query: string, params: Object}
}
Roadmap