pg_query 4.2.0 → 4.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,9 @@
1
+ #ifndef POSTGRES_DEPARSE_H
2
+ #define POSTGRES_DEPARSE_H
3
+
4
+ #include "lib/stringinfo.h"
5
+ #include "nodes/parsenodes.h"
6
+
7
+ extern void deparseRawStmt(StringInfo str, RawStmt *raw_stmt);
8
+
9
+ #endif
@@ -139,6 +139,10 @@ module PgQuery
139
139
  @cte_names.concat(cte_names)
140
140
  statements.concat(cte_statements)
141
141
  end
142
+
143
+ if statement.select_stmt.into_clause
144
+ from_clause_items << { item: PgQuery::Node.new(range_var: statement.select_stmt.into_clause.rel), type: :ddl }
145
+ end
142
146
  # The following statements modify the contents of a table
143
147
  when :insert_stmt, :update_stmt, :delete_stmt
144
148
  value = statement.public_send(statement.node)
@@ -171,7 +175,12 @@ module PgQuery
171
175
  statements << statement.copy_stmt.query
172
176
  # The following statement types are DDL (changing table structure)
173
177
  when :alter_table_stmt
174
- from_clause_items << { item: PgQuery::Node.new(range_var: statement.alter_table_stmt.relation), type: :ddl }
178
+ case statement.alter_table_stmt.objtype
179
+ when :OBJECT_INDEX # Index # rubocop:disable Lint/EmptyWhen
180
+ # ignore `ALTER INDEX index_name`
181
+ else
182
+ from_clause_items << { item: PgQuery::Node.new(range_var: statement.alter_table_stmt.relation), type: :ddl }
183
+ end
175
184
  when :create_stmt
176
185
  from_clause_items << { item: PgQuery::Node.new(range_var: statement.create_stmt.relation), type: :ddl }
177
186
  when :create_table_as_stmt
@@ -1,3 +1,3 @@
1
1
  module PgQuery
2
- VERSION = '4.2.0'.freeze
2
+ VERSION = '4.2.2'.freeze
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: 4.2.0
4
+ version: 4.2.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: 2023-02-16 00:00:00.000000000 Z
11
+ date: 2023-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 3.19.2
75
+ version: 3.22.3
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: 3.19.2
82
+ version: 3.22.3
83
83
  description: Parses SQL queries using a copy of the PostgreSQL server query parser
84
84
  email: lukas@fittl.com
85
85
  executables: []
@@ -497,8 +497,11 @@ files:
497
497
  - ext/pg_query/pg_query_readfuncs_protobuf.c
498
498
  - ext/pg_query/pg_query_ruby.c
499
499
  - ext/pg_query/pg_query_ruby.sym
500
+ - ext/pg_query/pg_query_ruby_freebsd.sym
500
501
  - ext/pg_query/pg_query_scan.c
501
502
  - ext/pg_query/pg_query_split.c
503
+ - ext/pg_query/postgres_deparse.c
504
+ - ext/pg_query/postgres_deparse.h
502
505
  - ext/pg_query/protobuf-c.c
503
506
  - ext/pg_query/src_backend_catalog_namespace.c
504
507
  - ext/pg_query/src_backend_catalog_pg_proc.c