forked from kit-clj/kit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
160 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
{:paths ["src"] | ||
:deps {mysql/mysql-connector-java {:mvn/version "8.0.27"} | ||
}} | ||
:deps {mysql/mysql-connector-java {:mvn/version "8.0.28"}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{:paths ["src"] | ||
:deps {integrant/integrant {:mvn/version "0.8.0"} | ||
conman/conman {:mvn/version "0.9.3"} | ||
io.github.kit-clj/kit-core {:mvn/version "1.0.1"}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
(ns kit.edge.db.sql.conman | ||
(:require | ||
[conman.core :as conman] | ||
[integrant.core :as ig] | ||
[kit.ig-utils :as ig-utils] | ||
[migratus.core :as migratus])) | ||
|
||
(defmethod ig/init-key :db.sql/connection | ||
[_ pool-spec] | ||
(conman/connect! pool-spec)) | ||
|
||
(defmethod ig/suspend-key! :db.sql/connection [_ _]) | ||
|
||
(defmethod ig/halt-key! :db.sql/connection | ||
[_ conn] | ||
(conman/disconnect! conn)) | ||
|
||
(defmethod ig/resume-key :db.sql/connection | ||
[key opts old-opts old-impl] | ||
(ig-utils/resume-handler key opts old-opts old-impl)) | ||
|
||
(defmethod ig/init-key :db.sql/query-fn | ||
[_ {:keys [conn options filename] | ||
:or {options {}}}] | ||
(let [queries (conman/bind-connection-map conn options filename)] | ||
(fn | ||
([query params] | ||
(conman/query queries query params)) | ||
([conn query params & opts] | ||
(apply conman/query conn queries query params opts))))) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{:paths ["src"] | ||
:deps {integrant/integrant {:mvn/version "0.8.0"} | ||
com.github.seancorfield/next.jdbc {:mvn/version "1.2.761"} ;; TODO: is this required here? | ||
hikari-cp/hikari-cp {:mvn/version "2.13.0"} | ||
io.github.kit-clj/kit-core {:mvn/version "1.0.1"}}} |
12 changes: 6 additions & 6 deletions
12
...l-general/src/kit/edge/db/sql/general.clj → ...sql-hikari/src/kit/edge/db/sql/hikari.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{:paths ["src"] | ||
:deps {integrant/integrant {:mvn/version "0.8.0"} | ||
migratus/migratus {:mvn/version "1.3.5"}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
(ns kit.edge.db.sql.migratus | ||
(:require | ||
[integrant.core :as ig] | ||
[migratus.core :as migratus])) | ||
|
||
(defmethod ig/init-key :db.sql/migrations | ||
[_ {:keys [migrate-on-init?] | ||
:or {migrate-on-init? true} | ||
:as component}] | ||
(when migrate-on-init? | ||
(migratus/migrate component)) | ||
component) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
{:paths ["src"] | ||
:deps {integrant/integrant {:mvn/version "0.8.0"} | ||
conman/conman {:mvn/version "0.9.3"} | ||
migratus/migratus {:mvn/version "1.3.5"} | ||
io.github.kit-clj/kit-core {:mvn/version "1.0.0"}}} | ||
:deps {io.github.kit-clj/kit-sql-conman {:mvn/version "1.0.0"} | ||
io.github.kit-clj/kit-sql-migratus {:mvn/version "1.0.0"}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,6 @@ | ||
(ns kit.edge.db.sql | ||
"This library simply in kit-sql-conman and kit-sql-migratus for compatibility purposes. | ||
It serves no other purpose" | ||
(:require | ||
[conman.core :as conman] | ||
[integrant.core :as ig] | ||
[kit.ig-utils :as ig-utils] | ||
[migratus.core :as migratus])) | ||
|
||
(defmethod ig/init-key :db.sql/connection | ||
[_ pool-spec] | ||
(conman/connect! pool-spec)) | ||
|
||
(defmethod ig/suspend-key! :db.sql/connection [_ _]) | ||
|
||
(defmethod ig/halt-key! :db.sql/connection | ||
[_ conn] | ||
(conman/disconnect! conn)) | ||
|
||
(defmethod ig/resume-key :db.sql/connection | ||
[key opts old-opts old-impl] | ||
(ig-utils/resume-handler key opts old-opts old-impl)) | ||
|
||
(defmethod ig/init-key :db.sql/query-fn | ||
[_ {:keys [conn options filename] | ||
:or {options {}}}] | ||
(let [queries (conman/bind-connection-map conn options filename)] | ||
(fn | ||
([query params] | ||
(conman/query queries query params)) | ||
([conn query params & opts] | ||
(apply conman/query conn queries query params opts))))) | ||
|
||
(defmethod ig/init-key :db.sql/migrations | ||
[_ {:keys [migrate-on-init?] | ||
:or {migrate-on-init? true} | ||
:as component}] | ||
(when migrate-on-init? | ||
(migratus/migrate component)) | ||
component) | ||
[kit.edge.db.sql.conman] | ||
[kit.edge.db.sql.migratus])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 0 additions & 72 deletions
72
libs/lein-template/resources/leiningen/new/kit/project.clj
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.