Skip to content

Commit

Permalink
basic implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
drkameleon committed Nov 2, 2023
1 parent 1614efe commit d02a494
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions grafito.art
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ graph: function [

put: function [
name :literal :string
attributes :block :dictionary
attributes :string :block :dictionary
][
;; description: « insert new node(s) to graph with given name and attributes
;; options: [
Expand All @@ -503,7 +503,12 @@ graph: function [
loop attributes 'nd [
lastId: lastId + 1
att: nd
if not? dictionary? att -> att: # att
(block? att)? -> att: # att [
(string? att)? -> att: #[
name: att
] []
]
;if not? dictionary? att -> att: # att
'queries ++ createNodeSQL
'vals ++ @[name, write.compact.json ø att]
'result ++ #[
Expand All @@ -518,7 +523,12 @@ graph: function [
printDebug ~{created |size attributes| nodes}
] [
att: attributes
if not? dictionary? att -> att: # att
(block? att)? -> att: # att [
(string? att)? -> att: #[
name: att
] []
]
; if not? dictionary? att -> att: # att
nodeId: performQuery.id 'put createNodeSQL @[name, write.compact.json ø att]
result: #[
id: nodeId
Expand Down

0 comments on commit d02a494

Please sign in to comment.