Skip to content

Commit

Permalink
version 0.0.0.20: add WITH statement (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
maksbotan authored and ozzzzz committed Sep 7, 2019
1 parent 5b64e35 commit 8f9aefe
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [0.0.0.20] - 2019-09-06
### Added
- `WITH` statement in DSL.

## [0.0.0.19] - 2019-07-09
### Changed
- Directed relationship in graph get dsl instead of undirected.
Expand Down
2 changes: 1 addition & 1 deletion hasbolt-extras.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: hasbolt-extras
version: 0.0.0.19
version: 0.0.0.20
synopsis: Extras for hasbolt library
description: Extras for hasbolt library
homepage: https://github.com/biocad/hasbolt-extras#readme
Expand Down
1 change: 1 addition & 0 deletions src/Database/Bolt/Extras/DSL/Internal/Executer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ execute (Delete t n) = executeHelperT "DELETE " t n
execute (DetachDelete t n) = executeHelperT "DETACH DELETE " t n
execute (Remove t n) = executeHelperT "REMOVE " t n
execute (Return t n) = executeHelperT "RETURN " t n
execute (With t n) = executeHelperT "WITH " t n
execute (Text t n) = tell [t] >> pure n

-- | Helper to translate 'Expr' with something, which can be translated to cypher.
Expand Down
6 changes: 6 additions & 0 deletions src/Database/Bolt/Extras/DSL/Internal/Language.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module Database.Bolt.Extras.DSL.Internal.Language
, detachDeleteF
, removeF
, returnF
, withF
, textF
) where

Expand Down Expand Up @@ -68,6 +69,11 @@ removeF txts = liftF (Remove txts ())
returnF :: [Text] -> Free Expr ()
returnF txts = liftF (Return txts ())

-- | Prepare 'WITH' query
--
withF :: [Text] -> Free Expr ()
withF txts = liftF (With txts ())

-- | Prepare query with custom text
--
textF :: Text -> Free Expr ()
Expand Down
1 change: 1 addition & 0 deletions src/Database/Bolt/Extras/DSL/Internal/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ data Expr next = Create Selectors next -- ^ CREATE query
| DetachDelete [Text] next -- ^ DETACH DELETE query
| Remove [Text] next -- ^ REMOVE query
| Return [Text] next -- ^ RETURN query
| With [Text] next -- ^ WITH query
| Text Text next -- ^ free text query
deriving (Show, Eq, Functor)

Expand Down

0 comments on commit 8f9aefe

Please sign in to comment.