             (recur)))))
     conn))
 
-(defn hsqldb-conn [ desc ]
-  "Construct a connection map for an HSQLDB database with the given
-filename and schema. A name with a \"mem:\" prefix may be used to
-request a memory database."
-  (cond-> {:classname "org.hsqldb.jdbc.JDBCDriver"
-           :subprotocol  "hsqldb"
-           :subname (:name desc)}
-    (:schema-path desc) (assoc :schema-path (:schema-path desc))))
-
-;; Public Entry points
-
 (defn backup-to-file-blocking [ conn output-path ]
   (jdbc/db-do-prepared conn (str "BACKUP DATABASE TO '" output-path "' BLOCKING")))
 

        (throw (Exception. (str "Error installing schema: " schema) ex))))
    (set-schema-version! conn schema-name schema-version)))

(defn ensure-schema [ conn schema ]
  "Locate and run the scripts necessary to install the specified
schema in the target database instance."


(defn open-pool [ desc ]
  (log/info "Opening sql-file (pooled):" desc)  
  (let [conn (open-local desc)]
    (assoc conn :datasource
           (doto (com.zaxxer.hikari.HikariDataSource.)
             (.setDriverClassName (:classname conn))
             (.setJdbcUrl (str "jdbc:hsqldb:" (:subname conn)))
             (.setMaximumPoolSize (get desc :pool-size 4))))))

