prettier-plugin-sql-cst 0.12.0 → 0.12.2
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/syntax/alter_action.js +19 -0
- package/dist/syntax/dcl.d.ts +2 -2
- package/dist/syntax/dcl.js +100 -13
- package/dist/syntax/domain.js +1 -1
- package/dist/syntax/function.js +1 -0
- package/dist/syntax/role.d.ts +3 -0
- package/dist/syntax/role.js +56 -0
- package/dist/syntax/select.js +1 -0
- package/dist/syntax/transaction.js +17 -4
- package/dist/syntax/transformMap.js +2 -1
- package/dist/syntax/trigger.js +13 -1
- package/package.json +3 -2
|
@@ -177,6 +177,25 @@ exports.alterActionMap = {
|
|
|
177
177
|
alter_action_set_sequence_option: function (print) {
|
|
178
178
|
return print.spaced(["setKw", "option"]);
|
|
179
179
|
},
|
|
180
|
+
alter_action_with_role_options: function (print, node) {
|
|
181
|
+
return node.withKw
|
|
182
|
+
? (0, print_utils_1.group)([print("withKw"), (0, print_utils_1.indent)([print_utils_1.line, (0, print_utils_1.join)(print_utils_1.line, print("options"))])])
|
|
183
|
+
: // This works in tandem with the logic inside alter_role_stmt
|
|
184
|
+
(0, print_utils_1.group)((0, print_utils_1.join)(print_utils_1.line, print("options")));
|
|
185
|
+
},
|
|
186
|
+
alter_action_set_postgresql_option: function (print) {
|
|
187
|
+
return print.spaced(["setKw", "name", "operator", "value"]);
|
|
188
|
+
},
|
|
189
|
+
alter_action_set_postgresql_option_from_current: function (print) {
|
|
190
|
+
return print.spaced(["setKw", "name", "fromCurrentKw"]);
|
|
191
|
+
},
|
|
192
|
+
alter_action_reset_postgresql_option: function (print) {
|
|
193
|
+
return print.spaced(["resetKw", "name"]);
|
|
194
|
+
},
|
|
195
|
+
alter_action_add_user: function (print) { return (0, print_utils_1.group)(print.spaced(["addUserKw", "users"])); },
|
|
196
|
+
alter_action_drop_user: function (print) {
|
|
197
|
+
return (0, print_utils_1.group)(print.spaced(["dropUserKw", "users"]));
|
|
198
|
+
},
|
|
180
199
|
// ENABLE/DISABLE ..
|
|
181
200
|
toggle_trigger: function (print) { return print.spaced(["triggerKw", "name"]); },
|
|
182
201
|
toggle_rule: function (print) { return print.spaced(["ruleKw", "name"]); },
|
package/dist/syntax/dcl.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AllDclNodes } from "sql-parser-cst";
|
|
2
2
|
import { CstToDocMap } from "../CstToDocMap";
|
|
3
|
-
export declare const dclMap: CstToDocMap<
|
|
3
|
+
export declare const dclMap: CstToDocMap<AllDclNodes>;
|
package/dist/syntax/dcl.js
CHANGED
|
@@ -1,20 +1,107 @@
|
|
|
1
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
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
12
|
exports.dclMap = void 0;
|
|
4
13
|
var print_utils_1 = require("../print_utils");
|
|
5
14
|
exports.dclMap = {
|
|
6
|
-
|
|
7
|
-
return (0, print_utils_1.group)((0, print_utils_1.join)(print.dynamicLine(), [
|
|
8
|
-
(0, print_utils_1.group)([print("grantKw"), (0, print_utils_1.indent)([print_utils_1.line, print("
|
|
9
|
-
(0, print_utils_1.group)(print.spaced(["onKw", "
|
|
10
|
-
(0, print_utils_1.group)([print("toKw"), (0, print_utils_1.indent)([print_utils_1.line, print("
|
|
11
|
-
]));
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
return (0, print_utils_1.group)((0, print_utils_1.join)(print.dynamicLine(), [
|
|
15
|
-
(0, print_utils_1.group)(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
grant_privilege_stmt: function (print) {
|
|
16
|
+
return (0, print_utils_1.group)((0, print_utils_1.join)(print.dynamicLine(), __spreadArray([
|
|
17
|
+
(0, print_utils_1.group)([print("grantKw"), (0, print_utils_1.indent)([print_utils_1.line, print("privileges")])]),
|
|
18
|
+
(0, print_utils_1.group)(print.spaced(["onKw", "resource"])),
|
|
19
|
+
(0, print_utils_1.group)([print("toKw"), (0, print_utils_1.indent)([print_utils_1.line, print("roles")])])
|
|
20
|
+
], print("clauses"), true)));
|
|
21
|
+
},
|
|
22
|
+
grant_role_stmt: function (print) {
|
|
23
|
+
return (0, print_utils_1.group)((0, print_utils_1.join)(print.dynamicLine(), __spreadArray([
|
|
24
|
+
(0, print_utils_1.group)((0, print_utils_1.join)(print_utils_1.line, [
|
|
25
|
+
(0, print_utils_1.group)([print("grantKw"), (0, print_utils_1.indent)([print_utils_1.line, print("grantedRoles")])]),
|
|
26
|
+
(0, print_utils_1.group)([print("toKw"), (0, print_utils_1.indent)([print_utils_1.line, print("granteeRoles")])]),
|
|
27
|
+
]))
|
|
28
|
+
], print("clauses"), true)));
|
|
29
|
+
},
|
|
30
|
+
revoke_privilege_stmt: function (print) {
|
|
31
|
+
return (0, print_utils_1.group)((0, print_utils_1.join)(print.dynamicLine(), __spreadArray([
|
|
32
|
+
(0, print_utils_1.group)([
|
|
33
|
+
print.spaced(["revokeKw", "option"]),
|
|
34
|
+
(0, print_utils_1.indent)([print_utils_1.line, print("privileges")]),
|
|
35
|
+
]),
|
|
36
|
+
(0, print_utils_1.group)(print.spaced(["onKw", "resource"])),
|
|
37
|
+
(0, print_utils_1.group)([print("fromKw"), (0, print_utils_1.indent)([print_utils_1.line, print("roles")])])
|
|
38
|
+
], print(["grantedBy", "behaviorKw"]), true)));
|
|
39
|
+
},
|
|
40
|
+
revoke_role_stmt: function (print) {
|
|
41
|
+
return (0, print_utils_1.group)((0, print_utils_1.join)(print.dynamicLine(), __spreadArray([
|
|
42
|
+
(0, print_utils_1.group)((0, print_utils_1.join)(print_utils_1.line, [
|
|
43
|
+
(0, print_utils_1.group)([
|
|
44
|
+
print.spaced(["revokeKw", "option"]),
|
|
45
|
+
(0, print_utils_1.indent)([print_utils_1.line, print("grantedRoles")]),
|
|
46
|
+
]),
|
|
47
|
+
(0, print_utils_1.group)([print("fromKw"), (0, print_utils_1.indent)([print_utils_1.line, print("granteeRoles")])]),
|
|
48
|
+
]))
|
|
49
|
+
], print(["grantedBy", "behaviorKw"]), true)));
|
|
50
|
+
},
|
|
51
|
+
privilege: function (print) { return print.spaced(["privilegeKw", "columns"]); },
|
|
52
|
+
all_privileges: function (print) { return print.spaced(["allKw", "privilegesKw", "columns"]); },
|
|
53
|
+
grant_resource_table: function (print) { return (0, print_utils_1.group)(print.spaced(["tableKw", "tables"])); },
|
|
54
|
+
grant_resource_view: function (print) { return (0, print_utils_1.group)(print.spaced(["viewKw", "views"])); },
|
|
55
|
+
grant_resource_schema: function (print) {
|
|
56
|
+
return (0, print_utils_1.group)(print.spaced(["schemaKw", "schemas"]));
|
|
57
|
+
},
|
|
58
|
+
grant_resource_sequence: function (print) {
|
|
59
|
+
return (0, print_utils_1.group)(print.spaced(["sequenceKw", "sequences"]));
|
|
60
|
+
},
|
|
61
|
+
grant_resource_database: function (print) {
|
|
62
|
+
return (0, print_utils_1.group)(print.spaced(["databaseKw", "databases"]));
|
|
63
|
+
},
|
|
64
|
+
grant_resource_domain: function (print) {
|
|
65
|
+
return (0, print_utils_1.group)(print.spaced(["domainKw", "domains"]));
|
|
66
|
+
},
|
|
67
|
+
grant_resource_foreign_data_wrapper: function (print) {
|
|
68
|
+
return (0, print_utils_1.group)(print.spaced(["foreignDataWrapperKw", "dataWrappers"]));
|
|
69
|
+
},
|
|
70
|
+
grant_resource_foreign_server: function (print) {
|
|
71
|
+
return (0, print_utils_1.group)(print.spaced(["foreignServerKw", "servers"]));
|
|
72
|
+
},
|
|
73
|
+
grant_resource_function: function (print) {
|
|
74
|
+
return (0, print_utils_1.group)(print.spaced(["functionKw", "functions"]));
|
|
75
|
+
},
|
|
76
|
+
grant_resource_language: function (print) {
|
|
77
|
+
return (0, print_utils_1.group)(print.spaced(["languageKw", "languages"]));
|
|
78
|
+
},
|
|
79
|
+
grant_resource_large_object: function (print) {
|
|
80
|
+
return (0, print_utils_1.group)(print.spaced(["largeObjectKw", "oids"]));
|
|
81
|
+
},
|
|
82
|
+
grant_resource_postgresql_option: function (print) {
|
|
83
|
+
return (0, print_utils_1.group)(print.spaced(["parameterKw", "options"]));
|
|
84
|
+
},
|
|
85
|
+
grant_resource_tablespace: function (print) {
|
|
86
|
+
return (0, print_utils_1.group)(print.spaced(["tablespaceKw", "tablespaces"]));
|
|
87
|
+
},
|
|
88
|
+
grant_resource_type: function (print) { return (0, print_utils_1.group)(print.spaced(["typeKw", "types"])); },
|
|
89
|
+
grant_resource_all_tables_in_schema: function (print) {
|
|
90
|
+
return (0, print_utils_1.group)(print.spaced(["allTablesInSchemaKw", "schemas"]));
|
|
91
|
+
},
|
|
92
|
+
grant_resource_all_sequences_in_schema: function (print) {
|
|
93
|
+
return (0, print_utils_1.group)(print.spaced(["allSequencesInSchemaKw", "schemas"]));
|
|
94
|
+
},
|
|
95
|
+
grant_resource_all_functions_in_schema: function (print) {
|
|
96
|
+
return (0, print_utils_1.group)(print.spaced(["allFunctionsInSchemaKw", "schemas"]));
|
|
97
|
+
},
|
|
98
|
+
with_grant_option_clause: function (print) {
|
|
99
|
+
return (0, print_utils_1.group)(print.spaced(["withKw", "nameKw", "value"]));
|
|
100
|
+
},
|
|
101
|
+
grant_option_for_clause: function (print) {
|
|
102
|
+
return (0, print_utils_1.group)(print.spaced(["nameKw", "optionForKw"]));
|
|
19
103
|
},
|
|
104
|
+
granted_by_clause: function (print) { return (0, print_utils_1.group)(print.spaced(["grantedByKw", "role"])); },
|
|
105
|
+
grantee_public: function (print) { return print("publicKw"); },
|
|
106
|
+
grantee_group: function (print) { return (0, print_utils_1.group)(print.spaced(["groupKw", "name"])); },
|
|
20
107
|
};
|
package/dist/syntax/domain.js
CHANGED
|
@@ -11,7 +11,7 @@ exports.domainMap = {
|
|
|
11
11
|
: [],
|
|
12
12
|
]);
|
|
13
13
|
},
|
|
14
|
-
alter_domain_stmt: function (print
|
|
14
|
+
alter_domain_stmt: function (print) {
|
|
15
15
|
return (0, print_utils_1.group)(print.spaced(["alterDomainKw", "name", "action"]));
|
|
16
16
|
},
|
|
17
17
|
drop_domain_stmt: function (print) {
|
package/dist/syntax/function.js
CHANGED
|
@@ -22,6 +22,7 @@ exports.functionMap = {
|
|
|
22
22
|
(0, print_utils_1.join)(print_utils_1.hardline, print("clauses").map(function (cls) { return (0, print_utils_1.group)(cls); })),
|
|
23
23
|
],
|
|
24
24
|
]; },
|
|
25
|
+
function_signature: function (print) { return print(["name", "params"]); },
|
|
25
26
|
function_param: function (print) {
|
|
26
27
|
return print.spaced(["mode", "name", "dataType", "default"]);
|
|
27
28
|
},
|
|
@@ -0,0 +1,56 @@
|
|
|
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.roleMap = void 0;
|
|
13
|
+
var print_utils_1 = require("../print_utils");
|
|
14
|
+
exports.roleMap = {
|
|
15
|
+
create_role_stmt: function (print, node) {
|
|
16
|
+
var _a;
|
|
17
|
+
return (0, print_utils_1.group)(__spreadArray([
|
|
18
|
+
print.spaced(["createRoleKw", "name", "withKw"])
|
|
19
|
+
], (((_a = node.options) === null || _a === void 0 ? void 0 : _a.length)
|
|
20
|
+
? [(0, print_utils_1.indent)([print_utils_1.line, (0, print_utils_1.join)(print.dynamicLine(), print("options"))])]
|
|
21
|
+
: []), true));
|
|
22
|
+
},
|
|
23
|
+
alter_role_stmt: function (print, node) {
|
|
24
|
+
return (0, print_utils_1.group)([
|
|
25
|
+
(0, print_utils_1.join)(print.dynamicLine(), __spreadArray([
|
|
26
|
+
(0, print_utils_1.group)([print.spaced("alterRoleKw"), (0, print_utils_1.indent)([print_utils_1.line, print("name")])])
|
|
27
|
+
], (node.database ? print(["database"]) : []), true)),
|
|
28
|
+
node.action.type === "alter_action_with_role_options" &&
|
|
29
|
+
!node.action.withKw
|
|
30
|
+
? (0, print_utils_1.indent)([print.dynamicLine(), print("action")])
|
|
31
|
+
: [print.dynamicLine(), print("action")],
|
|
32
|
+
]);
|
|
33
|
+
},
|
|
34
|
+
drop_role_stmt: function (print) {
|
|
35
|
+
return (0, print_utils_1.group)(print.spaced(["dropRoleKw", "ifExistsKw", "names"]));
|
|
36
|
+
},
|
|
37
|
+
set_role_stmt: function (print) {
|
|
38
|
+
return (0, print_utils_1.group)(print.spaced(["setKw", "scopeKw", "roleKw", "name"]));
|
|
39
|
+
},
|
|
40
|
+
reset_role_stmt: function (print) { return (0, print_utils_1.group)(print.spaced("resetRoleKw")); },
|
|
41
|
+
role_option_keyword: function (print) { return print("kw"); },
|
|
42
|
+
role_option_connection_limit: function (print) {
|
|
43
|
+
return (0, print_utils_1.group)(print.spaced(["connectionLimitKw", "limit"]));
|
|
44
|
+
},
|
|
45
|
+
role_option_password: function (print) {
|
|
46
|
+
return (0, print_utils_1.group)(print.spaced(["encryptedKw", "passwordKw", "password"]));
|
|
47
|
+
},
|
|
48
|
+
role_option_valid_until: function (print) {
|
|
49
|
+
return (0, print_utils_1.group)(print.spaced(["validUntilKw", "timestamp"]));
|
|
50
|
+
},
|
|
51
|
+
role_option_in_role: function (print) { return (0, print_utils_1.group)(print.spaced(["inRoleKw", "names"])); },
|
|
52
|
+
role_option_role: function (print) { return (0, print_utils_1.group)(print.spaced(["roleKw", "names"])); },
|
|
53
|
+
role_option_admin: function (print) { return (0, print_utils_1.group)(print.spaced(["adminKw", "names"])); },
|
|
54
|
+
role_option_sysid: function (print) { return (0, print_utils_1.group)(print.spaced(["sysIdKw", "sysId"])); },
|
|
55
|
+
in_database_clause: function (print) { return (0, print_utils_1.group)(print.spaced(["inDatabaseKw", "name"])); },
|
|
56
|
+
};
|
package/dist/syntax/select.js
CHANGED
|
@@ -172,6 +172,7 @@ exports.selectMap = {
|
|
|
172
172
|
group_by_grouping_sets: function (print) {
|
|
173
173
|
return print.spaced(["groupingSetsKw", "columns"]);
|
|
174
174
|
},
|
|
175
|
+
group_by_all: function (print) { return print(["allKw"]); },
|
|
175
176
|
// PARTITION BY clause
|
|
176
177
|
partition_by_clause: function (print) {
|
|
177
178
|
return (0, print_utils_1.group)([
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.transactionMap = void 0;
|
|
4
|
+
var print_utils_1 = require("../print_utils");
|
|
4
5
|
exports.transactionMap = {
|
|
5
|
-
start_transaction_stmt: function (print) {
|
|
6
|
-
return
|
|
6
|
+
start_transaction_stmt: function (print, node) {
|
|
7
|
+
return (0, print_utils_1.group)([
|
|
8
|
+
print.spaced(["startKw", "behaviorKw", "transactionKw"]),
|
|
9
|
+
node.modes ? (0, print_utils_1.indent)([print_utils_1.line, print("modes")]) : [],
|
|
10
|
+
]);
|
|
7
11
|
},
|
|
8
12
|
commit_transaction_stmt: function (print) {
|
|
9
|
-
return print.spaced(["commitKw", "transactionKw"]);
|
|
13
|
+
return print.spaced(["commitKw", "transactionKw", "chain"]);
|
|
10
14
|
},
|
|
11
15
|
rollback_transaction_stmt: function (print) {
|
|
12
|
-
return print.spaced(["rollbackKw", "transactionKw", "savepoint"]);
|
|
16
|
+
return print.spaced(["rollbackKw", "transactionKw", "savepoint", "chain"]);
|
|
13
17
|
},
|
|
14
18
|
rollback_to_savepoint: function (print) {
|
|
15
19
|
return print.spaced(["toKw", "savepointKw", "savepoint"]);
|
|
@@ -18,4 +22,13 @@ exports.transactionMap = {
|
|
|
18
22
|
release_savepoint_stmt: function (print) {
|
|
19
23
|
return print.spaced(["releaseKw", "savepointKw", "savepoint"]);
|
|
20
24
|
},
|
|
25
|
+
transaction_chain_clause: function (print) { return print.spaced("andChainKw"); },
|
|
26
|
+
transaction_no_chain_clause: function (print) { return print.spaced("andNoChainKw"); },
|
|
27
|
+
transaction_mode_isolation_level: function (print) {
|
|
28
|
+
return print.spaced(["isolationLevelKw", "levelKw"]);
|
|
29
|
+
},
|
|
30
|
+
transaction_mode_deferrable: function (print) { return print.spaced("deferrableKw"); },
|
|
31
|
+
transaction_mode_not_deferrable: function (print) { return print.spaced("notDeferrableKw"); },
|
|
32
|
+
transaction_mode_read_only: function (print) { return print.spaced("readOnlyKw"); },
|
|
33
|
+
transaction_mode_read_write: function (print) { return print.spaced("readWriteKw"); },
|
|
21
34
|
};
|
|
@@ -33,6 +33,7 @@ var insert_1 = require("./insert");
|
|
|
33
33
|
var merge_1 = require("./merge");
|
|
34
34
|
var other_clauses_1 = require("./other_clauses");
|
|
35
35
|
var rename_table_1 = require("./rename_table");
|
|
36
|
+
var role_1 = require("./role");
|
|
36
37
|
var prepared_statements_1 = require("./prepared_statements");
|
|
37
38
|
var procedural_language_1 = require("./procedural_language");
|
|
38
39
|
var procedure_1 = require("./procedure");
|
|
@@ -52,4 +53,4 @@ var bigquery_1 = require("./dialects/bigquery");
|
|
|
52
53
|
var mysql_1 = require("./dialects/mysql");
|
|
53
54
|
var sqlite_1 = require("./dialects/sqlite");
|
|
54
55
|
var postgresql_1 = require("./dialects/postgresql");
|
|
55
|
-
exports.transformMap = __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, alias_1.aliasMap), alter_action_1.alterActionMap), alter_table_1.alterTableMap), analyze_1.analyzeMap), base_1.baseMap), constraint_1.constraintMap), create_table_1.createTableMap), data_type_1.dataTypeMap), dcl_1.dclMap), delete_1.deleteMap), domain_1.domainMap), drop_table_1.dropTableMap), explain_1.explainMap), expr_1.exprMap), frame_1.frameMap), function_1.functionMap), index_1.indexMap), insert_1.insertMap), merge_1.mergeMap), other_clauses_1.otherClausesMap), prepared_statements_1.preparedStatementsMap), proc_clause_1.procClauseMap), procedural_language_1.proceduralLanguageMap), procedure_1.procedureMap), program_1.programMap), rename_table_1.renameTableMap), schema_1.schemaMap), select_1.selectMap), sequence_1.sequenceMap), transaction_1.transactionMap), trigger_1.triggerMap), truncate_1.truncateMap), type_1.typeMap), unsupported_grammar_1.unsupportedGrammarMap), update_1.updateMap), view_1.viewMap), bigquery_1.bigqueryMap), mysql_1.mysqlMap), postgresql_1.postgresqlMap), sqlite_1.sqliteMap);
|
|
56
|
+
exports.transformMap = __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, alias_1.aliasMap), alter_action_1.alterActionMap), alter_table_1.alterTableMap), analyze_1.analyzeMap), base_1.baseMap), constraint_1.constraintMap), create_table_1.createTableMap), data_type_1.dataTypeMap), dcl_1.dclMap), delete_1.deleteMap), domain_1.domainMap), drop_table_1.dropTableMap), explain_1.explainMap), expr_1.exprMap), frame_1.frameMap), function_1.functionMap), index_1.indexMap), insert_1.insertMap), merge_1.mergeMap), other_clauses_1.otherClausesMap), prepared_statements_1.preparedStatementsMap), proc_clause_1.procClauseMap), procedural_language_1.proceduralLanguageMap), procedure_1.procedureMap), program_1.programMap), rename_table_1.renameTableMap), role_1.roleMap), schema_1.schemaMap), select_1.selectMap), sequence_1.sequenceMap), transaction_1.transactionMap), trigger_1.triggerMap), truncate_1.truncateMap), type_1.typeMap), unsupported_grammar_1.unsupportedGrammarMap), update_1.updateMap), view_1.viewMap), bigquery_1.bigqueryMap), mysql_1.mysqlMap), postgresql_1.postgresqlMap), sqlite_1.sqliteMap);
|
package/dist/syntax/trigger.js
CHANGED
|
@@ -58,7 +58,19 @@ exports.triggerMap = {
|
|
|
58
58
|
trigger_transition: function (print) { return [
|
|
59
59
|
print.spaced(["oldOrNewKw", "rowOrTableKw", "asKw", "name"]),
|
|
60
60
|
]; },
|
|
61
|
+
alter_trigger_stmt: function (print) {
|
|
62
|
+
return (0, print_utils_1.group)((0, print_utils_1.join)(print.dynamicLine(), [
|
|
63
|
+
print.spaced(["alterTriggerKw", "trigger", "target"]),
|
|
64
|
+
print("action"),
|
|
65
|
+
]));
|
|
66
|
+
},
|
|
61
67
|
drop_trigger_stmt: function (print) {
|
|
62
|
-
return print.spaced([
|
|
68
|
+
return print.spaced([
|
|
69
|
+
"dropTriggerKw",
|
|
70
|
+
"ifExistsKw",
|
|
71
|
+
"trigger",
|
|
72
|
+
"target",
|
|
73
|
+
"behaviorKw",
|
|
74
|
+
]);
|
|
63
75
|
},
|
|
64
76
|
};
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prettier-plugin-sql-cst",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.2",
|
|
4
4
|
"description": "Prettier plugin for SQL",
|
|
5
5
|
"contributors": [
|
|
6
|
+
"Barna Magyarkuti <bmagyarkuti@gmail.com>",
|
|
6
7
|
"Bowen Parnell <bparnell@4tel.com.au>",
|
|
7
8
|
"Rene Saarsoo <nene@triin.net>"
|
|
8
9
|
],
|
|
@@ -36,7 +37,7 @@
|
|
|
36
37
|
],
|
|
37
38
|
"dependencies": {
|
|
38
39
|
"prettier": "^3.0.3",
|
|
39
|
-
"sql-parser-cst": "^0.
|
|
40
|
+
"sql-parser-cst": "^0.32.0"
|
|
40
41
|
},
|
|
41
42
|
"devDependencies": {
|
|
42
43
|
"@types/jest": "^29.2.5",
|