 
 (defn table
   [data & {:keys [alias] :as opts}]
-  (let [f (table* data)]
-    (if alias
-      (.as f (clojure.core/name alias))
-      f)))
+  (defer
+    (let [f (table* data)]
+      (if alias
+        (.as f (clojure.core/name alias))
+        f))))
 
 (defn select
   "Start select statement."
   [& fields]
-  (cond
-   (instance? org.jooq.WithStep (first fields))
-   (.select (first fields)
-            (->> (map field (rest fields))
-                 (into-array org.jooq.Field)))
-   :else
-   (->> (map field fields)
-        (into-array org.jooq.Field)
-        (DSL/select))))
+  (defer
+    (let [fields (map unwrap* fields)]
+      (cond
+       (instance? org.jooq.WithStep (first fields))
+       (.select (first fields)
+                (->> (map field* (rest fields))
+                     (into-array org.jooq.Field)))
+       :else
+       (->> (map field* fields)
+            (into-array org.jooq.Field)
+            (DSL/select))))))
 
 (defn select-distinct
   "Start select statement."
   [& fields]
-  (->> (map field fields)
-       (into-array org.jooq.Field)
-       (DSL/selectDistinct)))
+  (defer
+    (->> (map (comp field unwrap*) fields)
+         (into-array org.jooq.Field)
+         (DSL/selectDistinct))))
 
 (defn select-from
   "Helper for create select * from <table>
   statement directly (without specify fields)"
   [table']
-  (-> (table table')
+  (-> (table* table')
       (DSL/selectFrom)))
 
 (defn select-count


(defn update
  [t]
  (DSL/update (table* t)))

(defn set
  [t f v]
  (if (instance? org.jooq.Row f)
    (.set t f v)
    (.set t (field* f) v)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Delete statement


(defn delete
  [t]
  (defer
    (DSL/delete (table* t))))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; DDL
