 ;; A wrapper around SQLiteDatabase to keep database and its schema
 ;; together.
 ;;
-(deftype TaggedDatabase [db schema])
+(deftype TaggedDatabase [^SQLiteDatabase db, schema])
 
 (defn get-database
   "Returns SQLiteDatabase instance for the given schema. Access-mode can be
   either `:read` or `:write`."
   {:forms '([context schema access-mode])}
   ([schema access-mode]
-     (println "Two-argument version is deprecated. Please use (get-database context schema access-mode)"))
+   (println "Two-argument version is deprecated. Please use (get-database context schema access-mode)")
+   (get-database context schema mode))
   ([context schema access-mode]
-     {:pre [(#{:read :write} access-mode)]}
-     (let [helper (create-helper context schema)]
-       (TaggedDatabase. (case access-mode
-                          :read (.getReadableDatabase helper)
-                          :write (.getWritableDatabase helper))
-                        schema))))
+   {:pre [(#{:read :write} access-mode)]}
+   (let [helper (create-helper context schema)]
+     (TaggedDatabase. (case access-mode
+                        :read (.getReadableDatabase helper)
+                        :write (.getWritableDatabase helper))
+                      schema))))
 
 ;; ### Data-SQL transformers
 

            :when (contains? data-map col)]
      (let [value (get data-map col)]
        (condp = type
          Integer (.put cv (name col) ^Integer value)
          Long (.put cv (name col) ^Long value)
          Double (.put cv (name col) ^Double value)
          String (.put cv (name col) ^String value)

                     keys
                     (map name)
                     into-array)]
    (.query (.db tagged-db) (name table-name) columns
            (where-clause where) nil nil nil nil)))
(def db-query query)

(defn seq-cursor
  "Turns data from Cursor object into a lazy sequence. Takes database
