prettier-plugin-sql-cst 0.18.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{CstToDocMap.d.ts → src/CstToDocMap.d.ts} +2 -2
- package/dist/src/CstToDocMap.js +1 -0
- package/dist/src/PrintFn.js +1 -0
- package/dist/src/embed.js +6 -0
- package/dist/src/embedJs.js +43 -0
- package/dist/src/embedJson.js +34 -0
- package/dist/src/embedSql.js +39 -0
- package/dist/src/index.js +64 -0
- package/dist/{node_utils.d.ts → src/node_utils.d.ts} +1 -0
- package/dist/src/node_utils.js +44 -0
- package/dist/{options.js → src/options.js} +1 -4
- package/dist/{printComment.js → src/printComment.js} +2 -6
- package/dist/src/printSql.js +61 -0
- package/dist/src/print_utils.js +49 -0
- package/dist/src/syntax/alias.js +3 -0
- package/dist/src/syntax/alter_action.js +120 -0
- package/dist/src/syntax/alter_table.js +19 -0
- package/dist/src/syntax/analyze.js +4 -0
- package/dist/{syntax → src/syntax}/base.js +6 -9
- package/dist/src/syntax/cast.js +4 -0
- package/dist/src/syntax/comment.js +54 -0
- package/dist/{syntax → src/syntax}/constraint.d.ts +1 -1
- package/dist/src/syntax/constraint.js +80 -0
- package/dist/src/syntax/create_table.js +69 -0
- package/dist/src/syntax/data_type.js +29 -0
- package/dist/src/syntax/dcl.js +83 -0
- package/dist/src/syntax/delete.js +5 -0
- package/dist/src/syntax/dialects/bigquery.js +84 -0
- package/dist/src/syntax/dialects/mysql.js +3 -0
- package/dist/src/syntax/dialects/postgresql.js +9 -0
- package/dist/src/syntax/dialects/sqlite.js +9 -0
- package/dist/src/syntax/do.js +4 -0
- package/dist/src/syntax/domain.js +11 -0
- package/dist/src/syntax/drop_table.js +11 -0
- package/dist/src/syntax/explain.js +7 -0
- package/dist/src/syntax/expr.js +224 -0
- package/dist/src/syntax/extension.js +13 -0
- package/dist/src/syntax/frame.js +13 -0
- package/dist/src/syntax/function.js +55 -0
- package/dist/src/syntax/index.js +60 -0
- package/dist/src/syntax/insert.js +33 -0
- package/dist/src/syntax/merge.js +30 -0
- package/dist/src/syntax/other_clauses.js +9 -0
- package/dist/src/syntax/parameter.js +18 -0
- package/dist/src/syntax/policy.js +27 -0
- package/dist/src/syntax/prepared_statements.js +31 -0
- package/dist/src/syntax/proc_clause.js +14 -0
- package/dist/src/syntax/procedural_language.js +104 -0
- package/dist/src/syntax/procedure.js +38 -0
- package/dist/src/syntax/program.js +39 -0
- package/dist/src/syntax/publication.js +27 -0
- package/dist/src/syntax/rename_table.js +8 -0
- package/dist/src/syntax/role.js +31 -0
- package/dist/src/syntax/schema.js +18 -0
- package/dist/src/syntax/select.js +226 -0
- package/dist/src/syntax/sequence.js +36 -0
- package/dist/src/syntax/subscription.js +10 -0
- package/dist/src/syntax/transaction.js +19 -0
- package/dist/src/syntax/transformMap.js +100 -0
- package/dist/src/syntax/trigger.js +52 -0
- package/dist/src/syntax/truncate.js +10 -0
- package/dist/src/syntax/type.js +12 -0
- package/dist/src/syntax/unsupported_grammar.js +4 -0
- package/dist/src/syntax/update.js +14 -0
- package/dist/src/syntax/view.js +48 -0
- package/dist/src/transform/addFinalSemicolon.js +9 -0
- package/dist/src/transform/aliasAs.js +10 -0
- package/dist/{transform → src/transform}/canonicKeywords.js +16 -20
- package/dist/{transform → src/transform}/canonicOperators.js +8 -12
- package/dist/src/transform/comments.js +22 -0
- package/dist/src/transform/stripTrailingCommas.js +15 -0
- package/dist/src/transform/transformCst.js +21 -0
- package/dist/src/transform/transformUtils.js +3 -0
- package/dist/src/utils.js +9 -0
- package/dist/src/visitAllNodes.js +16 -0
- package/dist/tsconfig.json +14 -0
- package/package.json +9 -8
- package/dist/CstToDocMap.js +0 -2
- package/dist/PrintFn.js +0 -2
- package/dist/embed.js +0 -14
- package/dist/embedJs.js +0 -99
- package/dist/embedJson.js +0 -90
- package/dist/embedSql.js +0 -89
- package/dist/index.js +0 -70
- package/dist/node_utils.js +0 -54
- package/dist/printSql.js +0 -71
- package/dist/print_utils.js +0 -68
- package/dist/syntax/alias.js +0 -6
- package/dist/syntax/alter_action.js +0 -213
- package/dist/syntax/alter_table.js +0 -28
- package/dist/syntax/analyze.js +0 -9
- package/dist/syntax/cast.js +0 -7
- package/dist/syntax/comment.js +0 -123
- package/dist/syntax/constraint.js +0 -116
- package/dist/syntax/create_table.js +0 -107
- package/dist/syntax/data_type.js +0 -48
- package/dist/syntax/dcl.js +0 -141
- package/dist/syntax/delete.js +0 -10
- package/dist/syntax/dialects/bigquery.js +0 -130
- package/dist/syntax/dialects/mysql.js +0 -6
- package/dist/syntax/dialects/postgresql.js +0 -14
- package/dist/syntax/dialects/sqlite.js +0 -18
- package/dist/syntax/do.js +0 -7
- package/dist/syntax/domain.js +0 -20
- package/dist/syntax/drop_table.js +0 -16
- package/dist/syntax/explain.js +0 -12
- package/dist/syntax/expr.js +0 -273
- package/dist/syntax/extension.js +0 -22
- package/dist/syntax/frame.js +0 -18
- package/dist/syntax/function.js +0 -65
- package/dist/syntax/index.js +0 -87
- package/dist/syntax/insert.js +0 -50
- package/dist/syntax/merge.js +0 -35
- package/dist/syntax/other_clauses.js +0 -18
- package/dist/syntax/parameter.js +0 -31
- package/dist/syntax/policy.js +0 -42
- package/dist/syntax/prepared_statements.js +0 -51
- package/dist/syntax/proc_clause.js +0 -19
- package/dist/syntax/procedural_language.js +0 -135
- package/dist/syntax/procedure.js +0 -42
- package/dist/syntax/program.js +0 -46
- package/dist/syntax/publication.js +0 -48
- package/dist/syntax/rename_table.js +0 -13
- package/dist/syntax/role.js +0 -56
- package/dist/syntax/schema.js +0 -36
- package/dist/syntax/select.js +0 -295
- package/dist/syntax/sequence.js +0 -53
- package/dist/syntax/subscription.js +0 -25
- package/dist/syntax/transaction.js +0 -34
- package/dist/syntax/transformMap.js +0 -64
- package/dist/syntax/trigger.js +0 -76
- package/dist/syntax/truncate.js +0 -15
- package/dist/syntax/type.js +0 -23
- package/dist/syntax/unsupported_grammar.js +0 -7
- package/dist/syntax/update.js +0 -21
- package/dist/syntax/view.js +0 -59
- package/dist/transform/addFinalSemicolon.js +0 -13
- package/dist/transform/aliasAs.js +0 -14
- package/dist/transform/comments.js +0 -43
- package/dist/transform/stripTrailingCommas.js +0 -19
- package/dist/transform/transformCst.js +0 -25
- package/dist/transform/transformUtils.js +0 -7
- package/dist/utils.js +0 -30
- package/dist/visitAllNodes.js +0 -21
- /package/dist/{PrintFn.d.ts → src/PrintFn.d.ts} +0 -0
- /package/dist/{embed.d.ts → src/embed.d.ts} +0 -0
- /package/dist/{embedJs.d.ts → src/embedJs.d.ts} +0 -0
- /package/dist/{embedJson.d.ts → src/embedJson.d.ts} +0 -0
- /package/dist/{embedSql.d.ts → src/embedSql.d.ts} +0 -0
- /package/dist/{index.d.ts → src/index.d.ts} +0 -0
- /package/dist/{options.d.ts → src/options.d.ts} +0 -0
- /package/dist/{printComment.d.ts → src/printComment.d.ts} +0 -0
- /package/dist/{printSql.d.ts → src/printSql.d.ts} +0 -0
- /package/dist/{print_utils.d.ts → src/print_utils.d.ts} +0 -0
- /package/dist/{syntax → src/syntax}/alias.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/alter_action.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/alter_table.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/analyze.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/base.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/cast.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/comment.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/create_table.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/data_type.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/dcl.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/delete.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/dialects/bigquery.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/dialects/mysql.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/dialects/postgresql.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/dialects/sqlite.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/do.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/domain.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/drop_table.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/explain.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/expr.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/extension.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/frame.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/function.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/index.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/insert.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/merge.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/other_clauses.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/parameter.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/policy.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/prepared_statements.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/proc_clause.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/procedural_language.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/procedure.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/program.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/publication.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/rename_table.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/role.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/schema.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/select.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/sequence.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/subscription.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/transaction.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/transformMap.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/trigger.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/truncate.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/type.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/unsupported_grammar.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/update.d.ts +0 -0
- /package/dist/{syntax → src/syntax}/view.d.ts +0 -0
- /package/dist/{transform → src/transform}/addFinalSemicolon.d.ts +0 -0
- /package/dist/{transform → src/transform}/aliasAs.d.ts +0 -0
- /package/dist/{transform → src/transform}/canonicKeywords.d.ts +0 -0
- /package/dist/{transform → src/transform}/canonicOperators.d.ts +0 -0
- /package/dist/{transform → src/transform}/comments.d.ts +0 -0
- /package/dist/{transform → src/transform}/stripTrailingCommas.d.ts +0 -0
- /package/dist/{transform → src/transform}/transformCst.d.ts +0 -0
- /package/dist/{transform → src/transform}/transformUtils.d.ts +0 -0
- /package/dist/{utils.d.ts → src/utils.d.ts} +0 -0
- /package/dist/{visitAllNodes.d.ts → src/visitAllNodes.d.ts} +0 -0
package/dist/syntax/expr.js
DELETED
|
@@ -1,273 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
-
if (ar || !(i in from)) {
|
|
5
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
-
ar[i] = from[i];
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.printLiteral = exports.exprMap = void 0;
|
|
13
|
-
var print_utils_1 = require("../print_utils");
|
|
14
|
-
var node_utils_1 = require("../node_utils");
|
|
15
|
-
var utils_1 = require("../utils");
|
|
16
|
-
exports.exprMap = {
|
|
17
|
-
list_expr: function (print, node, path) {
|
|
18
|
-
var parent = path.getParentNode();
|
|
19
|
-
var children = print("items").map(function (it) { return (0, print_utils_1.group)(it); });
|
|
20
|
-
var lineType = (0, node_utils_1.isValuesClause)(parent) ? print_utils_1.hardline : print_utils_1.line;
|
|
21
|
-
// When last item is type:empty, we're dealing with a trailing comma.
|
|
22
|
-
// Don't add a space (or newline) after it.
|
|
23
|
-
// We still want to print it though, as it might have comments attached.
|
|
24
|
-
if ((0, node_utils_1.isEmpty)((0, utils_1.last)(node.items))) {
|
|
25
|
-
return [
|
|
26
|
-
(0, print_utils_1.join)([",", lineType], children.slice(0, -1)),
|
|
27
|
-
",",
|
|
28
|
-
(0, utils_1.last)(children),
|
|
29
|
-
];
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
return (0, print_utils_1.join)([",", lineType], children);
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
paren_expr: function (print, node, path) {
|
|
36
|
-
// discard unnecessary nested ((parentheses))
|
|
37
|
-
if ((0, node_utils_1.isParenExpr)(node.expr)) {
|
|
38
|
-
return print("expr");
|
|
39
|
-
}
|
|
40
|
-
// Discard unnecessary parenthesis around function arguments
|
|
41
|
-
if ((0, node_utils_1.isListExpr)(path.getParentNode(0)) &&
|
|
42
|
-
(0, node_utils_1.isFuncArgs)(path.getParentNode(1)) &&
|
|
43
|
-
!(0, node_utils_1.isSelectStmt)(node.expr) &&
|
|
44
|
-
!(0, node_utils_1.isCompoundSelectStmt)(node.expr)) {
|
|
45
|
-
return print("expr");
|
|
46
|
-
}
|
|
47
|
-
var parent = path.getParentNode();
|
|
48
|
-
var lineStyle = (0, node_utils_1.isCreateTableStmt)(parent) && print.dynamicLine() === print_utils_1.hardline
|
|
49
|
-
? print_utils_1.hardline
|
|
50
|
-
: print_utils_1.softline;
|
|
51
|
-
return (0, print_utils_1.group)(["(", (0, print_utils_1.indent)([lineStyle, print("expr")]), lineStyle, ")"]);
|
|
52
|
-
},
|
|
53
|
-
binary_expr: function (print, node) {
|
|
54
|
-
if ((0, node_utils_1.isKeyword)(node.operator) && isBooleanOp(node.operator)) {
|
|
55
|
-
return (0, print_utils_1.join)(print_utils_1.line, [print("left"), print.spaced(["operator", "right"])]);
|
|
56
|
-
}
|
|
57
|
-
if (node.operator === "") {
|
|
58
|
-
// String concatenation with whitespace (MySQL / MariaDB)
|
|
59
|
-
return print.spaced(["left", "right"]);
|
|
60
|
-
}
|
|
61
|
-
return print.spaced(["left", "operator", "right"]);
|
|
62
|
-
},
|
|
63
|
-
prefix_op_expr: function (print, node) {
|
|
64
|
-
return ((0, utils_1.isString)(node.operator) ? print : print.spaced)(["operator", "expr"]);
|
|
65
|
-
},
|
|
66
|
-
postfix_op_expr: function (print) { return print.spaced(["expr", "operator"]); },
|
|
67
|
-
between_expr: function (print) {
|
|
68
|
-
return print.spaced(["left", "betweenKw", "begin", "andKw", "end"]);
|
|
69
|
-
},
|
|
70
|
-
case_expr: function (print) { return [
|
|
71
|
-
print.spaced(["caseKw", "expr"]),
|
|
72
|
-
(0, print_utils_1.indent)([print_utils_1.hardline, (0, print_utils_1.join)(print_utils_1.hardline, print("clauses"))]),
|
|
73
|
-
print_utils_1.hardline,
|
|
74
|
-
print("endKw"),
|
|
75
|
-
]; },
|
|
76
|
-
case_when: function (print, node) {
|
|
77
|
-
if ((0, node_utils_1.isProgram)(node.result)) {
|
|
78
|
-
return [
|
|
79
|
-
print.spaced(["whenKw", "condition", "thenKw"]),
|
|
80
|
-
(0, print_utils_1.indent)([print_utils_1.hardline, (0, print_utils_1.stripTrailingHardline)(print("result"))]),
|
|
81
|
-
];
|
|
82
|
-
}
|
|
83
|
-
return print.spaced(["whenKw", "condition", "thenKw", "result"]);
|
|
84
|
-
},
|
|
85
|
-
case_else: function (print, node) {
|
|
86
|
-
if ((0, node_utils_1.isProgram)(node.result)) {
|
|
87
|
-
return [
|
|
88
|
-
print("elseKw"),
|
|
89
|
-
(0, print_utils_1.indent)([print_utils_1.hardline, (0, print_utils_1.stripTrailingHardline)(print("result"))]),
|
|
90
|
-
];
|
|
91
|
-
}
|
|
92
|
-
return print.spaced(["elseKw", "result"]);
|
|
93
|
-
},
|
|
94
|
-
member_expr: function (print, node) {
|
|
95
|
-
return (0, node_utils_1.isArraySubscript)(node.property)
|
|
96
|
-
? print(["object", "property"])
|
|
97
|
-
: [print("object"), ".", print("property")];
|
|
98
|
-
},
|
|
99
|
-
bigquery_quoted_member_expr: function (print) { return ["`", print("expr"), "`"]; },
|
|
100
|
-
array_subscript: function (print) {
|
|
101
|
-
return (0, print_utils_1.group)(["[", (0, print_utils_1.indent)([print_utils_1.softline, print("expr")]), print_utils_1.softline, "]"]);
|
|
102
|
-
},
|
|
103
|
-
array_subscript_specifier: function (print) { return print(["specifierKw", "args"]); },
|
|
104
|
-
array_slice_specifier: function (print) { return [print("from"), ":", print("to")]; },
|
|
105
|
-
func_call: function (print) {
|
|
106
|
-
var fnCall = print(["name", "args"]);
|
|
107
|
-
var extras = print(["filter", "over"]);
|
|
108
|
-
if (extras.length > 1) {
|
|
109
|
-
return (0, print_utils_1.group)([fnCall, (0, print_utils_1.indent)([print_utils_1.line, (0, print_utils_1.join)(print_utils_1.line, extras)])]);
|
|
110
|
-
}
|
|
111
|
-
else {
|
|
112
|
-
return (0, print_utils_1.group)((0, print_utils_1.join)(" ", __spreadArray([fnCall], extras, true)));
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
func_args: function (print, node) {
|
|
116
|
-
return (0, print_utils_1.join)(print_utils_1.line, __spreadArray(__spreadArray(__spreadArray([], print(["distinctKw", "args"]), true), (node.nullHandlingKw ? print.spaced("nullHandlingKw") : []), true), print(["orderBy", "limit", "having"]), true));
|
|
117
|
-
},
|
|
118
|
-
filter_arg: function (print) { return print.spaced(["filterKw", "where"]); },
|
|
119
|
-
over_arg: function (print) { return print.spaced(["overKw", "window"]); },
|
|
120
|
-
having_arg: function (print) { return print.spaced(["havingKw", "minMaxKw", "expr"]); },
|
|
121
|
-
named_arg: function (print) {
|
|
122
|
-
return (0, print_utils_1.group)([
|
|
123
|
-
print("name"),
|
|
124
|
-
" ",
|
|
125
|
-
print("operator"),
|
|
126
|
-
(0, print_utils_1.indent)([print_utils_1.line, print("value")]),
|
|
127
|
-
]);
|
|
128
|
-
},
|
|
129
|
-
cast_expr: function (print) { return print(["castKw", "args"]); },
|
|
130
|
-
cast_arg: function (print) { return print.spaced(["expr", "asKw", "dataType", "format"]); },
|
|
131
|
-
cast_format: function (print) { return print.spaced(["formatKw", "string", "timezone"]); },
|
|
132
|
-
cast_format_timezone: function (print) { return print.spaced(["atTimeZoneKw", "timezone"]); },
|
|
133
|
-
cast_operator_expr: function (print) { return [
|
|
134
|
-
print("left"),
|
|
135
|
-
print("operator"),
|
|
136
|
-
print("right"),
|
|
137
|
-
]; },
|
|
138
|
-
string_with_charset: function (print) { return ["_", print(["charset", "string"])]; },
|
|
139
|
-
raise_expr: function (print) { return print(["raiseKw", "args"]); },
|
|
140
|
-
raise_expr_type: function (print) { return print("typeKw"); },
|
|
141
|
-
extract_expr: function (print) { return print(["extractKw", "args"]); },
|
|
142
|
-
extract_from: function (print) { return print.spaced(["unit", "fromKw", "expr"]); },
|
|
143
|
-
week_expr: function (print) { return print(["weekKw", "args"]); },
|
|
144
|
-
interval_literal: function (print) {
|
|
145
|
-
return print.spaced(["intervalKw", "precision", "value", "unit"]);
|
|
146
|
-
},
|
|
147
|
-
array_literal_expr: function (print) { return print(["arrayKw", "expr"]); },
|
|
148
|
-
array_expr: function (print) {
|
|
149
|
-
return (0, print_utils_1.group)(["[", (0, print_utils_1.indent)([print_utils_1.softline, print("expr")]), print_utils_1.softline, "]"]);
|
|
150
|
-
},
|
|
151
|
-
struct_expr: function (print) {
|
|
152
|
-
return (0, print_utils_1.group)(["(", (0, print_utils_1.indent)([print_utils_1.softline, print("expr")]), print_utils_1.softline, ")"]);
|
|
153
|
-
},
|
|
154
|
-
typed_expr: function (print) { return print(["dataType", "expr"]); },
|
|
155
|
-
row_constructor: function (print) { return print(["rowKw", "row"]); },
|
|
156
|
-
array_constructor: function (print) { return print(["arrayKw", "expr"]); },
|
|
157
|
-
quantifier_expr: function (print) { return print.spaced(["quantifierKw", "expr"]); },
|
|
158
|
-
full_text_match_expr: function (print) {
|
|
159
|
-
return print.spaced(["matchKw", "columns", "againstKw", "args"]);
|
|
160
|
-
},
|
|
161
|
-
full_text_match_args: function (print) { return print.spaced(["expr", "modifier"]); },
|
|
162
|
-
/** cst-ignore: value */
|
|
163
|
-
number_literal: function (print) { return print("text"); },
|
|
164
|
-
/** cst-ignore: value */
|
|
165
|
-
boolean_literal: function (print, node, path, options) {
|
|
166
|
-
return (0, exports.printLiteral)(node.valueKw, options);
|
|
167
|
-
},
|
|
168
|
-
/** cst-ignore: value */
|
|
169
|
-
string_literal: function (print) { return print("text"); },
|
|
170
|
-
/** cst-ignore: value */
|
|
171
|
-
blob_literal: function (print) { return print("text"); },
|
|
172
|
-
/** cst-ignore: value */
|
|
173
|
-
null_literal: function (print, node, path, options) {
|
|
174
|
-
return (0, exports.printLiteral)(node.nullKw, options);
|
|
175
|
-
},
|
|
176
|
-
numeric_literal: function (print) { return print.spaced(["numericKw", "string"]); },
|
|
177
|
-
bignumeric_literal: function (print) { return print.spaced(["bignumericKw", "string"]); },
|
|
178
|
-
date_literal: function (print) { return print.spaced(["dateKw", "string"]); },
|
|
179
|
-
time_literal: function (print) { return print.spaced(["timeKw", "string"]); },
|
|
180
|
-
datetime_literal: function (print) { return print.spaced(["datetimeKw", "string"]); },
|
|
181
|
-
timestamp_literal: function (print) { return print.spaced(["timestampKw", "string"]); },
|
|
182
|
-
json_literal: function (print) { return print.spaced(["jsonKw", "string"]); },
|
|
183
|
-
jsonb_literal: function (print) { return print.spaced(["jsonbKw", "string"]); },
|
|
184
|
-
/** cst-ignore: name */
|
|
185
|
-
identifier: function (print, node, path, options) {
|
|
186
|
-
if (isQuotedIdentifier(node) || isInsideBigqueryQuotedMemberExpr(path)) {
|
|
187
|
-
return print("text");
|
|
188
|
-
}
|
|
189
|
-
else {
|
|
190
|
-
if (isFunctionName(node, path)) {
|
|
191
|
-
return printFunctionName(node, options);
|
|
192
|
-
}
|
|
193
|
-
else {
|
|
194
|
-
return printIdentifier(node, options);
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
},
|
|
198
|
-
/** cst-ignore: name */
|
|
199
|
-
variable: function (print, node, path, options) {
|
|
200
|
-
return isQuotedVariable(node) ? print("text") : printIdentifier(node, options);
|
|
201
|
-
},
|
|
202
|
-
parameter: function (print, node, path, options) {
|
|
203
|
-
return isQuotedParameter(node) ? print("text") : printIdentifier(node, options);
|
|
204
|
-
},
|
|
205
|
-
};
|
|
206
|
-
var printLiteral = function (node, options) {
|
|
207
|
-
switch (options.sqlLiteralCase) {
|
|
208
|
-
case "preserve":
|
|
209
|
-
return node.text;
|
|
210
|
-
case "upper":
|
|
211
|
-
return node.text.toUpperCase();
|
|
212
|
-
case "lower":
|
|
213
|
-
return node.text.toLowerCase();
|
|
214
|
-
}
|
|
215
|
-
};
|
|
216
|
-
exports.printLiteral = printLiteral;
|
|
217
|
-
var printIdentifier = function (node, options) {
|
|
218
|
-
switch (options.sqlIdentifierCase) {
|
|
219
|
-
case "preserve":
|
|
220
|
-
return node.text;
|
|
221
|
-
case "upper":
|
|
222
|
-
return node.text.toUpperCase();
|
|
223
|
-
case "lower":
|
|
224
|
-
return node.text.toLowerCase();
|
|
225
|
-
}
|
|
226
|
-
};
|
|
227
|
-
var printFunctionName = function (node, options) {
|
|
228
|
-
switch (options.sqlFunctionCase) {
|
|
229
|
-
case "preserve":
|
|
230
|
-
return node.text;
|
|
231
|
-
case "upper":
|
|
232
|
-
return node.text.toUpperCase();
|
|
233
|
-
case "lower":
|
|
234
|
-
return node.text.toLowerCase();
|
|
235
|
-
}
|
|
236
|
-
};
|
|
237
|
-
var isQuotedIdentifier = function (node) {
|
|
238
|
-
return node.name !== node.text;
|
|
239
|
-
};
|
|
240
|
-
var isQuotedVariable = function (node) {
|
|
241
|
-
return !(node.text === "@" + node.name || node.text === "@@" + node.name);
|
|
242
|
-
};
|
|
243
|
-
var isQuotedParameter = function (node) { return /`$/.test(node.text); };
|
|
244
|
-
var isInsideBigqueryQuotedMemberExpr = function (path) {
|
|
245
|
-
return path.ancestors.some(node_utils_1.isBigqueryQuotedMemberExpr);
|
|
246
|
-
};
|
|
247
|
-
var isFunctionName = function (node, path) {
|
|
248
|
-
var parent = path.parent;
|
|
249
|
-
if (isFunctionContext(parent, path.grandparent)) {
|
|
250
|
-
return true;
|
|
251
|
-
}
|
|
252
|
-
if ((0, node_utils_1.isMemberExpr)(parent) && parent.property === node) {
|
|
253
|
-
var _a = path.ancestors, _ = _a[0], gp = _a[1], ggp = _a[2];
|
|
254
|
-
return isFunctionContext(gp, ggp);
|
|
255
|
-
}
|
|
256
|
-
return false;
|
|
257
|
-
};
|
|
258
|
-
var isFunctionContext = function (node, parent) {
|
|
259
|
-
return ((0, node_utils_1.isFuncCall)(node) ||
|
|
260
|
-
(0, node_utils_1.isCreateFunctionStmt)(node) ||
|
|
261
|
-
(0, node_utils_1.isCreateProcedureStmt)(node) ||
|
|
262
|
-
(0, node_utils_1.isAlterFunctionStmt)(node) ||
|
|
263
|
-
(0, node_utils_1.isAlterProcedureStmt)(node) ||
|
|
264
|
-
((0, node_utils_1.isAlterActionRename)(node) &&
|
|
265
|
-
((0, node_utils_1.isAlterFunctionStmt)(parent) || (0, node_utils_1.isAlterProcedureStmt)(parent))) ||
|
|
266
|
-
(0, node_utils_1.isDropFunctionStmt)(node) ||
|
|
267
|
-
(0, node_utils_1.isDropProcedureStmt)(node) ||
|
|
268
|
-
((0, node_utils_1.isExecuteClause)(node) && (0, node_utils_1.isCreateTriggerStmt)(parent)));
|
|
269
|
-
};
|
|
270
|
-
var isBooleanOp = function (_a) {
|
|
271
|
-
var name = _a.name;
|
|
272
|
-
return name === "AND" || name === "OR";
|
|
273
|
-
};
|
package/dist/syntax/extension.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.extensionMap = void 0;
|
|
4
|
-
var print_utils_1 = require("../print_utils");
|
|
5
|
-
exports.extensionMap = {
|
|
6
|
-
create_extension_stmt: function (print, node) {
|
|
7
|
-
return (0, print_utils_1.group)([
|
|
8
|
-
print.spaced(["createExtensionKw", "ifNotExistsKw", "name"]),
|
|
9
|
-
node.clauses.length > 0
|
|
10
|
-
? (0, print_utils_1.indent)([print_utils_1.line, print.spaced(["withKw", "clauses"])])
|
|
11
|
-
: [],
|
|
12
|
-
]);
|
|
13
|
-
},
|
|
14
|
-
extension_cascade_clause: function (print) { return (0, print_utils_1.group)(print.spaced(["cascadeKw"])); },
|
|
15
|
-
extension_schema_clause: function (print) { return (0, print_utils_1.group)(print.spaced(["schemaKw", "name"])); },
|
|
16
|
-
extension_version_clause: function (print) {
|
|
17
|
-
return (0, print_utils_1.group)(print.spaced(["versionKw", "name"]));
|
|
18
|
-
},
|
|
19
|
-
drop_extension_stmt: function (print) {
|
|
20
|
-
return (0, print_utils_1.group)(print.spaced(["dropExtensionKw", "ifExistsKw", "names", "behaviorKw"]));
|
|
21
|
-
},
|
|
22
|
-
};
|
package/dist/syntax/frame.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.frameMap = void 0;
|
|
4
|
-
var print_utils_1 = require("../print_utils");
|
|
5
|
-
exports.frameMap = {
|
|
6
|
-
frame_clause: function (print, node) { return [
|
|
7
|
-
print.spaced(["unitKw", "extent"]),
|
|
8
|
-
node.exclusion ? [print_utils_1.hardline, print("exclusion")] : [],
|
|
9
|
-
]; },
|
|
10
|
-
frame_bound_current_row: function (print) { return print.spaced("currentRowKw"); },
|
|
11
|
-
frame_bound_preceding: function (print) { return print.spaced(["expr", "precedingKw"]); },
|
|
12
|
-
frame_bound_following: function (print) { return print.spaced(["expr", "followingKw"]); },
|
|
13
|
-
frame_unbounded: function (print) { return print.spaced("unboundedKw"); },
|
|
14
|
-
frame_between: function (print) {
|
|
15
|
-
return print.spaced(["betweenKw", "begin", "andKw", "end"]);
|
|
16
|
-
},
|
|
17
|
-
frame_exclusion: function (print) { return print.spaced(["excludeKw", "kindKw"]); },
|
|
18
|
-
};
|
package/dist/syntax/function.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.hasOnlyAsClause = exports.functionMap = void 0;
|
|
4
|
-
var print_utils_1 = require("../print_utils");
|
|
5
|
-
var node_utils_1 = require("../node_utils");
|
|
6
|
-
exports.functionMap = {
|
|
7
|
-
create_function_stmt: function (print, node) {
|
|
8
|
-
return (0, print_utils_1.group)([
|
|
9
|
-
print.spaced([
|
|
10
|
-
"createKw",
|
|
11
|
-
"orReplaceKw",
|
|
12
|
-
"temporaryKw",
|
|
13
|
-
"tableKw",
|
|
14
|
-
"functionKw",
|
|
15
|
-
"ifNotExistsKw",
|
|
16
|
-
"name",
|
|
17
|
-
]),
|
|
18
|
-
print("params"),
|
|
19
|
-
(0, exports.hasOnlyAsClause)(node)
|
|
20
|
-
? [" ", (0, print_utils_1.group)(print("clauses"))]
|
|
21
|
-
: [
|
|
22
|
-
print_utils_1.hardline,
|
|
23
|
-
(0, print_utils_1.join)(print_utils_1.hardline, print("clauses").map(function (cls) { return (0, print_utils_1.group)(cls); })),
|
|
24
|
-
],
|
|
25
|
-
]);
|
|
26
|
-
},
|
|
27
|
-
function_signature: function (print) { return print(["name", "params"]); },
|
|
28
|
-
function_param: function (print) {
|
|
29
|
-
return print.spaced(["mode", "name", "dataType", "default"]);
|
|
30
|
-
},
|
|
31
|
-
function_param_default: function (print) { return print.spaced(["operator", "expr"]); },
|
|
32
|
-
return_clause: function (print) { return print.spaced(["returnKw", "expr"]); },
|
|
33
|
-
function_behavior_clause: function (print) { return print.spaced(["behaviorKw"]); },
|
|
34
|
-
function_security_clause: function (print) {
|
|
35
|
-
return print.spaced(["externalKw", "securityKw"]);
|
|
36
|
-
},
|
|
37
|
-
function_cost_clause: function (print) { return print.spaced(["costKw", "cost"]); },
|
|
38
|
-
function_rows_clause: function (print) { return print.spaced(["rowsKw", "rows"]); },
|
|
39
|
-
function_support_clause: function (print) { return print.spaced(["supportKw", "name"]); },
|
|
40
|
-
function_window_clause: function (print) { return print.spaced("windowKw"); },
|
|
41
|
-
function_transform_clause: function (print) { return print.spaced(["transformKw", "types"]); },
|
|
42
|
-
transform_type: function (print) { return print.spaced(["forTypeKw", "dataType"]); },
|
|
43
|
-
dynamically_loaded_function: function (print) {
|
|
44
|
-
return (0, print_utils_1.join)(", ", print(["objectFile", "symbol"]));
|
|
45
|
-
},
|
|
46
|
-
drop_function_stmt: function (print) {
|
|
47
|
-
return (0, print_utils_1.group)([
|
|
48
|
-
print.spaced(["dropKw", "tableKw", "functionKw", "ifExistsKw", "name"]),
|
|
49
|
-
print.spaced(["params", "behaviorKw"]),
|
|
50
|
-
]);
|
|
51
|
-
},
|
|
52
|
-
// almost exact copy of alter_procedure_stmt
|
|
53
|
-
alter_function_stmt: function (print, node) {
|
|
54
|
-
return (0, print_utils_1.group)([
|
|
55
|
-
print.spaced(["alterKw", "functionKw"]),
|
|
56
|
-
" ",
|
|
57
|
-
print(["name", "params"]),
|
|
58
|
-
print.dynamicLine(),
|
|
59
|
-
(0, print_utils_1.join)(print.dynamicLine(), print("actions")),
|
|
60
|
-
node.behaviorKw ? [print.dynamicLine(), print("behaviorKw")] : [],
|
|
61
|
-
]);
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
var hasOnlyAsClause = function (node) { return node.clauses.length === 1 && (0, node_utils_1.isAsClause)(node.clauses[0]); };
|
|
65
|
-
exports.hasOnlyAsClause = hasOnlyAsClause;
|
package/dist/syntax/index.js
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
-
if (ar || !(i in from)) {
|
|
5
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
-
ar[i] = from[i];
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.indexMap = void 0;
|
|
13
|
-
var print_utils_1 = require("../print_utils");
|
|
14
|
-
exports.indexMap = {
|
|
15
|
-
create_index_stmt: function (print) {
|
|
16
|
-
return (0, print_utils_1.group)((0, print_utils_1.join)(print.dynamicLine(), __spreadArray([
|
|
17
|
-
print.spaced([
|
|
18
|
-
"createKw",
|
|
19
|
-
"orReplaceKw",
|
|
20
|
-
"indexTypeKw",
|
|
21
|
-
"indexKw",
|
|
22
|
-
"concurrentlyKw",
|
|
23
|
-
"ifNotExistsKw",
|
|
24
|
-
"name",
|
|
25
|
-
"onKw",
|
|
26
|
-
"table",
|
|
27
|
-
"using",
|
|
28
|
-
"columns",
|
|
29
|
-
])
|
|
30
|
-
], print("clauses"), true)));
|
|
31
|
-
},
|
|
32
|
-
index_specification: function (print) {
|
|
33
|
-
return print.spaced(["expr", "opclass", "direction", "nullHandlingKw"]);
|
|
34
|
-
},
|
|
35
|
-
index_include_clause: function (print) { return print.spaced(["includeKw", "columns"]); },
|
|
36
|
-
index_nulls_distinct_clause: function (print) { return print.spaced(["nullsDistinctKw"]); },
|
|
37
|
-
index_nulls_not_distinct_clause: function (print) {
|
|
38
|
-
return print.spaced(["nullsNotDistinctKw"]);
|
|
39
|
-
},
|
|
40
|
-
drop_index_stmt: function (print) {
|
|
41
|
-
return (0, print_utils_1.group)(print.spaced([
|
|
42
|
-
"dropKw",
|
|
43
|
-
"indexTypeKw",
|
|
44
|
-
"indexKw",
|
|
45
|
-
"concurrentlyKw",
|
|
46
|
-
"ifExistsKw",
|
|
47
|
-
"indexes",
|
|
48
|
-
"onKw",
|
|
49
|
-
"table",
|
|
50
|
-
"behaviorKw",
|
|
51
|
-
]));
|
|
52
|
-
},
|
|
53
|
-
verbose_all_columns: function (print) { return print.spaced("allColumnsKw"); },
|
|
54
|
-
alter_index_stmt: function (print) {
|
|
55
|
-
return (0, print_utils_1.group)([
|
|
56
|
-
print.spaced(["alterKw", "indexKw", "ifExistsKw", "index"]),
|
|
57
|
-
print.dynamicLine(),
|
|
58
|
-
print("action"),
|
|
59
|
-
]);
|
|
60
|
-
},
|
|
61
|
-
alter_index_all_in_tablespace_stmt: function (print) {
|
|
62
|
-
return (0, print_utils_1.group)([
|
|
63
|
-
print.spaced([
|
|
64
|
-
"alterIndexKw",
|
|
65
|
-
"allInTablespaceKw",
|
|
66
|
-
"tablespace",
|
|
67
|
-
"ownedBy",
|
|
68
|
-
]),
|
|
69
|
-
print.dynamicLine(),
|
|
70
|
-
print("action"),
|
|
71
|
-
]);
|
|
72
|
-
},
|
|
73
|
-
reindex_stmt: function (print) {
|
|
74
|
-
return (0, print_utils_1.group)(print.spaced([
|
|
75
|
-
"reindexKw",
|
|
76
|
-
"options",
|
|
77
|
-
"targetKw",
|
|
78
|
-
"concurrentlyKw",
|
|
79
|
-
"name",
|
|
80
|
-
]));
|
|
81
|
-
},
|
|
82
|
-
reindex_option_concurrently: function (print) {
|
|
83
|
-
return print.spaced(["concurrentlyKw", "value"]);
|
|
84
|
-
},
|
|
85
|
-
reindex_option_tablespace: function (print) { return print.spaced(["tablespaceKw", "name"]); },
|
|
86
|
-
reindex_option_verbose: function (print) { return print.spaced(["verboseKw", "value"]); },
|
|
87
|
-
};
|
package/dist/syntax/insert.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.insertMap = void 0;
|
|
4
|
-
var print_utils_1 = require("../print_utils");
|
|
5
|
-
exports.insertMap = {
|
|
6
|
-
insert_stmt: function (print) { return (0, print_utils_1.group)((0, print_utils_1.join)(print.dynamicLine(), print("clauses"))); },
|
|
7
|
-
insert_clause: function (print, node) {
|
|
8
|
-
return (0, print_utils_1.group)([
|
|
9
|
-
print.spaced(["insertKw", "modifiers", "orAction", "intoKw", "table"]),
|
|
10
|
-
node.columns ? (0, print_utils_1.indent)([print.dynamicLine(), print("columns")]) : [],
|
|
11
|
-
]);
|
|
12
|
-
},
|
|
13
|
-
values_clause: function (print) {
|
|
14
|
-
return (0, print_utils_1.group)([print("valuesKw"), (0, print_utils_1.indent)([print.dynamicLine(), print("values")])]);
|
|
15
|
-
},
|
|
16
|
-
or_alternate_action: function (print) { return print.spaced(["orKw", "actionKw"]); },
|
|
17
|
-
default: function (print) { return print("defaultKw"); },
|
|
18
|
-
default_values: function (print) { return print.spaced("defaultValuesKw"); },
|
|
19
|
-
upsert_clause: function (print) {
|
|
20
|
-
return print.spaced(["onConflictKw", "conflictTarget", "where", "doKw", "action"]);
|
|
21
|
-
},
|
|
22
|
-
conflict_target_on_constraint: function (print) {
|
|
23
|
-
return print.spaced(["onConstraintKw", "constraint"]);
|
|
24
|
-
},
|
|
25
|
-
upsert_action_nothing: function (print) { return print("nothingKw"); },
|
|
26
|
-
upsert_action_update: function (print) {
|
|
27
|
-
return (0, print_utils_1.group)([
|
|
28
|
-
print("updateKw"),
|
|
29
|
-
(0, print_utils_1.indent)([
|
|
30
|
-
print.dynamicLine(),
|
|
31
|
-
(0, print_utils_1.join)(print.dynamicLine(), print(["set", "where"])),
|
|
32
|
-
]),
|
|
33
|
-
]);
|
|
34
|
-
},
|
|
35
|
-
row_alias_clause: function (print, node) {
|
|
36
|
-
return (0, print_utils_1.group)([
|
|
37
|
-
print.spaced(["asKw", "rowAlias"]),
|
|
38
|
-
node.columnAliases
|
|
39
|
-
? (0, print_utils_1.indent)([print.dynamicLine(), print("columnAliases")])
|
|
40
|
-
: [],
|
|
41
|
-
]);
|
|
42
|
-
},
|
|
43
|
-
on_duplicate_key_update_clause: function (print) {
|
|
44
|
-
return (0, print_utils_1.group)([
|
|
45
|
-
print.spaced("onDuplicateKeyUpdateKw"),
|
|
46
|
-
(0, print_utils_1.indent)([print.dynamicLine(), print("assignments")]),
|
|
47
|
-
]);
|
|
48
|
-
},
|
|
49
|
-
overriding_clause: function (print) { return print.spaced("overridingKw"); },
|
|
50
|
-
};
|
package/dist/syntax/merge.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mergeMap = void 0;
|
|
4
|
-
var print_utils_1 = require("../print_utils");
|
|
5
|
-
exports.mergeMap = {
|
|
6
|
-
merge_stmt: function (print) { return (0, print_utils_1.group)((0, print_utils_1.join)(print_utils_1.hardline, print("clauses"))); },
|
|
7
|
-
merge_clause: function (print) {
|
|
8
|
-
return (0, print_utils_1.join)(print_utils_1.line, [
|
|
9
|
-
print.spaced(["mergeKw", "intoKw", "target"]),
|
|
10
|
-
print.spaced(["usingKw", "source"]),
|
|
11
|
-
(0, print_utils_1.group)([print("onKw"), (0, print_utils_1.indent)([print_utils_1.line, print("condition")])]),
|
|
12
|
-
]);
|
|
13
|
-
},
|
|
14
|
-
merge_when_clause: function (print, node) { return [
|
|
15
|
-
(0, print_utils_1.group)([
|
|
16
|
-
print.spaced(["whenKw", "matchedKw", "byKw"]),
|
|
17
|
-
node.condition ? (0, print_utils_1.indent)([print_utils_1.line, print("condition")]) : [],
|
|
18
|
-
[print_utils_1.line, print("thenKw")],
|
|
19
|
-
]),
|
|
20
|
-
(0, print_utils_1.indent)([print_utils_1.hardline, (0, print_utils_1.group)(print("action"))]),
|
|
21
|
-
]; },
|
|
22
|
-
merge_when_condition: function (print) { return print.spaced(["andKw", "expr"]); },
|
|
23
|
-
merge_action_delete: function (print) { return print("deleteKw"); },
|
|
24
|
-
merge_action_insert: function (print, node) { return [
|
|
25
|
-
(0, print_utils_1.group)([
|
|
26
|
-
print("insertKw"),
|
|
27
|
-
node.columns ? (0, print_utils_1.indent)([print_utils_1.hardline, print("columns")]) : [],
|
|
28
|
-
]),
|
|
29
|
-
print_utils_1.line,
|
|
30
|
-
(0, print_utils_1.join)(print_utils_1.hardline, print("clauses")),
|
|
31
|
-
]; },
|
|
32
|
-
merge_action_insert_row_clause: function (print) { return print("rowKw"); },
|
|
33
|
-
merge_action_update: function (print) { return print.spaced(["updateKw", "set"]); },
|
|
34
|
-
merge_action_do_nothing: function (print) { return print.spaced(["doNothingKw"]); },
|
|
35
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.otherClausesMap = void 0;
|
|
4
|
-
var print_utils_1 = require("../print_utils");
|
|
5
|
-
exports.otherClausesMap = {
|
|
6
|
-
// CLUSTER BY clause
|
|
7
|
-
cluster_by_clause: function (print) {
|
|
8
|
-
return (0, print_utils_1.group)([print.spaced("clusterByKw"), (0, print_utils_1.indent)([print_utils_1.line, print("columns")])]);
|
|
9
|
-
},
|
|
10
|
-
// RETURNING clause
|
|
11
|
-
returning_clause: function (print) {
|
|
12
|
-
return (0, print_utils_1.group)([print("returningKw"), (0, print_utils_1.indent)([print_utils_1.line, print("columns")])]);
|
|
13
|
-
},
|
|
14
|
-
// WHERE CURRENT OF clause
|
|
15
|
-
where_current_of_clause: function (print) {
|
|
16
|
-
return print.spaced(["whereCurrentOfKw", "cursor"]);
|
|
17
|
-
},
|
|
18
|
-
};
|
package/dist/syntax/parameter.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parameterMap = void 0;
|
|
4
|
-
var expr_1 = require("./expr");
|
|
5
|
-
var print_utils_1 = require("../print_utils");
|
|
6
|
-
exports.parameterMap = {
|
|
7
|
-
// SET
|
|
8
|
-
set_parameter_stmt: function (print) {
|
|
9
|
-
return (0, print_utils_1.group)(print.spaced(["setKw", "modifierKw", "name", "operator", "value"]));
|
|
10
|
-
},
|
|
11
|
-
set_time_zone_parameter_stmt: function (print) {
|
|
12
|
-
return (0, print_utils_1.group)(print.spaced(["setKw", "modifierKw", "timeZoneKw", "value"]));
|
|
13
|
-
},
|
|
14
|
-
set_parameter_clause: function (print) {
|
|
15
|
-
return print.spaced(["setKw", "name", "operator", "value"]);
|
|
16
|
-
},
|
|
17
|
-
local_parameter_value: function (print) { return print("localKw"); },
|
|
18
|
-
set_parameter_from_current_clause: function (print) {
|
|
19
|
-
return print.spaced(["setKw", "name", "fromCurrentKw"]);
|
|
20
|
-
},
|
|
21
|
-
// RESET
|
|
22
|
-
reset_parameter_stmt: function (print) { return (0, print_utils_1.group)(print.spaced(["resetKw", "name"])); },
|
|
23
|
-
reset_parameter_clause: function (print) { return print.spaced(["resetKw", "name"]); },
|
|
24
|
-
all_parameters: function (print) { return print("allKw"); },
|
|
25
|
-
// SHOW
|
|
26
|
-
show_parameter_stmt: function (print) { return (0, print_utils_1.group)(print.spaced(["showKw", "name"])); },
|
|
27
|
-
/** cst-ignore: value */
|
|
28
|
-
boolean_on_off_literal: function (print, node, path, options) {
|
|
29
|
-
return (0, expr_1.printLiteral)(node.valueKw, options);
|
|
30
|
-
},
|
|
31
|
-
};
|
package/dist/syntax/policy.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.policyMap = void 0;
|
|
4
|
-
var print_utils_1 = require("../print_utils");
|
|
5
|
-
exports.policyMap = {
|
|
6
|
-
create_policy_stmt: function (print, node) {
|
|
7
|
-
return (0, print_utils_1.group)([
|
|
8
|
-
print.spaced(["createPolicyKw", "name", "onKw", "table"]),
|
|
9
|
-
node.clauses.length > 0 ? print.dynamicLine() : [],
|
|
10
|
-
(0, print_utils_1.join)(print.dynamicLine(), print("clauses")),
|
|
11
|
-
]);
|
|
12
|
-
},
|
|
13
|
-
policy_permissive_clause: function (print) {
|
|
14
|
-
return (0, print_utils_1.group)(print.spaced(["asKw", "permissiveKw"]));
|
|
15
|
-
},
|
|
16
|
-
policy_restrictive_clause: function (print) {
|
|
17
|
-
return (0, print_utils_1.group)(print.spaced(["asKw", "restrictiveKw"]));
|
|
18
|
-
},
|
|
19
|
-
policy_command_clause: function (print) { return (0, print_utils_1.group)(print.spaced(["forKw", "commandKw"])); },
|
|
20
|
-
policy_roles_clause: function (print) { return (0, print_utils_1.group)(print.spaced(["toKw", "roles"])); },
|
|
21
|
-
policy_using_clause: function (print) { return (0, print_utils_1.group)(print.spaced(["usingKw", "expr"])); },
|
|
22
|
-
policy_check_clause: function (print) {
|
|
23
|
-
return (0, print_utils_1.group)(print.spaced(["withKw", "checkKw", "expr"]));
|
|
24
|
-
},
|
|
25
|
-
alter_policy_stmt: function (print) {
|
|
26
|
-
return (0, print_utils_1.group)([
|
|
27
|
-
print.spaced(["alterPolicyKw", "name", "onKw", "table"]),
|
|
28
|
-
print.dynamicLine(),
|
|
29
|
-
(0, print_utils_1.join)(print.dynamicLine(), print("actions")),
|
|
30
|
-
]);
|
|
31
|
-
},
|
|
32
|
-
drop_policy_stmt: function (print) {
|
|
33
|
-
return (0, print_utils_1.group)(print.spaced([
|
|
34
|
-
"dropPolicyKw",
|
|
35
|
-
"ifExistsKw",
|
|
36
|
-
"name",
|
|
37
|
-
"onKw",
|
|
38
|
-
"table",
|
|
39
|
-
"behaviorKw",
|
|
40
|
-
]));
|
|
41
|
-
},
|
|
42
|
-
};
|