Permalink
Browse files

Fixed preview for MySQL - closes #109

  • Loading branch information...
1 parent 7814a6e commit 1f9e2ae248d90fcc4991d384400eafd327a028e0 @ankane committed Dec 16, 2016
Showing with 10 additions and 2 deletions.
  1. +4 −0 CHANGELOG.md
  2. +1 −1 app/views/blazer/queries/_form.html.erb
  3. +5 −1 lib/blazer/adapters/sql_adapter.rb
View
@@ -1,3 +1,7 @@
+## 1.7.7 [unreleased]
+
+- Fixed preview error with MySQL
+
## 1.7.6
- Added scatter chart
@@ -218,7 +218,7 @@
var $select = $("#table_names").selectize({})
var selectize = $select[0].selectize
selectize.on("change", function(val) {
- editor.setValue(previewStatement[_this.dataSource].replace("{table}", '"' + val + '"'), 1)
+ editor.setValue(previewStatement[_this.dataSource].replace("{table}", val), 1)
_this.run()
selectize.clear(true)
selectize.blur()
@@ -51,7 +51,11 @@ def schema
end
def preview_statement
- "SELECT * FROM {table} LIMIT 10"
+ if postgresql?
+ "SELECT * FROM \"{table}\" LIMIT 10"
+ else
+ "SELECT * FROM {table} LIMIT 10"
+ end
end
def reconnect

0 comments on commit 1f9e2ae

Please sign in to comment.