Use a database with Clojure

后端 未结 12 1548
青春惊慌失措
青春惊慌失措 2021-01-31 08:22

What methods to use a database from Clojure are there?

I know from Clojure you can do anything you can with Java, but that means that I may end up using something overly

相关标签:
12条回答
  • 2021-01-31 08:49

    I've used Berkeley DB for a simple key/value database in Clojure. See here.

    0 讨论(0)
  • 2021-01-31 08:49

    You could also try CLJ-Record, https://github.com/duelinmarkers/clj-record

    0 讨论(0)
  • 2021-01-31 08:58

    I would now (as of late 2011) recommend Korma - "Tasty SQL for Clojure"

    It's a beautiful little SQL DSL, here's an example from the website:

    (select users
      (aggregate (count :*) :cnt)
      (where (or (> :visits 20)
                 (< :last_login a-year-ago))))
    
    0 讨论(0)
  • 2021-01-31 08:59

    clojure-contrib has an sql library which is a thin wrapper around JDBC (java.sql.DriverManager). The test file that comes with it has some examples of its usage.

    0 讨论(0)
  • 2021-01-31 09:01

    There's ClojureQL which embraces relational algebra.

    0 讨论(0)
  • 2021-01-31 09:01

    Then there is SQLLite. Have a look at this simple example: https://github.com/ogrim/clojure-sqlite-example

    0 讨论(0)
提交回复
热议问题