<commit_before>(ns clojurewerkz.cassaforte.new-query-api
  "Functions for building dynamic CQL queries, in case you feel
   that `cql` namespace is too limiting for you."
  (:import [com.datastax.driver.core.querybuilder QueryBuilder
            Select$Selection Select Select$Where
            BindMarker
            Clause]
           [com.datastax.driver.core.querybuilder ]))

(defn ?
  ([]
     (QueryBuilder/bindMarker))
  ([name]
     (QueryBuilder/bindMarker name)))

(def select-command-order
  [QueryBuilder Select$Selection Select Select$Where])

(defn from
  [^String table-name]
  [2 (fn from-query [^Select$Selection query-builder]
       (.from query-builder (name table-name))
       )])

(defn all
  []
  [1 (fn all-query [^Select$Selection query-builder]
       (.all query-builder))])

(defn column
  [column]
  [1 (fn column-query [^Select$Selection query-builder]
       (.column query-builder column))])

(defn columns
  [columns]<commit_msg>Add Token function<commit_after>(ns clojurewerkz.cassaforte.new-query-api
  "Functions for building dynamic CQL queries, in case you feel
   that `cql` namespace is too limiting for you."
  (:import [com.datastax.driver.core.querybuilder QueryBuilder
            Select$Selection Select Select$Where
            BindMarker
            Clause]
           [com.datastax.driver.core.querybuilder ]))

(defn ?
  ([]
     (QueryBuilder/bindMarker))
  ([name]
     (QueryBuilder/bindMarker name)))

(defn token
  [& column-names]
  (QueryBuilder/token (into-array column-names)))

(def select-command-order
  [QueryBuilder Select$Selection Select Select$Where])

(defn from
  [^String table-name]
  [2 (fn from-query [^Select$Selection query-builder]
       (.from query-builder (name table-name))
       )])

(defn all
  []
  [1 (fn all-query [^Select$Selection query-builder]
       (.all query-builder))])

(defn column
  [column]
  [1 (fn column-query [^Select$Selection query-builder]
       (.column query-builder column))])

(defn columns
  [columns]
{'fraction_non_alphanumeric': 0.12456575682382134, 'fraction_numerical': 0.002977667493796526, 'mean_word_length': 3.2264150943396226, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7146044', 'n_tokens_mistral': 643, 'n_tokens_neox': 622, 'n_words': 159}