(ns clojure-sql.core (:refer-clojure :exclude [sort]) (:require [clojure.set :as set] [clojure-sql.compiler :as c] [clojure-sql.dsl :as d] [clojure-sql.query :as q] [clojure-sql.util :as u] [clojure.walk])) (def ^:private ^:dynamic *database-type* nil) (defn set-database-type! [new-type] (alter-var-root #'*database-type* (constantly new-type)) nil) (q/set-query-deref-behaviour! #(c/compile *database-type* %)) (defmethod print-method clojure_sql.query.Query [query writer] (binding [*out* writer] (pr (c/compile nil query)))) (def table #'d/table) (def project #'d/project) (def rename #'d/rename) (def join #'d/join) (def select #'d/select) (def group #'d/group) (def having #'d/having) (def sort #'d/sort)