prettier-plugin-sql-cst
Advanced tools
Comparing version 0.11.4 to 0.11.5
@@ -148,2 +148,3 @@ "use strict"; | ||
row_constructor: function (print) { return print(["rowKw", "row"]); }, | ||
array_constructor: function (print) { return print(["arrayKw", "expr"]); }, | ||
quantifier_expr: function (print) { return print.spaced(["quantifierKw", "expr"]); }, | ||
@@ -150,0 +151,0 @@ full_text_match_expr: function (print) { |
@@ -7,2 +7,3 @@ "use strict"; | ||
exports.functionMap = { | ||
/** cst-ignore: behaviorKw */ | ||
create_function_stmt: function (print, node) { return [ | ||
@@ -56,2 +57,16 @@ print.spaced([ | ||
}, | ||
// almost exact copy of alter_procedure_stmt | ||
alter_function_stmt: function (print, node) { | ||
return (0, print_utils_1.group)([ | ||
print.spaced(["alterKw", "functionKw"]), | ||
" ", | ||
print(["name", "params"]), | ||
print.dynamicLine(), | ||
(0, print_utils_1.join)(print.dynamicLine(), print("actions")), | ||
node.behaviorKw ? [print.dynamicLine(), print("behaviorKw")] : [], | ||
]); | ||
}, | ||
reset_parameter_clause: function (print) { return print.spaced(["resetKw", "name"]); }, | ||
/** cst-ignore: name */ | ||
reset_all_parameters_clause: function (print) { return print.spaced("resetAllKw"); }, | ||
}; | ||
@@ -58,0 +73,0 @@ var hasOnlyAsClause = function (node) { |
@@ -24,2 +24,13 @@ "use strict"; | ||
}, | ||
// almost exact copy of alter_function_stmt | ||
alter_procedure_stmt: function (print, node) { | ||
return (0, print_utils_1.group)([ | ||
print.spaced(["alterKw", "procedureKw"]), | ||
" ", | ||
print(["name", "params"]), | ||
print.dynamicLine(), | ||
(0, print_utils_1.join)(print.dynamicLine(), print("actions")), | ||
node.behaviorKw ? [print.dynamicLine(), print("behaviorKw")] : [], | ||
]); | ||
}, | ||
}; |
@@ -16,6 +16,7 @@ "use strict"; | ||
create_trigger_stmt: function (print, node) { | ||
return (0, print_utils_1.join)(print_utils_1.hardline, __spreadArray(__spreadArray(__spreadArray([ | ||
return (0, print_utils_1.join)(print_utils_1.hardline, __spreadArray(__spreadArray([ | ||
print.spaced([ | ||
"createKw", | ||
"temporaryKw", | ||
"orReplaceKw", | ||
"kind", | ||
"triggerKw", | ||
@@ -25,19 +26,38 @@ "ifNotExistsKw", | ||
]), | ||
print("event") | ||
], print.spaced(["forEachRowKw"]), true), print(["condition"]), true), [ | ||
(0, print_utils_1.group)([ | ||
node.timeKw ? [print.spaced("timeKw"), " "] : [], | ||
print("event"), | ||
print_utils_1.line, | ||
print("target"), | ||
]) | ||
], print("clauses"), true), [ | ||
print("body"), | ||
], false)); | ||
}, | ||
trigger_event: function (print) { | ||
trigger_event: function (print, node) { | ||
return (0, print_utils_1.group)([ | ||
print.spaced(["timeKw", "eventKw", "ofKw"]), | ||
(0, print_utils_1.indent)([ | ||
print_utils_1.line, | ||
(0, print_utils_1.join)(print_utils_1.line, __spreadArray(__spreadArray([], print(["columns"]), true), [print.spaced(["onKw", "table"])], false)), | ||
]), | ||
print.spaced(["eventKw", "ofKw"]), | ||
node.columns ? (0, print_utils_1.indent)([print_utils_1.line, print("columns")]) : [], | ||
]); | ||
}, | ||
trigger_condition: function (print) { | ||
trigger_target: function (print) { return print.spaced(["onKw", "table"]); }, | ||
when_clause: function (print) { | ||
return (0, print_utils_1.group)([print("whenKw"), (0, print_utils_1.indent)([print_utils_1.line, print("expr")])]); | ||
}, | ||
for_each_clause: function (print) { return print.spaced(["forEachKw", "itemKw"]); }, | ||
execute_clause: function (print) { return [ | ||
print.spaced(["executeKw", "functionKw", "name"]), | ||
print("args"), | ||
]; }, | ||
from_referenced_table_clause: function (print) { return print.spaced(["fromKw", "table"]); }, | ||
trigger_timing_clause: function (print) { return print.spaced(["timingKw"]); }, | ||
trigger_referencing_clause: function (print) { | ||
return (0, print_utils_1.group)([ | ||
print.spaced(["referencingKw"]), | ||
(0, print_utils_1.indent)([print_utils_1.line, print("transitions")]), | ||
]); | ||
}, | ||
trigger_transition: function (print) { return [ | ||
print.spaced(["oldOrNewKw", "rowOrTableKw", "asKw", "name"]), | ||
]; }, | ||
drop_trigger_stmt: function (print) { | ||
@@ -44,0 +64,0 @@ return print.spaced(["dropTriggerKw", "ifExistsKw", "trigger"]); |
{ | ||
"name": "prettier-plugin-sql-cst", | ||
"version": "0.11.4", | ||
"version": "0.11.5", | ||
"description": "Prettier plugin for SQL", | ||
@@ -36,3 +36,3 @@ "author": "Rene Saarsoo <nene@triin.net>", | ||
"prettier": "^3.0.3", | ||
"sql-parser-cst": "^0.27.1" | ||
"sql-parser-cst": "^0.28.0" | ||
}, | ||
@@ -39,0 +39,0 @@ "devDependencies": { |
175854
2956
+ Addedsql-parser-cst@0.28.1(transitive)
- Removedsql-parser-cst@0.27.1(transitive)
Updatedsql-parser-cst@^0.28.0