blazer 3.0.1 → 3.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/LICENSE.txt +1 -1
- data/README.md +1 -1
- data/app/controllers/blazer/base_controller.rb +2 -0
- data/lib/blazer/adapters/sql_adapter.rb +14 -8
- data/lib/blazer/version.rb +1 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ecc87353b5a9b96402e82c59b497929b5544f320d6c9f82316b92d005c18f74d
|
4
|
+
data.tar.gz: 19b1a0697e3901e25c8b77f2ce769d427849c97f8012240fdce26a74f069c03d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c090577a5e80ac9ae9a870e096d1317b78cd7815fb6f9e65a1e59bb41fb779d2cbac6f37ec3cb3854351069d57b52b5937fa7cb1e0a85d73919ee59229501d8a
|
7
|
+
data.tar.gz: 1590b68605c634a98a3ee4794eae49c5b19b9d683ff453871117983684e70c3b0c3222298e63a312719b9a676aa3d364a56dcc1664c10c2146800736103e4638
|
data/CHANGELOG.md
CHANGED
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -10,7 +10,7 @@ Blazer is also available as a [Docker image](https://github.com/ankane/blazer-do
|
|
10
10
|
|
11
11
|
:tangerine: Battle-tested at [Instacart](https://www.instacart.com/opensource)
|
12
12
|
|
13
|
-
[](https://github.com/ankane/blazer/actions)
|
14
14
|
|
15
15
|
## Features
|
16
16
|
|
@@ -21,15 +21,21 @@ module Blazer
|
|
21
21
|
error = nil
|
22
22
|
|
23
23
|
begin
|
24
|
+
result = nil
|
24
25
|
in_transaction do
|
25
26
|
set_timeout(data_source.timeout) if data_source.timeout
|
26
|
-
|
27
27
|
binds = bind_params.map { |v| ActiveRecord::Relation::QueryAttribute.new(nil, v, ActiveRecord::Type::Value.new) }
|
28
28
|
result = connection_model.connection.select_all("#{statement} /*#{comment}*/", nil, binds)
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
29
|
+
end
|
30
|
+
|
31
|
+
columns = result.columns
|
32
|
+
result.rows.each do |untyped_row|
|
33
|
+
rows << (result.column_types.empty? ? untyped_row : columns.each_with_index.map { |c, i| untyped_row[i] && result.column_types[c] ? result.column_types[c].send(:cast_value, untyped_row[i]) : untyped_row[i] })
|
34
|
+
end
|
35
|
+
|
36
|
+
# fix for non-ASCII column names and charts
|
37
|
+
if adapter_name == "Trilogy"
|
38
|
+
columns.map! { |k| k.dup.force_encoding(Encoding::UTF_8) }
|
33
39
|
end
|
34
40
|
rescue => e
|
35
41
|
error = e.message.sub(/.+ERROR: /, "")
|
@@ -194,10 +200,10 @@ module Blazer
|
|
194
200
|
|
195
201
|
# Redshift adapter silently ignores binds
|
196
202
|
def parameter_binding
|
197
|
-
if postgresql?
|
198
|
-
# Active Record < 6.1 silently ignores binds with Postgres when prepared statements are disabled
|
203
|
+
if postgresql?
|
199
204
|
:numeric
|
200
|
-
elsif sqlite?
|
205
|
+
elsif sqlite? && prepared_statements?
|
206
|
+
# Active Record silently ignores binds with SQLite when prepared statements are disabled
|
201
207
|
:numeric
|
202
208
|
elsif mysql? && prepared_statements?
|
203
209
|
# Active Record silently ignores binds with MySQL when prepared statements are disabled
|
data/lib/blazer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blazer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0.4'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: csv
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
69
83
|
description:
|
70
84
|
email: andrew@ankane.org
|
71
85
|
executables: []
|
@@ -237,7 +251,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
237
251
|
- !ruby/object:Gem::Version
|
238
252
|
version: '0'
|
239
253
|
requirements: []
|
240
|
-
rubygems_version: 3.
|
254
|
+
rubygems_version: 3.5.3
|
241
255
|
signing_key:
|
242
256
|
specification_version: 4
|
243
257
|
summary: Explore your data with SQL. Easily create charts and dashboards, and share
|