niceql 0.1.22 → 0.1.23

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b00aaefbdb5837f56163c43dfd8c3599add288f5d71e0df6aad33760771562bb
4
- data.tar.gz: 06544b54f77cd4cc54a1b5b44ae8d1438bf57a9b6efc29c9408de7d35c75c8d9
3
+ metadata.gz: 1dfcafe0d0be8d92b64b06342910568796ddc264a914a930e8bd183ace83f1e9
4
+ data.tar.gz: 19b896ec5e2e36c637f3bd7cff237cfff26581c211702d640e7fcd5a782832a9
5
5
  SHA512:
6
- metadata.gz: 5580c574b821e14a804252e7f2037341ca3e8c98d9b0b33d22057557cad29b4d1f4701773b2018a29183002280566861ccad962877b29bfcfda0db412d91f69b
7
- data.tar.gz: 9d3ef9a43ab6b97e08c577521486e1b9c0151ba62848a47f096c0d31c521c0ff9b997795d3f8d62b78d4252ad8cd94fad8f8614032847dde5ad2f8fbc28cc830
6
+ metadata.gz: e801df8dd07905db21ff697b7961a10d80a67895ad1f5cf991e68f11e24fc1942fa9d7a196a3a9a30cb4b992d002a38daef19deb1e235c7f5baeadd72e167065
7
+ data.tar.gz: 3b4e129aa6a0b49178c809239feb346a454e50da6cd8d930a4b465b16a29078ae23df99d14c9b90536671c3475af9e31f3f24de7535626ac4919f03bbe4cddd3
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.1.23
2
+ * +LATERAL verb
3
+ * removed hidden rails dependencies PR(https://github.com/alekseyl/niceql/pull/9)
4
+
1
5
  # 0.1.22
2
6
  * multi query formatting
3
7
 
data/lib/niceql.rb CHANGED
@@ -35,7 +35,7 @@ module Niceql
35
35
 
36
36
  module Prettifier
37
37
  INLINE_VERBS = %w(WITH ASC (IN\s) COALESCE AS WHEN THEN ELSE END AND UNION ALL ON DISTINCT INTERSECT EXCEPT EXISTS NOT COUNT ROUND CAST).join('| ')
38
- NEW_LINE_VERBS = 'SELECT|FROM|WHERE|CASE|ORDER BY|LIMIT|GROUP BY|(RIGHT |LEFT )*(INNER |OUTER )*JOIN|HAVING|OFFSET|UPDATE'
38
+ NEW_LINE_VERBS = 'SELECT|FROM|WHERE|CASE|ORDER BY|LIMIT|GROUP BY|(RIGHT |LEFT )*(INNER |OUTER )*JOIN( LATERAL)*|HAVING|OFFSET|UPDATE'
39
39
  POSSIBLE_INLINER = /(ORDER BY|CASE)/
40
40
  VERBS = "#{NEW_LINE_VERBS}|#{INLINE_VERBS}"
41
41
  STRINGS = /("[^"]+")|('[^']+')/
@@ -229,7 +229,7 @@ module Niceql
229
229
 
230
230
  module ErrorExt
231
231
  def to_s
232
- if Niceql.config.prettify_pg_errors && ActiveRecord::Base.configurations[Rails.env]['adapter'] == 'postgresql'
232
+ if Niceql.config.prettify_pg_errors && ActiveRecord::Base.connection_config['adapter'] == 'postgresql'
233
233
  Prettifier.prettify_err(super)
234
234
  else
235
235
  super
@@ -250,7 +250,7 @@ module Niceql
250
250
  self.indentation_base = 2
251
251
  self.open_bracket_is_newliner = false
252
252
  self.prettify_active_record_log_output = false
253
- self.prettify_pg_errors = defined? ::ActiveRecord::Base && ActiveRecord::Base.configurations[Rails.env]['adapter'] == 'postgresql'
253
+ self.prettify_pg_errors = defined? ::ActiveRecord::Base && ActiveRecord::Base.connection_config['adapter'] == 'postgresql'
254
254
  end
255
255
  end
256
256
 
@@ -1,3 +1,3 @@
1
1
  module Niceql
2
- VERSION = "0.1.22"
2
+ VERSION = "0.1.23"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: niceql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.22
4
+ version: 0.1.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - alekseyl
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-06-06 00:00:00.000000000 Z
11
+ date: 2018-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler