Skip to content
This repository has been archived by the owner on Mar 22, 2022. It is now read-only.

Commit

Permalink
Allow namespaced tables
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorin Vogel committed Jan 29, 2019
1 parent b4f3a3d commit 50bb414
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject googlesheets-sql-sync "0.4.9"
(defproject googlesheets-sql-sync "0.4.10"
:description "Keep your SQL database in sync with Google Sheets"
:url "https://github.com/jorinvo/googlesheets-sql-sync"
:license {:name "MIT"
Expand Down
4 changes: 2 additions & 2 deletions src/googlesheets_sql_sync/db.clj
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@
Returns nil if table does not exist."
[db table]
(log/info "Getting table headers")
(let [s (str "select * from \"" (escape table "\"") "\" limit 1")]
(let [s (str "select * from " table " limit 1")]
(try
(if-let [h (-> (jdbc/query db s {:identifiers identity
:keywordize? false})
first
keys)]
h
(do (println "Table is empty, dropping it")
(do (log/info "Table is empty, dropping it")
(jdbc/execute! db (str "drop table " table))
nil))
(catch java.sql.SQLException e (when-not (.contains
Expand Down

0 comments on commit 50bb414

Please sign in to comment.