           (select-keys [:id :name]))
       => {:id 1 :name "fizzbuzz"})
 
-    (fact "it can clean up after the tests by deleting a table"
-      (-> (query db "DROP TABLE widgets")
-          (f/map* ok?)
-          (f/await))
-      => true)
-
     ))

          (f/await))
      => 1)

    (fact "it understands how to unbox a wide range of data types"
      (let [rows (-> (prepare db "SELECT * FROM WIDGETS")
                     (exec)
                     (f/map* ResultSet->vec)

(System/setProperty "java.net.preferIPv4Stack" "true")
(TimeZone/setDefault (TimeZone/getTimeZone "UTC"))

(defn create-table [db]
  (f/await
    (query db "CREATE TABLE IF NOT EXISTS widgets (
                     id INT AUTO_INCREMENT PRIMARY KEY,
                     sprockets SMALLINT,
                     sproings FLOAT,
                     sprattles BIGINT,
                     name VARCHAR(255),
                     blank VARCHAR(255),
                     description TEXT,
                     price DECIMAL(10,2),
                     mfd_on DATE,
                     in_stock BOOLEAN,
                     part_number CHAR(10),
                     created_at TIMESTAMP
                   )")))

(defn drop-table [db]
  (f/await
    (query db "DROP TABLE widgets")))

(let [db (-> (mysql-client)
             (with-credentials "finagle" "finagle")
             (with-database "finagle_clojure_test")
             (rich-client "localhost:3306"))]

  (against-background [(before :contents (create-table db))
                       (after  :contents (drop-table db))]

    (fact :mysql "it can ping the database"
      (-> (ping db)
          (f/map* ok?)
          (f/await))
      => true)

    (fact :mysql "it can create and update a table"
      (-> (prepare db "INSERT INTO widgets (name, description, sprockets, sproings, sprattles, price, mfd_on, blank, in_stock, part_number, created_at)
                       VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)")
          (exec
