1/*-------------------------------------------------------------------------
2 *
3 * makefuncs.h
4 * prototypes for the creator functions (for primitive nodes)
5 *
6 *
7 * Portions Copyright (c) 1996-2017, PostgreSQL Global Development PGGroup
8 * Portions Copyright (c) 1994, Regents of the University of California
9 *
10 * src/include/nodes/makefuncs.h
11 *
12 *-------------------------------------------------------------------------
13 */
14#pragma once
15
16#include "nodes/parsenodes.hpp"
17
18namespace duckdb_libpgquery {
19
20PGAExpr *makeAExpr(PGAExpr_Kind kind, PGList *name, PGNode *lexpr, PGNode *rexpr, int location);
21
22PGAExpr *makeSimpleAExpr(PGAExpr_Kind kind, const char *name, PGNode *lexpr, PGNode *rexpr, int location);
23
24PGVar *makeVar(PGIndex varno, PGAttrNumber varattno, PGOid vartype, int32_t vartypmod, PGOid varcollid,
25 PGIndex varlevelsup);
26
27PGVar *makeVarFromTargetEntry(PGIndex varno, PGTargetEntry *tle);
28
29PGVar *makeWholeRowVar(PGRangeTblEntry *rte, PGIndex varno, PGIndex varlevelsup, bool allowScalar);
30
31PGTargetEntry *makeTargetEntry(PGExpr *expr, PGAttrNumber resno, char *resname, bool resjunk);
32
33PGTargetEntry *flatCopyTargetEntry(PGTargetEntry *src_tle);
34
35PGFromExpr *makeFromExpr(PGList *fromlist, PGNode *quals);
36
37PGConst *makeConst(PGOid consttype, int32_t consttypmod, PGOid constcollid, int constlen, PGDatum constvalue,
38 bool constisnull, bool constbyval);
39
40PGConst *makeNullConst(PGOid consttype, int32_t consttypmod, PGOid constcollid);
41
42PGNode *makeBoolConst(bool value, bool isnull);
43
44PGExpr *makeBoolExpr(PGBoolExprType boolop, PGList *args, int location);
45
46PGAlias *makeAlias(const char *aliasname, PGList *colnames);
47
48PGRelabelType *makeRelabelType(PGExpr *arg, PGOid rtype, int32_t rtypmod, PGOid rcollid, PGCoercionForm rformat);
49
50PGRangeVar *makeRangeVar(char *schemaname, char *relname, int location);
51
52PGTypeName *makeTypeName(char *typnam);
53PGTypeName *makeTypeNameFromNameList(PGList *names);
54PGTypeName *makeTypeNameFromOid(PGOid typeOid, int32_t typmod);
55
56PGColumnDef *makeColumnDef(const char *colname, PGOid typeOid, int32_t typmod, PGOid collOid);
57
58PGFuncExpr *makeFuncExpr(PGOid funcid, PGOid rettype, PGList *args, PGOid funccollid, PGOid inputcollid,
59 PGCoercionForm fformat);
60
61PGFuncCall *makeFuncCall(PGList *name, PGList *args, int location);
62
63PGDefElem *makeDefElem(const char *name, PGNode *arg, int location);
64PGDefElem *makeDefElemExtended(const char *nameSpace, const char *name, PGNode *arg, PGDefElemAction defaction,
65 int location);
66
67PGGroupingSet *makeGroupingSet(GroupingSetKind kind, PGList *content, int location);
68
69}