Skip to content

Commit 26a61b3

Browse files
committed
finish up
1 parent e055fcc commit 26a61b3

4 files changed

Lines changed: 3149 additions & 39 deletions

File tree

.cargo/config.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[env]
2+
# Increase default stack size for tests due to deep recursion in parse tree conversion
3+
RUST_MIN_STACK = "16777216"

build.rs

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
183183
.allowlist_type("AlterOwnerStmt")
184184
.allowlist_type("AlterSeqStmt")
185185
.allowlist_type("CreateEnumStmt")
186+
.allowlist_type("AlterEnumStmt")
187+
.allowlist_type("CreateRangeStmt")
186188
.allowlist_type("DoStmt")
187189
.allowlist_type("RenameStmt")
188190
.allowlist_type("NotifyStmt")
@@ -209,6 +211,158 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
209211
.allowlist_type("Float")
210212
.allowlist_type("Boolean")
211213
.allowlist_type("BitString")
214+
// Additional statement types
215+
.allowlist_type("DeclareCursorStmt")
216+
.allowlist_type("DefineStmt")
217+
.allowlist_type("CommentStmt")
218+
.allowlist_type("SecLabelStmt")
219+
.allowlist_type("CreateStatsStmt")
220+
.allowlist_type("AlterStatsStmt")
221+
.allowlist_type("StatsElem")
222+
.allowlist_type("CreateRoleStmt")
223+
.allowlist_type("AlterRoleStmt")
224+
.allowlist_type("AlterRoleSetStmt")
225+
.allowlist_type("DropRoleStmt")
226+
.allowlist_type("CreatePolicyStmt")
227+
.allowlist_type("AlterPolicyStmt")
228+
.allowlist_type("CreateEventTrigStmt")
229+
.allowlist_type("AlterEventTrigStmt")
230+
.allowlist_type("CreatePLangStmt")
231+
.allowlist_type("CreateAmStmt")
232+
.allowlist_type("CreateOpClassStmt")
233+
.allowlist_type("CreateOpClassItem")
234+
.allowlist_type("CreateOpFamilyStmt")
235+
.allowlist_type("AlterOpFamilyStmt")
236+
.allowlist_type("CreateFdwStmt")
237+
.allowlist_type("AlterFdwStmt")
238+
.allowlist_type("CreateForeignServerStmt")
239+
.allowlist_type("AlterForeignServerStmt")
240+
.allowlist_type("CreateForeignTableStmt")
241+
.allowlist_type("CreateUserMappingStmt")
242+
.allowlist_type("AlterUserMappingStmt")
243+
.allowlist_type("DropUserMappingStmt")
244+
.allowlist_type("ImportForeignSchemaStmt")
245+
.allowlist_type("CreateTableSpaceStmt")
246+
.allowlist_type("DropTableSpaceStmt")
247+
.allowlist_type("AlterTableSpaceOptionsStmt")
248+
.allowlist_type("AlterTableMoveAllStmt")
249+
.allowlist_type("AlterExtensionStmt")
250+
.allowlist_type("AlterExtensionContentsStmt")
251+
.allowlist_type("AlterDomainStmt")
252+
.allowlist_type("AlterFunctionStmt")
253+
.allowlist_type("AlterOperatorStmt")
254+
.allowlist_type("AlterTypeStmt")
255+
.allowlist_type("AlterObjectSchemaStmt")
256+
.allowlist_type("AlterObjectDependsStmt")
257+
.allowlist_type("AlterCollationStmt")
258+
.allowlist_type("AlterDefaultPrivilegesStmt")
259+
.allowlist_type("CreateCastStmt")
260+
.allowlist_type("CreateTransformStmt")
261+
.allowlist_type("CreateConversionStmt")
262+
.allowlist_type("AlterTSDictionaryStmt")
263+
.allowlist_type("AlterTSConfigurationStmt")
264+
.allowlist_type("CreatedbStmt")
265+
.allowlist_type("DropdbStmt")
266+
.allowlist_type("AlterDatabaseStmt")
267+
.allowlist_type("AlterDatabaseSetStmt")
268+
.allowlist_type("AlterDatabaseRefreshCollStmt")
269+
.allowlist_type("AlterSystemStmt")
270+
.allowlist_type("ClusterStmt")
271+
.allowlist_type("ReindexStmt")
272+
.allowlist_type("ConstraintsSetStmt")
273+
.allowlist_type("LoadStmt")
274+
.allowlist_type("DropOwnedStmt")
275+
.allowlist_type("ReassignOwnedStmt")
276+
.allowlist_type("DropSubscriptionStmt")
277+
// Table-related nodes
278+
.allowlist_type("TableFunc")
279+
.allowlist_type("TableLikeClause")
280+
.allowlist_type("RangeTableFunc")
281+
.allowlist_type("RangeTableFuncCol")
282+
.allowlist_type("RangeTableSample")
283+
.allowlist_type("PartitionCmd")
284+
.allowlist_type("SinglePartitionSpec")
285+
// Expression nodes
286+
.allowlist_type("Aggref")
287+
.allowlist_type("Var")
288+
.allowlist_type("Param")
289+
.allowlist_type("WindowFunc")
290+
.allowlist_type("GroupingFunc")
291+
.allowlist_type("FuncExpr")
292+
.allowlist_type("NamedArgExpr")
293+
.allowlist_type("OpExpr")
294+
.allowlist_type("DistinctExpr")
295+
.allowlist_type("NullIfExpr")
296+
.allowlist_type("ScalarArrayOpExpr")
297+
.allowlist_type("FieldSelect")
298+
.allowlist_type("FieldStore")
299+
.allowlist_type("RelabelType")
300+
.allowlist_type("CoerceViaIO")
301+
.allowlist_type("ArrayCoerceExpr")
302+
.allowlist_type("ConvertRowtypeExpr")
303+
.allowlist_type("CollateExpr")
304+
.allowlist_type("CaseTestExpr")
305+
.allowlist_type("ArrayExpr")
306+
.allowlist_type("RowCompareExpr")
307+
.allowlist_type("CoerceToDomainValue")
308+
.allowlist_type("CurrentOfExpr")
309+
.allowlist_type("NextValueExpr")
310+
.allowlist_type("InferenceElem")
311+
.allowlist_type("SubscriptingRef")
312+
.allowlist_type("SQLValueFunction")
313+
.allowlist_type("XmlExpr")
314+
.allowlist_type("XmlSerialize")
315+
// Query/Plan nodes
316+
.allowlist_type("SubPlan")
317+
.allowlist_type("AlternativeSubPlan")
318+
.allowlist_type("TargetEntry")
319+
.allowlist_type("RangeTblRef")
320+
.allowlist_type("FromExpr")
321+
.allowlist_type("OnConflictExpr")
322+
.allowlist_type("Query")
323+
.allowlist_type("SetOperationStmt")
324+
.allowlist_type("ReturnStmt")
325+
.allowlist_type("PLAssignStmt")
326+
.allowlist_type("WindowClause")
327+
.allowlist_type("RowMarkClause")
328+
.allowlist_type("WithCheckOption")
329+
.allowlist_type("RangeTblEntry")
330+
.allowlist_type("RangeTblFunction")
331+
.allowlist_type("TableSampleClause")
332+
// JSON nodes
333+
.allowlist_type("JsonFormat")
334+
.allowlist_type("JsonReturning")
335+
.allowlist_type("JsonValueExpr")
336+
.allowlist_type("JsonConstructorExpr")
337+
.allowlist_type("JsonIsPredicate")
338+
.allowlist_type("JsonBehavior")
339+
.allowlist_type("JsonExpr")
340+
.allowlist_type("JsonTablePath")
341+
.allowlist_type("JsonTablePathScan")
342+
.allowlist_type("JsonTableSiblingJoin")
343+
.allowlist_type("JsonOutput")
344+
.allowlist_type("JsonArgument")
345+
.allowlist_type("JsonFuncExpr")
346+
.allowlist_type("JsonTablePathSpec")
347+
.allowlist_type("JsonTable")
348+
.allowlist_type("JsonTableColumn")
349+
.allowlist_type("JsonKeyValue")
350+
.allowlist_type("JsonParseExpr")
351+
.allowlist_type("JsonScalarExpr")
352+
.allowlist_type("JsonSerializeExpr")
353+
.allowlist_type("JsonObjectConstructor")
354+
.allowlist_type("JsonArrayConstructor")
355+
.allowlist_type("JsonArrayQueryConstructor")
356+
.allowlist_type("JsonAggConstructor")
357+
.allowlist_type("JsonObjectAgg")
358+
.allowlist_type("JsonArrayAgg")
359+
// Other nodes
360+
.allowlist_type("TriggerTransition")
361+
.allowlist_type("InlineCodeBlock")
362+
.allowlist_type("CallContext")
363+
.allowlist_type("ReplicaIdentityStmt")
364+
.allowlist_type("WindowFuncRunCondition")
365+
.allowlist_type("MergeSupportFunc")
212366
// Allowlist enums
213367
.allowlist_type("SetOperation")
214368
.allowlist_type("LimitOption")
@@ -245,6 +399,24 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
245399
.allowlist_type("OverridingKind")
246400
.allowlist_type("PartitionStrategy")
247401
.allowlist_type("PartitionRangeDatumKind")
402+
.allowlist_type("ReindexObjectType")
403+
.allowlist_type("AlterSubscriptionType")
404+
.allowlist_type("AlterPublicationAction")
405+
.allowlist_type("ImportForeignSchemaType")
406+
.allowlist_type("RoleStmtType")
407+
.allowlist_type("RowCompareType")
408+
.allowlist_type("XmlExprOp")
409+
.allowlist_type("XmlOptionType")
410+
.allowlist_type("JsonFormatType")
411+
.allowlist_type("JsonConstructorType")
412+
.allowlist_type("JsonValueType")
413+
.allowlist_type("JsonTableColumnType")
414+
.allowlist_type("JsonQuotes")
415+
.allowlist_type("JsonExprOp")
416+
.allowlist_type("JsonEncoding")
417+
.allowlist_type("JsonWrapper")
418+
.allowlist_type("SQLValueFunctionOp")
419+
.allowlist_type("TableLikeOption")
248420
// Allowlist raw parse functions
249421
.allowlist_function("pg_query_parse_raw")
250422
.allowlist_function("pg_query_parse_raw_opts")

0 commit comments

Comments
 (0)