pg_query 0.7.1 → 0.7.2

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
  SHA1:
3
- metadata.gz: 64ead8467a9aeb8238aff25b10396577e21e46c0
4
- data.tar.gz: 0c1b17563b05e8216e06c6bbb9041c2c2d8f70bc
3
+ metadata.gz: 6e2221d8f3406cdcf089deef33f32254ce7e31d7
4
+ data.tar.gz: ab799b6646ac73cc6187a132aeb464b5997ff846
5
5
  SHA512:
6
- metadata.gz: 6877feae2dd1e47c80d07dd684bc8036c42b539ed00adcce25bffc52d9df62043937f6fc572d8be7becfbdabbfaf4616aef69cca7bf3f2a4f626d67c0862450b
7
- data.tar.gz: 7e28d3b841b94ad22fb4ff2a8229abd98ce84916811cf948e10f1013eddc3b85600af9d9e6c3b54bb717c34f5d7fc901c508f7fdf7c9855c9216cc062ca3b5e8
6
+ metadata.gz: a63740f4b574bca187e5b46b6a06689fa9be3901feac7da5654a6f2d9d45cc08445c9f64555eb495ad72da7c9068619d9f02d8bd1a3423d1fe12649a7cae101a
7
+ data.tar.gz: a06bc79392566e5eeed371f8da1c7ecb0d6a6b850d83e9c7d81423d00d60f046fcffc61c5be1d6bb51f600a3965eed734a8dd263a689575ff6236ec007ce1bb2
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.7.2 2015-12-20
4
+
5
+ * Deparsing
6
+ * Quote all column refs [#40](https://github.com/lfittl/pg_query/pull/40) [@avinoamr](https://github.com/avinoamr)
7
+ * Quote all range vars [#43](https://github.com/lfittl/pg_query/pull/43) [@avinoamr](https://github.com/avinoamr)
8
+ * Support for COUNT(DISTINCT ...) [#42](https://github.com/lfittl/pg_query/pull/42) [@avinoamr](https://github.com/avinoamr)
9
+
10
+
3
11
  ## 0.7.1 2015-11-17
4
12
 
5
13
  * Abstracted parser access into libpg_query [#24](https://github.com/lfittl/pg_query/pull/35)
@@ -136,7 +136,7 @@ class PgQuery
136
136
  def deparse_rangevar(node)
137
137
  output = []
138
138
  output << 'ONLY' if node['inhOpt'] == 0
139
- output << node['relname']
139
+ output << '"' + node['relname'] + '"'
140
140
  output << deparse_item(node['alias']) if node['alias']
141
141
  output.join(' ')
142
142
  end
@@ -156,7 +156,7 @@ class PgQuery
156
156
 
157
157
  def deparse_columnref(node)
158
158
  node['fields'].map do |field|
159
- field.is_a?(String) ? field : deparse_item(field)
159
+ field.is_a?(String) ? '"' + field + '"' : deparse_item(field)
160
160
  end.join('.')
161
161
  end
162
162
 
@@ -251,7 +251,8 @@ class PgQuery
251
251
  args << '*' if node['agg_star']
252
252
 
253
253
  name = (node['funcname'] - ['pg_catalog']).join('.')
254
- output << format('%s(%s)', name, args.join(', '))
254
+ distinct = node['agg_distinct'] ? 'DISTINCT ' : ''
255
+ output << format('%s(%s%s)', name, distinct, args.join(', '))
255
256
  output << format('OVER (%s)', deparse_item(node['over'])) if node['over']
256
257
 
257
258
  output.join(' ')
@@ -1,3 +1,3 @@
1
1
  class PgQuery
2
- VERSION = '0.7.1'
2
+ VERSION = '0.7.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_query
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lukas Fittl
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-17 00:00:00.000000000 Z
11
+ date: 2015-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler
@@ -133,8 +133,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
133
  version: '0'
134
134
  requirements: []
135
135
  rubyforge_project:
136
- rubygems_version: 2.4.5.1
136
+ rubygems_version: 2.4.5
137
137
  signing_key:
138
138
  specification_version: 4
139
139
  summary: PostgreSQL query parsing and normalization library
140
140
  test_files: []
141
+ has_rdoc: