Skip to content

A clojure library that offers similar functionality to hugsql but geared towards neo4j

License

Notifications You must be signed in to change notification settings

rams-services/hugcypher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hugcypher

A clojure library that offers similar functionality to hugsql but geared towards the Cypher Query Language. Currently supports neo4j and arcadedb.

Getting Started

(ns db
    (:require [hugcypher.core :as hughcypher]
              [hugcypher.cypher as cypher]
              [clojure.java.io :as io]))

;; This will take all queries from the test.cypher file and bind them to the current ns
(hugcypher/def-db-fns (io/file "test.cypher"))

;; Each db function takes the following arguments: type, connection, and the params map
;; The type can be either :neo4j or :arcadedb-http

;; setting up a connection
(def conn (cypher/connect :neo4j {:url "bolt://localhost:7678"
                                  :username "neo4j"
                                  :password "neo4j"}))
(ns example
    (:require [db :as db :refer [conn]]))                                  
                                  
;; Get user query has a user-id param
(db/get-user :neo4j conn {:user-id 1}) ;; => user will be returned

;; This's just a small example of one of the things you can do using hugcypher

Version Matrix

hughcypher Clojure Java Neo4j Java Driver Neo4j
0.1.3 1.11.1 17.x.x 5.x.x 5.x
0.1.2 1.10.1 11.x.x 1.5.x 3.5

Acknowledgements

hugcypher has been inspired by the work of the following project(s):

hugsql

About

A clojure library that offers similar functionality to hugsql but geared towards neo4j

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 6