 (defn- get-provider-collection-list-sql
   "Gengerate SQL to get the list of collections (datasets) for the given provider."
   [provider-id]
-  (let [dataset-table (keyword (str catalog-rest-tablespace "." provider-id "-dataset-records"))]
-    (su/build (select [:id :echo-collection-id] (from dataset-table)))))
+  (su/build (select [:id :echo-collection-id] (from (catalog-rest-dataset-table provider-id)))))
 
 (defn- get-provider-collection-list
   "Get the list of collections (datasets) for the given provider."

(defn- delete-collection-sql
  "Generate SQL to delete a collection from a provider's collection table."
  [provider-id collection-id]
  ;; FIXME - this runs as the metadata db user so it's not necessary to specify the tablespace
  ;; FIXME - Don't manually create the table names here. This should use shared code from metadata db or something.
  (let [collection-table (keyword (str metadata-db-tablespace "." provider-id "-collections"))]
    (su/build (delete collection-table (where `(= :concept-id ~collection-id))))))

(defn- delete-collection

(defn- get-dataset-record-id-for-collection-sql
  "Generate SQL to retrieve the id for a given collection/dataset from the catalog-rest table."
  [provider-id collection-id]
  (su/build (select [:id] (from (catalog-rest-dataset-table provider-id))
                    (where `(= :echo-collection-id ~collection-id)))))

(defn- get-dataset-record-id-for-collection
  "Retrieve the id for a given collection/dataset from the catalog-rest table."
