Skip to content
Snippets Groups Projects
Commit 9571b388 authored by Cam Saul's avatar Cam Saul
Browse files

fix mongo driver connection w/ passwords :unamused:

parent 07a4863a
Branches
Tags
No related merge requests found
......@@ -6,14 +6,14 @@
[metabase.driver :as driver]))
(defn- details-map->connection-string
[{:keys [user password host port dbname]}]
[{:keys [user pass host port dbname]}]
{:pre [host
dbname]}
(str "mongodb://"
user
(when password
(when pass
(assert user "Can't have a password without a user!")
(str ":" password))
(str ":" pass))
(when user "@")
host
(when port
......
......@@ -122,9 +122,12 @@
"Update the row count of TABLE if it has changed."
[table]
{:pre [(integer? (:id table))]}
(let [table-row-count (queries/table-row-count table)]
(when-not (= (:rows table) table-row-count)
(upd Table (:id table) :rows table-row-count))))
(try
(let [table-row-count (queries/table-row-count table)]
(when-not (= (:rows table) table-row-count)
(upd Table (:id table) :rows table-row-count)))
(catch Throwable e
(log/error (color/red (format "Unable to update row_count for %s: %s" (:name table) (.getMessage e)))))))
;; ### 2) sync-table-active-fields-and-pks!
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment