<commit_before>(ns clojurewerkz.cassaforte.query
  (:require
   [flatland.useful.ns :as uns]
   [qbits.hayt.dsl.verb :as verb]
   [qbits.hayt.cql :as cql]))

(def ->raw
  "Compiles a hayt query into its raw string value"
  cql/->raw)

(def ->prepared
  "Compiles a hayt query into a vector composed of the prepared string
  query and a vector of parameters."
  cql/->prepared)

(doseq [module '(dsl.clause fns utils)]
  (uns/alias-ns (symbol (str "qbits.hayt." module))))

;;
;; Cassaforte Mods
;;


(def select-query verb/select)

(defn insert-query
  [table values & clauses]
  (into {:insert table
         :values values} clauses))

(defn update-query
  [table set-columns & clauses]
  (into {:update table
         :set-columns set-columns} clauses))

(defn delete-query
  "http://cassandra.apache.org/doc/cql3/CQL.html#deleteStmt

Takes a table identifier and additional clause arguments:

* columns (defaults to *)
* using
* where
* table (optionaly using composition)"
  [table & clauses]
  (into {:delete table} clauses))

(def truncate-query verb/truncate)
(def drop-keyspace-query verb/drop-keyspace)
(def drop-table-query verb/drop-table)
(def drop-index-query verb/drop-index)
(def create-index-query verb/create-index)

(def create-keyspace-query verb/create-keyspace)
(def create-table-query verb/create-table)
(def create-column-family-query verb/create-table)
(def alter-table-query verb/alter-table)
(def alter-column-family-query verb/alter-column-family)
(def alter-keyspace-query verb/alter-keyspace)

(def batch-query verb/batch)
<commit_msg>Switch delete to default delete from hayt<commit_after>(ns clojurewerkz.cassaforte.query
  (:require
   [flatland.useful.ns :as uns]
   [qbits.hayt.dsl.verb :as verb]
   [qbits.hayt.cql :as cql]))

(def ->raw
  "Compiles a hayt query into its raw string value"
  cql/->raw)

(def ->prepared
  "Compiles a hayt query into a vector composed of the prepared string
  query and a vector of parameters."
  cql/->prepared)

(doseq [module '(dsl.clause fns utils)]
  (uns/alias-ns (symbol (str "qbits.hayt." module))))

;;
;; Cassaforte Mods
;;


(def select-query verb/select)

(defn insert-query
  [table values & clauses]
  (into {:insert table
         :values values} clauses))

(defn update-query
  [table set-columns & clauses]
  (into {:update table
         :set-columns set-columns} clauses))

(def delete-query verb/delete)

(def truncate-query verb/truncate)
(def drop-keyspace-query verb/drop-keyspace)
(def drop-table-query verb/drop-table)
(def drop-index-query verb/drop-index)
(def create-index-query verb/create-index)

(def create-keyspace-query verb/create-keyspace)
(def create-table-query verb/create-table)
(def create-column-family-query verb/create-table)
(def alter-table-query verb/alter-table)
(def alter-column-family-query verb/alter-column-family)
(def alter-keyspace-query verb/alter-keyspace)

(def batch-query verb/batch)

{'fraction_non_alphanumeric': 0.1314795743220048, 'fraction_numerical': 0.00034328870580157915, 'mean_word_length': 4.032815198618308, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '3425146', 'n_tokens_mistral': 1036, 'n_tokens_neox': 1007, 'n_words': 271}