korma/Korma has 1,465 GitHub stars and 214 forks. GitHot measured 0 stars in 24 hours, -1 in 7 days, and -1 in 15 days. Last checked 2026-11-21 21:23 UTC. Last push 2020-10-15.
計測したスター増加
- 24時間
- 0
- 7日間
- -1
- 15日間
- -1
- 1か月
- 履歴を収集中
期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。
概要
Tasty SQL for Clojure.
データREADME.md
オリジナルKorma
Tasty SQL for Clojure.
TravisCI Status
Getting started
Simply add Korma as a dependency to your lein project:
[korma "0.4.3"]
Stable and Edge releases
The most recent stable release is Korma 0.4.3, as noted above.
The current edge release is Korma 0.5.0-RC1 (released Feb 28, 2018). It is not guaranteed to be bug free, and we'd welcome help from the community in identifying any bugs or regressions. The plan is to either release a second release candidate in May or, if no bugs have surfaced, for Korma 0.5.0 to be released at that time.
Docs and Real Usage
To get rid of the ridiculously verbose logging, add the following into src/log4j.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<logger name="com.mchange">
<level value="WARN"/>
</logger>
</log4j:configuration>
And include log4j in your project.clj:
[log4j "1.2.15" :exclusions [javax.mail/mail
javax.jms/jms
com.sun.jdmk/jmxtools
com.sun.jmx/jmxri]]
Examples of generated queries:
(use 'korma.db)
(defdb db (postgres {:db "mydb"
:user "user"
:password "dbpass"}))
(use 'korma.core)
(defentity users)
(select users)
;; executes: SELECT * FROM users
(select users
(fields :username :id))
;; executes: SELECT users.username, users.id FROM users
(select users
(where {:username "chris"}))
;; executes: SELECT * FROM users WHERE (users.username = 'chris')
(select users
(where {:active true})
(order :created)
(limit 5)
(offset 3))
;; executes: SELECT * FROM users WHERE (users.active = TRUE) ORDER BY users.created DESC LIMIT 5 OFFSET 3
(select users
(where (or (= :username "chris")
(= :email "[email protected]"))))
;; executes: SELECT * FROM users WHERE (users.username = 'chris' OR users.email = '[email protected]')
(select users
(where {:username [like "chris"]
:status "active"
:location [not= nil]}))
;; executes SELECT * FROM users WHERE (users.username LIKE 'chris' AND users.status = 'active' AND users.location IS NOT NULL)
(select users
(where (or {:username "chris"
:first "chris"}
{:email [like "%@chris.com"]})))
;; executes: SELECT * FROM users WHERE ((users.username = 'chris' AND users.first = 'chris') OR users.email LIKE '%@chris.com)'
(defentity address
(entity-fields :street :city :zip))
(defentity users
(has-one address))
(select users
(with address))
;; SELECT address.street, address.city, address.zip FROM users LEFT JOIN address ON users.id = address.users_id
License
Copyright (C) 2011 Chris Granger
Distributed under the Eclipse Public License, the same as Clojure.
関連プロジェクトを探す
読み込み中…
