pg_query 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +155 -114
- data/Rakefile +6 -7
- data/ext/pg_query/extconf.rb +2 -1
- data/ext/pg_query/include/pg_config.h +1 -0
- data/ext/pg_query/pg_query_deparse.c +19 -17
- data/ext/pg_query/pg_query_fingerprint.c +4 -1
- data/lib/pg_query/filter_columns.rb +2 -0
- data/lib/pg_query/parse.rb +2 -2
- data/lib/pg_query/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 710ab71b06be359f6072242754970015712cdad8839c1811470292fad47c880e
|
4
|
+
data.tar.gz: 1c16c458bdc5f32798dc74839a9d6721bbfa56b754768a64a8bbcbd3b63f13c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4263eebc1add9d84d008d9405e6188dcccc01beec592ed915c80ae6edaaf18a452bb947a18b1af0279d7c5be7e68e871e727cb50d2f36c831694825774fa74de
|
7
|
+
data.tar.gz: 6e4b4ed4202cf46562cd2dc2281cec07c487e19db79f1df14b3797dba512182daedcccb9299cd0374d4b3163c5400579b71aa18800280e75f9fa499eec997a9a
|
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,24 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## Unreleased
|
4
|
+
|
5
|
+
|
6
|
+
## 2.0.2 2021-03-31
|
7
|
+
|
8
|
+
* `COALESCE` arguments are now included in `#filter_columns`
|
9
|
+
* Improve error message for protobuf parse failures
|
10
|
+
* Extconf: Fix object path regexp
|
11
|
+
- This accidentally replaced `.c` in the wrong parts of the path in some cases,
|
12
|
+
causing build failures
|
13
|
+
* Update to libpg_query 13-2.0.2
|
14
|
+
- Fix ARM builds: Avoid dependency on cpuid.h header
|
15
|
+
- Simplify deparser of TableLikeClause
|
16
|
+
- Fix asprintf warnings by ensuring _GNU_SOURCE is set early enough
|
17
|
+
|
18
|
+
|
3
19
|
## 2.0.1 2021-03-18
|
4
20
|
|
5
|
-
* Fix
|
21
|
+
* Fix gemspec to correctly reference include files
|
6
22
|
- This would have shown as a build failure when using the published `2.0.0` gem
|
7
23
|
|
8
24
|
|
@@ -19,23 +35,23 @@
|
|
19
35
|
* Use new deparser maintained directly in libpg_query
|
20
36
|
* This replaces the complete Ruby deparser with a new, more complete deparser
|
21
37
|
that is directly maintained in libpg_query. Further deparser improvements
|
22
|
-
should be directly contributed to [libpg_query]
|
23
|
-
* Tables helper: Return more details through
|
24
|
-
* This is renamed from the previously badly named
|
38
|
+
should be directly contributed to [libpg_query]
|
39
|
+
* Tables helper: Return more details through `#tables_with_details` method
|
40
|
+
* This is renamed from the previously badly named `#tables_with_types`
|
25
41
|
method. Note that this change should not affect the output of the
|
26
|
-
primary
|
42
|
+
primary `tables` helper.
|
27
43
|
* Replace on-demand libpg_query source download with bundled source code
|
28
44
|
* Its unnecessary to download the source on-demand, and makes this more
|
29
45
|
complex than it needs to be. Instead, introduce a new "update_source" rake
|
30
46
|
task that can be called to refresh the source for a specified revision.
|
31
47
|
* Re-implement smart truncation without requiring a special node type
|
32
|
-
* This ensures the truncate method works with the new deparser, without
|
48
|
+
* This ensures the `#truncate` method works with the new deparser, without
|
33
49
|
the C level code needing to know about it. We may add it in the C library
|
34
50
|
in the future for edge cases that can't be covered by this slightly
|
35
51
|
hack-ish approach, but for now this avoids unnecessary C library
|
36
52
|
deparser modifications with non-standard node types.
|
37
|
-
* Update Ruby
|
38
|
-
* Note that its recommended to use PgQuery.fingerprint for performance
|
53
|
+
* Update Ruby fingerprinting to new fingerprint format and XXH3 hash
|
54
|
+
* Note that its recommended to use `PgQuery.fingerprint` for performance
|
39
55
|
reasons, but when the tree has been modified, it can be convenient to
|
40
56
|
run a Ruby-side fingerprint instead of the C-based one that is faster.
|
41
57
|
|
@@ -44,25 +60,25 @@
|
|
44
60
|
|
45
61
|
* Incorporate newer libpg_query updates in 10-1.0.3 and 10-1.0.4
|
46
62
|
* Adds support for running on ARM
|
47
|
-
* Fixes asprintf warning during builds
|
63
|
+
* Fixes an asprintf warning during builds
|
48
64
|
* Updates to newer Postgres 10 patch release (10.15)
|
49
|
-
* Deparsing improvements by [@emin100]
|
50
|
-
* Add support for additional DROP statements (#147)
|
51
|
-
* Fix CREATE TABLE AS - Support without TEMP
|
52
|
-
* Empty target list support (#156)
|
53
|
-
* UNION parentheses (#158)
|
54
|
-
* OVERLAY keyword function (#161)
|
55
|
-
* Array indirection (#162)
|
56
|
-
* ARRAY functions (#163)
|
57
|
-
* Correctly handle column names that need escaping in INSERT and UPDATE statements (#164)
|
58
|
-
* INSERT INTO ON CONFLICT (#166)
|
59
|
-
* LATERAL JOIN (#168)
|
60
|
-
* UPDATE FROM clause (#170)
|
61
|
-
* SELECT aggregate FILTER (#175)
|
62
|
-
* INTERSECT operator (#176)
|
63
|
-
* Deparsing: Improve handling of boolean type casts [@himanshu-pro]
|
64
|
-
* `tables` method: Find tables in the subquery of CREATE TABLE AS (#172
|
65
|
-
* Support Ruby 3.0, verify SHA256 checksum of downloaded libpg_query (#178
|
65
|
+
* Deparsing improvements by [@emin100]
|
66
|
+
* Add support for additional DROP statements ([#147](https://github.com/pganalyze/pg_query/pull/147))
|
67
|
+
* Fix `CREATE TABLE AS` - Support without `TEMP`, Add `ON COMMIT` ([#149](https://github.com/pganalyze/pg_query/pull/149))
|
68
|
+
* Empty target list support ([#156](https://github.com/pganalyze/pg_query/pull/156))
|
69
|
+
* `UNION` parentheses ([#158](https://github.com/pganalyze/pg_query/pull/158))
|
70
|
+
* `OVERLAY` keyword function ([#161](https://github.com/pganalyze/pg_query/pull/161))
|
71
|
+
* Array indirection ([#162](https://github.com/pganalyze/pg_query/pull/162))
|
72
|
+
* `ARRAY` functions ([#163](https://github.com/pganalyze/pg_query/pull/163))
|
73
|
+
* Correctly handle column names that need escaping in `INSERT` and `UPDATE` statements ([#164](https://github.com/pganalyze/pg_query/pull/164))
|
74
|
+
* `INSERT INTO ON CONFLICT` ([#166](https://github.com/pganalyze/pg_query/pull/166))
|
75
|
+
* `LATERAL JOIN` ([#168](https://github.com/pganalyze/pg_query/pull/168))
|
76
|
+
* `UPDATE FROM` clause ([#170](https://github.com/pganalyze/pg_query/pull/170))
|
77
|
+
* `SELECT` aggregate `FILTER` ([#175](https://github.com/pganalyze/pg_query/pull/175))
|
78
|
+
* `INTERSECT` operator ([#176](https://github.com/pganalyze/pg_query/pull/176))
|
79
|
+
* Deparsing: Improve handling of boolean type casts [@himanshu-pro] & [@emin100]
|
80
|
+
* `tables` method: Find tables in the subquery of `CREATE TABLE AS` ([#172](https://github.com/pganalyze/pg_query/pull/172)) [@Tassosb]
|
81
|
+
* Support Ruby 3.0, verify SHA256 checksum of downloaded libpg_query ([#178](https://github.com/pganalyze/pg_query/pull/178)) [@stanhu]
|
66
82
|
* Verify SHA256 checksum to guard against any malicious attempts to change the archive
|
67
83
|
* Use `URI.open` to fix Ruby 3.0 support
|
68
84
|
|
@@ -78,69 +94,69 @@
|
|
78
94
|
|
79
95
|
## 1.1.1 2019-11-10
|
80
96
|
|
81
|
-
* Deparsing improvements by [@emin100]
|
82
|
-
* Deparse ILIKE
|
83
|
-
* CREATE CAST (#136)
|
84
|
-
* CREATE SCHEMA (#136)
|
85
|
-
* UNION
|
86
|
-
* CREATE DOMAIN (#145)
|
87
|
-
* Subquery indirection (#157)
|
88
|
-
* Fix Type Cast Parentheses Problem (#152)
|
89
|
-
* SELECT INTO (#151)
|
90
|
-
* SET DEFAULT in INSERT INTO (#154)
|
91
|
-
* REVOKE (#155)
|
92
|
-
* PREPARE and EXECUTE (#148)
|
93
|
-
* INSERT INTO ... RETURNING (#153)
|
94
|
-
* Fix Alter .. RENAME SQL (#146)
|
95
|
-
* Deparsing improvements by [@herwinw]
|
96
|
-
* Fix subquery in COPY in deparse (#112)
|
97
|
-
* Function call indirection (#116)
|
98
|
-
* Function without parameters (#117)
|
99
|
-
* CREATE AGGREGATE
|
100
|
-
* CREATE OPERATOR
|
101
|
-
* CREATE TYPE
|
102
|
-
* GRANT statements
|
103
|
-
* DROP SCHEMA
|
104
|
-
* Deparsing improvements by [@akiellor]
|
105
|
-
* Named window functions (#150)
|
106
|
-
* Deparsing improvements by [@himanshu]
|
107
|
-
* Arguments in custom types (#143)
|
108
|
-
* Use "double precision" instead of "double" type name (#139)
|
109
|
-
* Use explicit -z flag to support OpenBSD tar (#134
|
97
|
+
* Deparsing improvements by [@emin100]
|
98
|
+
* Deparse `ILIKE`, `COLLATE` and `DISCARD` ([#133](https://github.com/pganalyze/pg_query/pull/133))
|
99
|
+
* `CREATE CAST` ([#136](https://github.com/pganalyze/pg_query/pull/136))
|
100
|
+
* `CREATE SCHEMA` ([#136](https://github.com/pganalyze/pg_query/pull/136))
|
101
|
+
* `UNION`, `UNION ALL` and `EXCEPT` in `SELECT` queries ([#136](https://github.com/pganalyze/pg_query/pull/136))
|
102
|
+
* `CREATE DOMAIN` ([#145](https://github.com/pganalyze/pg_query/pull/145))
|
103
|
+
* Subquery indirection ([#157](https://github.com/pganalyze/pg_query/pull/157))
|
104
|
+
* Fix Type Cast Parentheses Problem ([#152](https://github.com/pganalyze/pg_query/pull/152))
|
105
|
+
* `SELECT INTO` ([#151](https://github.com/pganalyze/pg_query/pull/151))
|
106
|
+
* `SET DEFAULT` in `INSERT INTO` ([#154](https://github.com/pganalyze/pg_query/pull/154))
|
107
|
+
* `REVOKE` ([#155](https://github.com/pganalyze/pg_query/pull/155))
|
108
|
+
* `PREPARE` and `EXECUTE` ([#148](https://github.com/pganalyze/pg_query/pull/148))
|
109
|
+
* `INSERT INTO ... RETURNING` ([#153](https://github.com/pganalyze/pg_query/pull/153))
|
110
|
+
* Fix Alter .. `RENAME SQL` ([#146](https://github.com/pganalyze/pg_query/pull/146))
|
111
|
+
* Deparsing improvements by [@herwinw]
|
112
|
+
* Fix subquery in `COPY` in deparse ([#112](https://github.com/pganalyze/pg_query/pull/112))
|
113
|
+
* Function call indirection ([#116](https://github.com/pganalyze/pg_query/pull/116))
|
114
|
+
* Function without parameters ([#117](https://github.com/pganalyze/pg_query/pull/117))
|
115
|
+
* `CREATE AGGREGATE`
|
116
|
+
* `CREATE OPERATOR`
|
117
|
+
* `CREATE TYPE`
|
118
|
+
* `GRANT` statements
|
119
|
+
* `DROP SCHEMA`
|
120
|
+
* Deparsing improvements by [@akiellor]
|
121
|
+
* Named window functions ([#150](https://github.com/pganalyze/pg_query/pull/150))
|
122
|
+
* Deparsing improvements by [@himanshu]
|
123
|
+
* Arguments in custom types ([#143](https://github.com/pganalyze/pg_query/pull/143))
|
124
|
+
* Use "double precision" instead of "double" type name ([#139](https://github.com/pganalyze/pg_query/pull/139))
|
125
|
+
* Use explicit -z flag to support OpenBSD tar ([#134](https://github.com/pganalyze/pg_query/pull/134)) [@sirn]
|
110
126
|
* Add Ruby 2.6 to Travis tests
|
111
127
|
* Escape identifiers in more cases, if necessary
|
112
128
|
|
113
129
|
|
114
130
|
## 1.1.0 2018-10-04
|
115
131
|
|
116
|
-
* Deparsing improvements by [@herwinw]
|
117
|
-
* Add NULLS FIRST
|
118
|
-
* VACUUM [#97](https://github.com/pganalyze/pg_query/pull/97)
|
119
|
-
* UPDATE with multiple columns [#99](https://github.com/pganalyze/pg_query/pull/99)
|
120
|
-
* DISTINCT ON [#101](https://github.com/pganalyze/pg_query/pull/101)
|
121
|
-
* CREATE TABLE AS [#102](https://github.com/pganalyze/pg_query/pull/102)
|
132
|
+
* Deparsing improvements by [@herwinw]
|
133
|
+
* Add `NULLS FIRST`/`LAST` to `ORDER BY` [#95](https://github.com/pganalyze/pg_query/pull/95)
|
134
|
+
* `VACUUM` [#97](https://github.com/pganalyze/pg_query/pull/97)
|
135
|
+
* `UPDATE` with multiple columns [#99](https://github.com/pganalyze/pg_query/pull/99)
|
136
|
+
* `DISTINCT ON` [#101](https://github.com/pganalyze/pg_query/pull/101)
|
137
|
+
* `CREATE TABLE AS` [#102](https://github.com/pganalyze/pg_query/pull/102)
|
122
138
|
* SQL value functions [#103](https://github.com/pganalyze/pg_query/pull/103)
|
123
|
-
* LOCK [#105](https://github.com/pganalyze/pg_query/pull/105)
|
124
|
-
* EXPLAIN [#107](https://github.com/pganalyze/pg_query/pull/107)
|
125
|
-
* COPY [#108](https://github.com/pganalyze/pg_query/pull/108)
|
126
|
-
* DO [#109](https://github.com/pganalyze/pg_query/pull/109)
|
127
|
-
* Ignore pg_query.so in git checkout [#110](https://github.com/pganalyze/pg_query/pull/110) [@herwinw]
|
128
|
-
* Prefer __dir__ over File.dirname(__FILE__) [#110](https://github.com/pganalyze/pg_query/pull/104) [@herwinw]
|
139
|
+
* `LOCK` [#105](https://github.com/pganalyze/pg_query/pull/105)
|
140
|
+
* `EXPLAIN` [#107](https://github.com/pganalyze/pg_query/pull/107)
|
141
|
+
* `COPY` [#108](https://github.com/pganalyze/pg_query/pull/108)
|
142
|
+
* `DO` [#109](https://github.com/pganalyze/pg_query/pull/109)
|
143
|
+
* Ignore pg_query.so in git checkout [#110](https://github.com/pganalyze/pg_query/pull/110) [@herwinw]
|
144
|
+
* Prefer `__dir__` over `File.dirname(__FILE__)` [#110](https://github.com/pganalyze/pg_query/pull/104) [@herwinw]
|
129
145
|
|
130
146
|
|
131
147
|
## 1.0.2 2018-04-11
|
132
148
|
|
133
149
|
* Deparsing improvements
|
134
|
-
* SELECT DISTINCT clause [#77](https://github.com/pganalyze/pg_query/pull/77) [@Papierkorb]
|
135
|
-
* "CASE expr WHEN ... END" clause [#78](https://github.com/pganalyze/pg_query/pull/78) [@Papierkorb]
|
136
|
-
* LEFT
|
137
|
-
* SELECT that includes schema name [#80](https://github.com/pganalyze/pg_query/pull/80) [@jcsjcs]
|
150
|
+
* `SELECT DISTINCT` clause [#77](https://github.com/pganalyze/pg_query/pull/77) [@Papierkorb]
|
151
|
+
* "`CASE expr WHEN ... END`" clause [#78](https://github.com/pganalyze/pg_query/pull/78) [@Papierkorb]
|
152
|
+
* `LEFT`/`RIGHT`/`FULL`/`NATURAL JOIN` [#79](https://github.com/pganalyze/pg_query/pull/79) [@Papierkorb]
|
153
|
+
* `SELECT` that includes schema name [#80](https://github.com/pganalyze/pg_query/pull/80) [@jcsjcs]
|
138
154
|
|
139
155
|
|
140
156
|
## 1.0.1 2018-02-02
|
141
157
|
|
142
|
-
* Parse CTEs and nested selects in INSERT/UPDATE [#76](https://github.com/pganalyze/pg_query/pull/76) [@jcoleman]
|
143
|
-
* Drop explicit json dependency [#74](https://github.com/pganalyze/pg_query/pull/74) [@yuki24]
|
158
|
+
* Parse CTEs and nested selects in INSERT/UPDATE [#76](https://github.com/pganalyze/pg_query/pull/76) [@jcoleman]
|
159
|
+
* Drop explicit json dependency [#74](https://github.com/pganalyze/pg_query/pull/74) [@yuki24]
|
144
160
|
|
145
161
|
|
146
162
|
## 1.0.0 2017-10-31
|
@@ -155,7 +171,7 @@
|
|
155
171
|
## 0.13.5 2017-10-26
|
156
172
|
|
157
173
|
* Update to libpg_query 9.5-1.7.1
|
158
|
-
- Allow "
|
174
|
+
- Allow "`$1 FROM $2`" to be parsed (new with pg_stat_statements in Postgres 10)
|
159
175
|
|
160
176
|
|
161
177
|
## 0.13.4 2017-10-20
|
@@ -166,12 +182,12 @@
|
|
166
182
|
|
167
183
|
## 0.13.3 2017-09-04
|
168
184
|
|
169
|
-
* Fix table detection for SELECTs that have sub-SELECTs without FROM clause [#69](https://github.com/pganalyze/pg_query/issues/69)
|
185
|
+
* Fix table detection for SELECTs that have sub-SELECTs without `FROM` clause [#69](https://github.com/pganalyze/pg_query/issues/69)
|
170
186
|
|
171
187
|
|
172
188
|
## 0.13.2 2017-08-10
|
173
189
|
|
174
|
-
* Support table detection in sub-SELECTs in
|
190
|
+
* Support table detection in sub-SELECTs in `JOIN`s [#68](https://github.com/pganalyze/pg_query/pull/65) [@seanmdick]
|
175
191
|
* Legacy ".parsetree" helper: Fix "Between" and "In" operator does not have "AEXPR" [#66](https://github.com/pganalyze/pg_query/issues/66)
|
176
192
|
* For new applications please use ".tree" method which uses the native structure
|
177
193
|
returned from libpg_query which resembles Postgres node names more closely
|
@@ -179,13 +195,13 @@
|
|
179
195
|
|
180
196
|
## 0.13.1 2017-08-03
|
181
197
|
|
182
|
-
* Fix regression in 0.13.1 that broke ".tables" logic for COPY statements that
|
198
|
+
* Fix regression in 0.13.1 that broke ".tables" logic for `COPY` statements that
|
183
199
|
don't have a target table (i.e. are reading out data vs copying in)
|
184
200
|
|
185
201
|
|
186
202
|
## 0.13.0 2017-07-30
|
187
203
|
|
188
|
-
* Introduce split between SELECT/DML/DDL for tables method [#65](https://github.com/pganalyze/pg_query/pull/65) [@chrisfrommann]
|
204
|
+
* Introduce split between SELECT/DML/DDL for tables method [#65](https://github.com/pganalyze/pg_query/pull/65) [@chrisfrommann]
|
189
205
|
* Backwards compatible, use the new select_tables/dml_tables/ddl_tables to
|
190
206
|
access the categorized table references
|
191
207
|
* Update libpg_query to 9.5-1.6.2
|
@@ -213,14 +229,14 @@
|
|
213
229
|
|
214
230
|
## 0.11.5 2017-07-09
|
215
231
|
|
216
|
-
* Deparse coldeflist [#64](https://github.com/pganalyze/pg_query/pull/64) [@jcsjcs]
|
217
|
-
* Use Integer class for checking integer instead of Fixnum [#62](https://github.com/pganalyze/pg_query/pull/62) [@makimoto]
|
232
|
+
* Deparse coldeflist [#64](https://github.com/pganalyze/pg_query/pull/64) [@jcsjcs]
|
233
|
+
* Use Integer class for checking integer instead of Fixnum [#62](https://github.com/pganalyze/pg_query/pull/62) [@makimoto]
|
218
234
|
|
219
235
|
|
220
236
|
## 0.11.4 2017-01-18
|
221
237
|
|
222
|
-
* Compatibility with Ruby 2.4 [#59](https://github.com/pganalyze/pg_query/pull/59) [@merqlove]
|
223
|
-
* Deparse varchar and numeric casts without arguments [#61](https://github.com/pganalyze/pg_query/pull/61) [@jcsjcs]
|
238
|
+
* Compatibility with Ruby 2.4 [#59](https://github.com/pganalyze/pg_query/pull/59) [@merqlove]
|
239
|
+
* Deparse varchar and numeric casts without arguments [#61](https://github.com/pganalyze/pg_query/pull/61) [@jcsjcs]
|
224
240
|
|
225
241
|
|
226
242
|
## 0.11.3 2016-12-06
|
@@ -228,12 +244,12 @@
|
|
228
244
|
* Update to newest libpg_query version (9.5-1.4.2)
|
229
245
|
* Cut off fingerprints at 100 nodes deep to avoid excessive runtimes/memory
|
230
246
|
* Fix warning on Linux due to missing asprintf include
|
231
|
-
* Improved deparsing [@jcsjcs]
|
247
|
+
* Improved deparsing [@jcsjcs]
|
232
248
|
* Float [#54](https://github.com/pganalyze/pg_query/pull/54)
|
233
|
-
* BETWEEN [#55](https://github.com/pganalyze/pg_query/pull/55)
|
234
|
-
* NULLIF [#56](https://github.com/pganalyze/pg_query/pull/56)
|
235
|
-
* SELECT NULL and BooleanTest [#57](https://github.com/pganalyze/pg_query/pull/57)
|
236
|
-
* Fix build on BSD systems [#58](https://github.com/pganalyze/pg_query/pull/58) [@myfreeweb]
|
249
|
+
* `BETWEEN` [#55](https://github.com/pganalyze/pg_query/pull/55)
|
250
|
+
* `NULLIF` [#56](https://github.com/pganalyze/pg_query/pull/56)
|
251
|
+
* `SELECT NULL` and BooleanTest [#57](https://github.com/pganalyze/pg_query/pull/57)
|
252
|
+
* Fix build on BSD systems [#58](https://github.com/pganalyze/pg_query/pull/58) [@myfreeweb]
|
237
253
|
|
238
254
|
|
239
255
|
## 0.11.2 2016-06-27
|
@@ -251,11 +267,11 @@
|
|
251
267
|
|
252
268
|
## 0.11.0 2016-06-22
|
253
269
|
|
254
|
-
* Improved table name analysis (
|
255
|
-
* Don't include CTE names, make them accessible as
|
270
|
+
* Improved table name analysis (`#tables` method)
|
271
|
+
* Don't include CTE names, make them accessible as `#cte_names` instead [#52](https://github.com/pganalyze/pg_query/issues/52)
|
256
272
|
* Include table names in target list sub selects [#38](https://github.com/pganalyze/pg_query/issues/38)
|
257
|
-
* Add support for ORDER
|
258
|
-
* Fix parsing of DROP TYPE statements
|
273
|
+
* Add support for `ORDER`/`GROUP BY`, `HAVING`, and booleans in `WHERE` [#53](https://github.com/pganalyze/pg_query/pull/53) [@jcoleman]
|
274
|
+
* Fix parsing of `DROP TYPE` statements
|
259
275
|
|
260
276
|
|
261
277
|
## 0.10.0 2016-05-31
|
@@ -263,9 +279,9 @@
|
|
263
279
|
* Based on PostgreSQL 9.5.3
|
264
280
|
* Use LLVM extracted parser for significantly improved build times (via libpg_query)
|
265
281
|
* Deparsing Improvements
|
266
|
-
* SET statements [#48](https://github.com/pganalyze/pg_query/pull/48) [@Winslett]
|
267
|
-
* LIKE
|
268
|
-
* CREATE FUNCTION improvements [#50](https://github.com/pganalyze/pg_query/pull/50) [@Winslett]
|
282
|
+
* `SET` statements [#48](https://github.com/pganalyze/pg_query/pull/48) [@Winslett]
|
283
|
+
* `LIKE`/`NOT LIKE` [#49](https://github.com/pganalyze/pg_query/pull/49) [@Winslett]
|
284
|
+
* `CREATE FUNCTION` improvements [#50](https://github.com/pganalyze/pg_query/pull/50) [@Winslett]
|
269
285
|
|
270
286
|
|
271
287
|
## 0.9.2 2016-05-03
|
@@ -301,17 +317,17 @@
|
|
301
317
|
## 0.7.2 2015-12-20
|
302
318
|
|
303
319
|
* Deparsing
|
304
|
-
* Quote all column refs [#40](https://github.com/pganalyze/pg_query/pull/40) [@avinoamr]
|
305
|
-
* Quote all range vars [#43](https://github.com/pganalyze/pg_query/pull/43) [@avinoamr]
|
306
|
-
* Support for COUNT(DISTINCT ...) [#42](https://github.com/pganalyze/pg_query/pull/42) [@avinoamr]
|
320
|
+
* Quote all column refs [#40](https://github.com/pganalyze/pg_query/pull/40) [@avinoamr]
|
321
|
+
* Quote all range vars [#43](https://github.com/pganalyze/pg_query/pull/43) [@avinoamr]
|
322
|
+
* Support for `COUNT(DISTINCT ...)` [#42](https://github.com/pganalyze/pg_query/pull/42) [@avinoamr]
|
307
323
|
|
308
324
|
|
309
325
|
## 0.7.1 2015-11-17
|
310
326
|
|
311
327
|
* Abstracted parser access into libpg_query [#24](https://github.com/pganalyze/pg_query/pull/35)
|
312
328
|
* libpg_query
|
313
|
-
* Use UTF-8 encoding for parsing [#4](https://github.com/lfittl/libpg_query/pull/4) [@zhm]
|
314
|
-
* Add type to A_CONST nodes[#5](https://github.com/lfittl/libpg_query/pull/5) [@zhm]
|
329
|
+
* Use UTF-8 encoding for parsing [#4](https://github.com/lfittl/libpg_query/pull/4) [@zhm]
|
330
|
+
* Add type to A_CONST nodes[#5](https://github.com/lfittl/libpg_query/pull/5) [@zhm]
|
315
331
|
|
316
332
|
|
317
333
|
## 0.7.0 2015-10-17
|
@@ -320,25 +336,25 @@
|
|
320
336
|
* Avoid bison/flex dependency to make deployment easier [#31](https://github.com/pganalyze/pg_query/issues/31)
|
321
337
|
* Solve issues with deployments to Heroku [#32](https://github.com/pganalyze/pg_query/issues/32)
|
322
338
|
* Deparsing
|
323
|
-
* HAVING and FOR UPDATE [#36](https://github.com/pganalyze/pg_query/pull/36) [@JackDanger]
|
339
|
+
* `HAVING` and `FOR UPDATE` [#36](https://github.com/pganalyze/pg_query/pull/36) [@JackDanger]
|
324
340
|
|
325
341
|
|
326
342
|
## 0.6.4 2015-10-01
|
327
343
|
|
328
344
|
* Deparsing
|
329
|
-
* Constraints & Interval Types [#28](https://github.com/pganalyze/pg_query/pull/28) [@JackDanger]
|
330
|
-
* Cross joins [#29](https://github.com/pganalyze/pg_query/pull/29) [@mme]
|
331
|
-
* ALTER TABLE [#30](https://github.com/pganalyze/pg_query/pull/30) [@JackDanger]
|
332
|
-
* LIMIT and OFFSET [#33](https://github.com/pganalyze/pg_query/pull/33) [@jcsjcs]
|
345
|
+
* Constraints & Interval Types [#28](https://github.com/pganalyze/pg_query/pull/28) [@JackDanger]
|
346
|
+
* Cross joins [#29](https://github.com/pganalyze/pg_query/pull/29) [@mme]
|
347
|
+
* `ALTER TABLE` [#30](https://github.com/pganalyze/pg_query/pull/30) [@JackDanger]
|
348
|
+
* `LIMIT and OFFSET` [#33](https://github.com/pganalyze/pg_query/pull/33) [@jcsjcs]
|
333
349
|
|
334
350
|
|
335
351
|
## 0.6.3 2015-08-20
|
336
352
|
|
337
353
|
* Deparsing
|
338
|
-
* COUNT(*) [@JackDanger]
|
339
|
-
* Window clauses [Chris Martin]
|
340
|
-
* CREATE TABLE
|
341
|
-
* Return exact location for parser errors [@JackDanger]
|
354
|
+
* `COUNT(*)` [@JackDanger]
|
355
|
+
* Window clauses [Chris Martin]
|
356
|
+
* `CREATE TABLE`/`VIEW/FUNCTION` [@JackDanger]
|
357
|
+
* Return exact location for parser errors [@JackDanger]
|
342
358
|
|
343
359
|
|
344
360
|
## 0.6.2 2015-08-06
|
@@ -348,7 +364,7 @@
|
|
348
364
|
|
349
365
|
## 0.6.1 2015-08-06
|
350
366
|
|
351
|
-
* Deparsing: Support WITH clauses in INSERT
|
367
|
+
* Deparsing: Support `WITH` clauses in `INSERT`/`UPDATE`/`DELETE` [@JackDanger]
|
352
368
|
* Make sure gemspec includes all necessary files
|
353
369
|
|
354
370
|
|
@@ -357,20 +373,20 @@
|
|
357
373
|
* Deparsing (experimental)
|
358
374
|
* Turns parse trees into SQL again
|
359
375
|
* New truncate method to smartly truncate based on less important query parts
|
360
|
-
* Thanks to [@mme]
|
376
|
+
* Thanks to [@mme] & [@JackDanger] for their contributions
|
361
377
|
* Restructure extension C code
|
362
378
|
* Add table/filter columns support for CTEs
|
363
|
-
* Extract views as tables from CREATE
|
379
|
+
* Extract views as tables from `CREATE`/`REFRESH VIEW`
|
364
380
|
* Refactor code using generic treewalker
|
365
|
-
* fingerprint: Normalize IN lists
|
381
|
+
* fingerprint: Normalize `IN` lists
|
366
382
|
* param_refs: Fix length attribute in result
|
367
383
|
|
368
384
|
|
369
385
|
## 0.5.0 2015-03-26
|
370
386
|
|
371
387
|
* Query fingerprinting
|
372
|
-
* Filter columns (aka columns referenced in a query's WHERE clause)
|
373
|
-
* Parameter references: Returns all
|
388
|
+
* Filter columns (aka columns referenced in a query's `WHERE` clause)
|
389
|
+
* Parameter references: Returns all `$1`/`$2`/etc like references in the query with their location
|
374
390
|
* Remove dependency on active_support
|
375
391
|
|
376
392
|
|
@@ -387,3 +403,28 @@
|
|
387
403
|
|
388
404
|
|
389
405
|
See git commit log for previous releases.
|
406
|
+
|
407
|
+
[libpg_query]: https://github.com/pganalyze/libpg_query
|
408
|
+
[@emin100]: https://github.com/emin100
|
409
|
+
[@akiellor]: https://github.com/akiellor
|
410
|
+
[@himanshu-pro]: https://github.com/himanshu-pro
|
411
|
+
[@himanshu]: https://github.com/himanshu
|
412
|
+
[@Tassosb]: https://github.com/Tassosb
|
413
|
+
[@herwinw]: https://github.com/herwinw
|
414
|
+
[@stanhu]: https://github.com/stanhu
|
415
|
+
[@Papierkorb]: https://github.com/Papierkorb
|
416
|
+
[@jcsjcs]: https://github.com/jcsjcs
|
417
|
+
[@jcoleman]: https://github.com/jcoleman
|
418
|
+
[@yuki24]: https://github.com/yuki24
|
419
|
+
[@seanmdick]: https://github.com/seanmdick
|
420
|
+
[@chrisfrommann]: https://github.com/chrisfrommann
|
421
|
+
[@makimoto]: https://github.com/makimoto
|
422
|
+
[@merqlove]: https://github.com/merqlove
|
423
|
+
[@myfreeweb]: https://github.com/myfreeweb
|
424
|
+
[@Winslett]: https://github.com/Winslett
|
425
|
+
[@avinoamr]: https://github.com/avinoamr
|
426
|
+
[@zhm]: https://github.com/zhm
|
427
|
+
[@mme]: https://github.com/mme
|
428
|
+
[@JackDanger]: https://github.com/JackDanger
|
429
|
+
[Chris Martin]: https://github.com/cmrtn
|
430
|
+
[@sirn]: https://github.com/sirn
|
data/Rakefile
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
require 'bundler/gem_tasks'
|
2
|
+
require 'rake/clean'
|
2
3
|
require 'rake/extensiontask'
|
3
4
|
require 'rspec/core/rake_task'
|
4
5
|
require 'rubocop/rake_task'
|
5
6
|
require 'open-uri'
|
6
7
|
|
7
|
-
LIB_PG_QUERY_TAG = '13-2.0.
|
8
|
-
LIB_PG_QUERY_SHA256SUM = '
|
8
|
+
LIB_PG_QUERY_TAG = '13-2.0.2'.freeze
|
9
|
+
LIB_PG_QUERY_SHA256SUM = 'fe485f48bb51dcc5ed146b1c9929da417357ae8844c2f0c8fe1e235fa1d14257'.freeze
|
9
10
|
|
10
11
|
Rake::ExtensionTask.new 'pg_query' do |ext|
|
11
12
|
ext.lib_dir = 'lib/pg_query'
|
@@ -20,11 +21,9 @@ task default: %i[spec lint]
|
|
20
21
|
task test: :spec
|
21
22
|
task lint: :rubocop
|
22
23
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
FileUtils.rm_f File.join(__dir__, 'lib/pg_query/pg_query.bundle')
|
27
|
-
end
|
24
|
+
CLEAN << 'tmp/**/*'
|
25
|
+
CLEAN << 'ext/pg_query/*.o'
|
26
|
+
CLEAN << 'lib/pg_query/pg_query.bundle'
|
28
27
|
|
29
28
|
task :update_source do
|
30
29
|
workdir = File.join(__dir__, 'tmp')
|
data/ext/pg_query/extconf.rb
CHANGED
@@ -3,8 +3,9 @@
|
|
3
3
|
require 'digest'
|
4
4
|
require 'mkmf'
|
5
5
|
require 'open-uri'
|
6
|
+
require 'pathname'
|
6
7
|
|
7
|
-
$objs = Dir.glob(File.join(__dir__, '*.c')).map { |f| f.
|
8
|
+
$objs = Dir.glob(File.join(__dir__, '*.c')).map { |f| Pathname.new(f).sub_ext('.o').to_s }
|
8
9
|
|
9
10
|
$CFLAGS << " -I#{File.join(__dir__, 'include')} -O3 -Wall -fno-strict-aliasing -fwrapv -fstack-protector -Wno-unused-function -Wno-unused-variable -g"
|
10
11
|
|
@@ -4018,23 +4018,25 @@ static void deparseTableLikeClause(StringInfo str, TableLikeClause *table_like_c
|
|
4018
4018
|
|
4019
4019
|
if (table_like_clause->options == CREATE_TABLE_LIKE_ALL)
|
4020
4020
|
appendStringInfoString(str, "INCLUDING ALL ");
|
4021
|
-
|
4022
|
-
|
4023
|
-
|
4024
|
-
|
4025
|
-
|
4026
|
-
|
4027
|
-
|
4028
|
-
|
4029
|
-
|
4030
|
-
|
4031
|
-
|
4032
|
-
|
4033
|
-
|
4034
|
-
|
4035
|
-
|
4036
|
-
|
4037
|
-
|
4021
|
+
else
|
4022
|
+
{
|
4023
|
+
if (table_like_clause->options & CREATE_TABLE_LIKE_COMMENTS)
|
4024
|
+
appendStringInfoString(str, "INCLUDING COMMENTS ");
|
4025
|
+
if (table_like_clause->options & CREATE_TABLE_LIKE_CONSTRAINTS)
|
4026
|
+
appendStringInfoString(str, "INCLUDING CONSTRAINTS ");
|
4027
|
+
if (table_like_clause->options & CREATE_TABLE_LIKE_DEFAULTS)
|
4028
|
+
appendStringInfoString(str, "INCLUDING DEFAULTS ");
|
4029
|
+
if (table_like_clause->options & CREATE_TABLE_LIKE_IDENTITY)
|
4030
|
+
appendStringInfoString(str, "INCLUDING IDENTITY ");
|
4031
|
+
if (table_like_clause->options & CREATE_TABLE_LIKE_GENERATED)
|
4032
|
+
appendStringInfoString(str, "INCLUDING GENERATED ");
|
4033
|
+
if (table_like_clause->options & CREATE_TABLE_LIKE_INDEXES)
|
4034
|
+
appendStringInfoString(str, "INCLUDING INDEXES ");
|
4035
|
+
if (table_like_clause->options & CREATE_TABLE_LIKE_STATISTICS)
|
4036
|
+
appendStringInfoString(str, "INCLUDING STATISTICS ");
|
4037
|
+
if (table_like_clause->options & CREATE_TABLE_LIKE_STORAGE)
|
4038
|
+
appendStringInfoString(str, "INCLUDING STORAGE ");
|
4039
|
+
}
|
4038
4040
|
removeTrailingSpace(str);
|
4039
4041
|
}
|
4040
4042
|
|
@@ -1,3 +1,7 @@
|
|
1
|
+
// Ensure we have asprintf's definition on glibc-based platforms to avoid compiler warnings
|
2
|
+
#define _GNU_SOURCE
|
3
|
+
#include <stdio.h>
|
4
|
+
|
1
5
|
#include "pg_query.h"
|
2
6
|
#include "pg_query_internal.h"
|
3
7
|
#include "pg_query_fingerprint.h"
|
@@ -13,7 +17,6 @@
|
|
13
17
|
#include "nodes/parsenodes.h"
|
14
18
|
#include "nodes/value.h"
|
15
19
|
|
16
|
-
#include <stdio.h>
|
17
20
|
#include <unistd.h>
|
18
21
|
#include <fcntl.h>
|
19
22
|
|
@@ -62,6 +62,8 @@ module PgQuery
|
|
62
62
|
condition_items << next_item.a_expr.rexpr if next_item.a_expr.rexpr
|
63
63
|
when :bool_expr
|
64
64
|
condition_items += next_item.bool_expr.args
|
65
|
+
when :coalesce_expr
|
66
|
+
condition_items += next_item.coalesce_expr.args
|
65
67
|
when :row_expr
|
66
68
|
condition_items += next_item.row_expr.args
|
67
69
|
when :column_ref
|
data/lib/pg_query/parse.rb
CHANGED
@@ -4,8 +4,8 @@ module PgQuery
|
|
4
4
|
|
5
5
|
begin
|
6
6
|
result = PgQuery::ParseResult.decode(result)
|
7
|
-
rescue Google::Protobuf::ParseError
|
8
|
-
raise PgQuery::ParseError.new('Failed to parse tree', __FILE__, __LINE__, -1)
|
7
|
+
rescue Google::Protobuf::ParseError => e
|
8
|
+
raise PgQuery::ParseError.new(format('Failed to parse tree: %s', e.message), __FILE__, __LINE__, -1)
|
9
9
|
end
|
10
10
|
|
11
11
|
warnings = []
|
data/lib/pg_query/version.rb
CHANGED
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: 2.0.
|
4
|
+
version: 2.0.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: 2021-03-
|
11
|
+
date: 2021-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake-compiler
|