-
Notifications
You must be signed in to change notification settings - Fork 54
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
5 changed files
with
71 additions
and
74 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,4 +63,4 @@ jobs: | |
run: clj-kondo --lint ./ | ||
|
||
- name: Test | ||
run: bin/kaocha :core | ||
run: bin/kaocha |
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
48 changes: 48 additions & 0 deletions
48
hugsql-adapter-next-jdbc/test/hugsql_adapter_next_jdbc/core_test/queries.sql
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,48 @@ | ||
-- queries.sql | ||
-- test functions | ||
|
||
-- :name create-colors-table | ||
-- :command :execute | ||
-- :result :raw | ||
-- :doc create a test table of colors | ||
create table if not exists colors ( | ||
id integer auto_increment primary key, | ||
name varchar(32), | ||
r integer, | ||
g integer, | ||
b integer | ||
); | ||
|
||
-- :name insert-color | ||
-- :command :execute | ||
-- :result :raw | ||
-- :doc insert a color into the colors table | ||
insert into colors (name, r, g, b) | ||
values (:name, :r, :g, :b); | ||
|
||
-- :name insert-color-alt | ||
-- :command :insert | ||
-- :result :raw | ||
-- :doc insert a color into the colors table returning keys | ||
insert into colors (name, r, g, b) | ||
values (:name, :r, :g, :b); | ||
|
||
-- :name update-color-affected :! :n | ||
update colors | ||
set r = :r; | ||
|
||
-- :name delete-color-by-id | ||
-- :command :execute | ||
-- :result :raw | ||
-- :doc delete a color by the given `id` | ||
delete from colors where id = :id; | ||
|
||
-- :name select-color-by-id :? :1 | ||
-- :command :query | ||
-- :doc select a color by id | ||
select id as "color/id" from colors where id = :id limit 1; | ||
|
||
-- :name select-all-colors :? :* | ||
-- :command :query | ||
-- :doc select all colors | ||
select id as "color/id" from colors; |
2 changes: 1 addition & 1 deletion
2
hugsql-adapter-next-jdbc/test/hugsql_adapter_next_jdbc/core_test/sql.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
(ns hugsql-adapter-next-jdbc.core-test.sql | ||
(:require [hugsql.core :as hugsql])) | ||
|
||
(hugsql/def-db-fns "hugsql_adapter_next_jdbc/queries.sql") | ||
(hugsql/def-db-fns "hugsql_adapter_next_jdbc/core_test/queries.sql") |
49 changes: 0 additions & 49 deletions
49
hugsql-adapter-next-jdbc/test/hugsql_adapter_next_jdbc/queries.sql
This file was deleted.
Oops, something went wrong.