<commit_before>* dynamodb-expression

A WIP attempt to write a DSL for DynamoDB expressions in Clojure

http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.Modifying.html

* Examples

#+BEGIN_SRC clojure
  (ns foo
    (:require [dynamodb-expressions :as dx]))

  (def x 4)
  (dx/expr
   '(dx/add ["foo.bar" x] ["bar.baz" 8])
   '(dx/add ["#-goof-" 76]))


  #_({:update-expression "ADD #foo_bar_G__22528 :x_G__22529, #bar_baz_G__22530 :8_G__22531",
      :expression-attribute-names {"#foo_bar_G__22528" "foo.bar",
                                   "#bar_baz_G__22530" "bar.baz",
                                   "#__goof__G__22532" "#-goof-"},
      :expression-attribute-values {":x_G__22529" 4,
                                    ":8_G__22531" 8,
                                    ":76_G__22533" 76}})

#+END_SRC

* License

Copyright © 2016 <NAME>

Distributed under the Eclipse Public License either version 1.0 or (at
your option) any later version.
<commit_msg>explain a bit more about it<commit_after>* dynamodb-expression

A WIP attempt to write a DSL for DynamoDB expressions in Clojure. Not ready for real-world use yet!

http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.Modifying.html

* Examples

This much pretty much works...

#+BEGIN_SRC clojure
  (ns foo
    (:require [dynamodb-expressions :as dx]))

  (def x 4)
  (dx/expr
   '(dx/add ["foo.bar" x]
            ["bar.baz" 8])
   '(dx/add ["-goof-" 76]))


  #_({:update-expression "ADD #foo_bar_G__22528 :x_G__22529, #bar_baz_G__22530 :8_G__22531",
      :expression-attribute-names {"#foo_bar_G__22528" "foo.bar",
                                   "#bar_baz_G__22530" "bar.baz",
                                   "#__goof__G__22532" "-goof-"},
      :expression-attribute-values {":x_G__22529" 4,
                                    ":8_G__22531" 8,
                                    ":76_G__22533" 76}})
#+END_SRC

Next steps to extend the syntax out to set, remove, delete, and tidy up the syntax, something like:

#+BEGIN_SRC clojure
(dx/expr
  (dx/add ["a" x]
          ["b" 8])
  (dx/set (dx/+ "c" 76)
          (dx/= "d" "foo bar))
  (dx/remove "e" "f" "g")
  (dx/delete ["h" "baz]))
#+END_SRC

* License

Copyright © 2016 <NAME>

Distributed under the Eclipse Public License either version 1.0 or (at
your option) any later version.

{'fraction_non_alphanumeric': 0.13327709827077183, 'fraction_numerical': 0.05862505272037115, 'mean_word_length': 2.383737517831669, 'pattern_counts': {'":': 6, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '161789', 'n_tokens_mistral': 963, 'n_tokens_neox': 825, 'n_words': 214}