 
 
 ;; #### users
-(defn users-col [col]
+(defn users-col
+  "Return column information for the `users` column named by keyword COL."
+  [col]
   (case col
     :id         {:extra_info {}
                  :special_type :id

    :BigIntegerField))

(def driver-name->driver-dataset
  {:mongo       (MongoDriverData.)
   :generic-sql (GenericSqlDriverData.)})
(def valid-driver-names (set (keys driver-name->driver-dataset)))

(defmacro with-driver
  "Execute BODY with `*db*` and `*db-id*` bound to appropriate places for "


;; ## Functionality for writing driver-independent tests

(def ^:dynamic *db*
  "Bound to `Database` for the current driver inside body of `with-driver`.")
(def ^:dynamic *db-id*
  "Bound to ID of `Database` for the current driver inside body of `with-driver`.")
(def ^:dynamic *driver-dataset*)

(defprotocol IDriverDataset
  "Functions needed to fetch test data for various drivers."
  (db [this]
    "Return `Database` containing test data for this driver.")
  (table-name->table [this table-name]
    "Given a TABLE-NAME keyword like `:venues`, *fetch* the corresponding `Table`.")
  (field-name->id [this table-name field-name]
    "Given keyword TABLE-NAME and FIELD-NAME, return the corresponding `Field` ID.")
  (fks-supported? [this]
    "Does this driver support Foreign Keys?")
  (format-name [this table-or-field-name]
    "Transform a lowercase string `Table` or `Field` name in a way appropriate for this dataset
     (e.g., `h2` would want to upcase these names; `mongo` would want to use `\"_id\"` in place of `\"id\"`.")
  (id-field-type [this]
    "Return the `base_type` of the `id` `Field` (e.g. `:IntegerField` or `:BigIntegerField`)."))

(deftype MongoDriverData []
  IDriverDataset
  (db [_]
    @mongo-data/mongo-test-db)
  (table-name->table [_ table-name]
