Skip to content

Commit 6652c6a

Browse files
authored
Add new line to Cypher queries (#54)
1 parent 961726e commit 6652c6a

File tree

5 files changed

+20
-7
lines changed

5 files changed

+20
-7
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ jobs:
164164
chmod a+x $HOME/.cabal/bin/cabal-plan
165165
cabal-plan --version
166166
- name: checkout
167-
uses: actions/checkout@v2
167+
uses: actions/checkout@v3
168168
with:
169169
path: source
170170
- name: initial cabal.project for sdist
@@ -199,8 +199,8 @@ jobs:
199199
run: |
200200
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
201201
cabal-plan
202-
- name: cache
203-
uses: actions/cache@v2
202+
- name: restore cache
203+
uses: actions/cache/restore@v3
204204
with:
205205
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
206206
path: ~/.cabal/store
@@ -225,3 +225,9 @@ jobs:
225225
run: |
226226
rm -f cabal.project.local
227227
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
228+
- name: save cache
229+
uses: actions/cache/save@v3
230+
if: always()
231+
with:
232+
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
233+
path: ~/.cabal/store

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
66

77
## [Unreleased]
88

9+
## [0.0.2.1] - 2023-01-24
10+
### Added
11+
- Add newline for Cyper queries.
912
## [0.0.2.0] - 2023-01-24
1013
### Added
1114
- `BoltGeneric` wrapper for `DerivingVia` to derive `IsValue` and `RecordValue` for Haskell types.

hasbolt-extras.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: hasbolt-extras
2-
version: 0.0.2.0
2+
version: 0.0.2.1
33
synopsis: Extras for hasbolt library
44
description: Extras for hasbolt library
55
homepage: https://github.com/biocad/hasbolt-extras#readme

src/Database/Bolt/Extras/DSL/Internal/Executer.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ execute (Text t n) = tell [t] >> pure n
3535
-- | Helper to translate 'Expr' with something, which can be translated to cypher.
3636
--
3737
executeHelperC :: ToCypher a => Text -> a -> b -> Writer [Text] b
38-
executeHelperC txt s n = tell [txt <> toCypher s] >> pure n
38+
executeHelperC txt s n = tell [txt <> toCypher s <> "\n"] >> pure n
3939

4040
-- | Helper to translate 'Expr' with 'Text's.
4141
--
4242
executeHelperT :: Text -> [Text] -> b -> Writer [Text] b
43-
executeHelperT txt t n = tell [txt <> intercalate ", " t] >> pure n
43+
executeHelperT txt t n = tell [txt <> intercalate ", " t <> "\n"] >> pure n
4444

4545
formQueryW :: Free Expr () -> Writer [Text] ()
4646
formQueryW = foldFree execute

src/Database/Bolt/Extras/DSL/Typed.hs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,11 @@ toCypherQ $ do
154154
]
155155
returnF ["lib"]
156156
:}
157-
MERGE (name:Name{name:"CT42"}) MERGE (user:User{user:"123-456"}) CREATE (lib:BinderLibrary:Library), (name)-[:NAME_OF]->(lib), (user)-[:USER_CREATED{timestamp:1572340394000}]->(lib) RETURN lib
157+
MERGE (name:Name{name:"CT42"})
158+
MERGE (user:User{user:"123-456"})
159+
CREATE (lib:BinderLibrary:Library), (name)-[:NAME_OF]->(lib), (user)-[:USER_CREATED{timestamp:1572340394000}]->(lib)
160+
RETURN lib
161+
...
158162
159163
==== Dropping types
160164

0 commit comments

Comments
 (0)