Skip to content

Commit

Permalink
More accurate on data fields with type (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sofya authored and ozzzzz committed Apr 5, 2018
1 parent a155898 commit 4bd33a1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [0.1.0.3] - 2018-04-05
## [0.0.0.4] - 2018-04-05
### Changed
- More accurate `toNode` on data fields with `Maybe a` type. If the corresponding field in the type is Nothing, this field won't be included to `Node`.

## [0.0.0.3] - 2018-04-05
### Changed
- More accurate `fromNode` on data fields with `Maybe a` type. If there is no such field in Node, data field will be set to Nothing.

## [0.1.0.0] - 2018-02-22
## [0.0.0.0] - 2018-02-22
### Added
- Template Haskell code to generate `Node`s and `URelationship`s.
- Simple queries to upload `Node` and `URelationship`.
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.3
version: 0.0.0.4
synopsis: Extras for hasbolt library
description: Extras for hasbolt library
homepage: https://github.com/biocad/hasbolt-extras#readme
Expand Down
4 changes: 2 additions & 2 deletions src/Database/Bolt/Extras/Query/Put.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import Data.Map.Strict (mapWithKey, toList, (!))
import qualified Data.Map.Strict as M (map)
import qualified Data.Text as T (Text, pack)
import Database.Bolt (BoltActionT, Node (..),
RecordValue (..),
RecordValue (..), Value (..),
URelationship (..), at,
exact, query)
import Database.Bolt.Extras.Graph (Graph (..))
Expand Down Expand Up @@ -58,7 +58,7 @@ putNode ut = case ut of
let varQ = "n"

let labelsQ = toCypher $ labels node
let propsQ = toCypher . toList $ nodeProps node
let propsQ = toCypher . filter ((/= N ()) . snd) . toList $ nodeProps node

let getQuery = [text|$q ($varQ $labelsQ {$propsQ})
RETURN ID($varQ) as $varQ|]
Expand Down

0 comments on commit 4bd33a1

Please sign in to comment.