prettier-plugin-sql-cst 0.18.0 → 0.19.1
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 +2 -2
- package/dist/CstToDocMap.js +1 -2
- package/dist/PrintFn.js +1 -2
- package/dist/embed.js +5 -13
- package/dist/embedJs.js +28 -84
- package/dist/embedJson.js +29 -85
- package/dist/embedSql.js +26 -76
- package/dist/index.js +28 -34
- package/dist/node_utils.d.ts +1 -0
- package/dist/node_utils.js +44 -54
- package/dist/options.js +1 -4
- package/dist/printComment.js +2 -6
- package/dist/printSql.js +29 -39
- package/dist/print_utils.js +19 -38
- package/dist/syntax/alias.js +2 -5
- package/dist/syntax/alter_action.js +115 -208
- package/dist/syntax/alter_table.js +18 -27
- package/dist/syntax/analyze.js +3 -8
- package/dist/syntax/base.js +6 -9
- package/dist/syntax/cast.js +3 -6
- package/dist/syntax/comment.js +53 -122
- package/dist/syntax/constraint.d.ts +1 -1
- package/dist/syntax/constraint.js +54 -90
- package/dist/syntax/create_table.js +49 -87
- package/dist/syntax/data_type.js +25 -44
- package/dist/syntax/dcl.js +78 -136
- package/dist/syntax/delete.js +4 -9
- package/dist/syntax/dialects/bigquery.js +70 -116
- package/dist/syntax/dialects/mysql.js +2 -5
- package/dist/syntax/dialects/postgresql.js +8 -13
- package/dist/syntax/dialects/sqlite.js +8 -17
- package/dist/syntax/do.js +3 -6
- package/dist/syntax/domain.js +10 -19
- package/dist/syntax/drop_table.js +10 -15
- package/dist/syntax/explain.js +6 -11
- package/dist/syntax/expr.js +124 -173
- package/dist/syntax/extension.js +12 -21
- package/dist/syntax/frame.js +11 -16
- package/dist/syntax/function.js +53 -63
- package/dist/syntax/index.js +54 -81
- package/dist/syntax/insert.js +32 -49
- package/dist/syntax/merge.js +25 -30
- package/dist/syntax/other_clauses.js +5 -14
- package/dist/syntax/parameter.js +13 -26
- package/dist/syntax/policy.js +26 -41
- package/dist/syntax/prepared_statements.js +23 -43
- package/dist/syntax/proc_clause.js +10 -15
- package/dist/syntax/procedural_language.js +80 -111
- package/dist/syntax/procedure.js +36 -40
- package/dist/syntax/program.js +15 -22
- package/dist/syntax/publication.js +26 -47
- package/dist/syntax/rename_table.js +7 -12
- package/dist/syntax/role.js +30 -55
- package/dist/syntax/schema.js +17 -35
- package/dist/syntax/select.js +157 -226
- package/dist/syntax/sequence.js +35 -52
- package/dist/syntax/subscription.js +9 -24
- package/dist/syntax/transaction.js +18 -33
- package/dist/syntax/transformMap.js +99 -63
- package/dist/syntax/trigger.js +48 -72
- package/dist/syntax/truncate.js +9 -14
- package/dist/syntax/type.js +11 -22
- package/dist/syntax/unsupported_grammar.js +3 -6
- package/dist/syntax/update.js +7 -14
- package/dist/syntax/view.js +32 -43
- package/dist/transform/addFinalSemicolon.js +5 -9
- package/dist/transform/aliasAs.js +4 -8
- package/dist/transform/canonicKeywords.js +16 -20
- package/dist/transform/canonicOperators.js +8 -12
- package/dist/transform/comments.js +10 -31
- package/dist/transform/stripTrailingCommas.js +7 -11
- package/dist/transform/transformCst.js +13 -17
- package/dist/transform/transformUtils.js +2 -6
- package/dist/utils.js +9 -30
- package/dist/visitAllNodes.js +8 -13
- package/package.json +9 -8
package/dist/syntax/dcl.js
CHANGED
|
@@ -1,141 +1,83 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
]
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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)([
|
|
1
|
+
import { group, indent, join, line } from "../print_utils";
|
|
2
|
+
export const dclMap = {
|
|
3
|
+
grant_privilege_stmt: (print) => group(join(print.dynamicLine(), [
|
|
4
|
+
group([print("grantKw"), indent([line, print("privileges")])]),
|
|
5
|
+
group(print.spaced(["onKw", "resource"])),
|
|
6
|
+
group([print("toKw"), indent([line, print("roles")])]),
|
|
7
|
+
...print("clauses"),
|
|
8
|
+
])),
|
|
9
|
+
grant_role_stmt: (print) => group(join(print.dynamicLine(), [
|
|
10
|
+
group(join(line, [
|
|
11
|
+
group([print("grantKw"), indent([line, print("grantedRoles")])]),
|
|
12
|
+
group([print("toKw"), indent([line, print("granteeRoles")])]),
|
|
13
|
+
])),
|
|
14
|
+
...print("clauses"),
|
|
15
|
+
])),
|
|
16
|
+
revoke_privilege_stmt: (print) => group(join(print.dynamicLine(), [
|
|
17
|
+
group([
|
|
18
|
+
print.spaced(["revokeKw", "option"]),
|
|
19
|
+
indent([line, print("privileges")]),
|
|
20
|
+
]),
|
|
21
|
+
group(print.spaced(["onKw", "resource"])),
|
|
22
|
+
group([print("fromKw"), indent([line, print("roles")])]),
|
|
23
|
+
...print(["grantedBy", "behaviorKw"]),
|
|
24
|
+
])),
|
|
25
|
+
revoke_role_stmt: (print) => group(join(print.dynamicLine(), [
|
|
26
|
+
group(join(line, [
|
|
27
|
+
group([
|
|
33
28
|
print.spaced(["revokeKw", "option"]),
|
|
34
|
-
|
|
29
|
+
indent([line, print("grantedRoles")]),
|
|
35
30
|
]),
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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"]));
|
|
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"])); },
|
|
107
|
-
alter_default_privileges_stmt: function (print) {
|
|
108
|
-
return (0, print_utils_1.group)((0, print_utils_1.join)(print.dynamicLine(), __spreadArray(__spreadArray([
|
|
109
|
-
print.spaced("alterDefaultPrivilegesKw")
|
|
110
|
-
], print("clauses"), true), [
|
|
111
|
-
print("action"),
|
|
112
|
-
], false)));
|
|
113
|
-
},
|
|
114
|
-
default_acl_for_role_clause: function (print) {
|
|
115
|
-
return (0, print_utils_1.group)(print.spaced(["forKw", "roleKw", "roles"]));
|
|
116
|
-
},
|
|
117
|
-
default_acl_in_schema_clause: function (print) {
|
|
118
|
-
return (0, print_utils_1.group)(print.spaced(["inKw", "schemaKw", "schemas"]));
|
|
119
|
-
},
|
|
120
|
-
grant_default_privileges_action: function (print) {
|
|
121
|
-
return (0, print_utils_1.group)((0, print_utils_1.join)(print_utils_1.line, [
|
|
122
|
-
(0, print_utils_1.group)(print.spaced(["grantKw", "privileges", "onKw", "resourcesKw"])),
|
|
123
|
-
(0, print_utils_1.group)(print.spaced(["toKw", "roles", "withGrantOption"])),
|
|
124
|
-
]));
|
|
125
|
-
},
|
|
126
|
-
revoke_default_privileges_action: function (print) {
|
|
127
|
-
return (0, print_utils_1.group)((0, print_utils_1.join)(print_utils_1.line, [
|
|
128
|
-
(0, print_utils_1.group)([
|
|
129
|
-
print.spaced(["revokeKw", "grantOptionFor"]),
|
|
130
|
-
(0, print_utils_1.indent)([
|
|
131
|
-
print_utils_1.line,
|
|
132
|
-
(0, print_utils_1.join)(print_utils_1.line, [
|
|
133
|
-
(0, print_utils_1.group)(print("privileges")),
|
|
134
|
-
print.spaced(["onKw", "resourcesKw"]),
|
|
135
|
-
]),
|
|
31
|
+
group([print("fromKw"), indent([line, print("granteeRoles")])]),
|
|
32
|
+
])),
|
|
33
|
+
...print(["grantedBy", "behaviorKw"]),
|
|
34
|
+
])),
|
|
35
|
+
privilege: (print) => print.spaced(["privilegeKw", "columns"]),
|
|
36
|
+
all_privileges: (print) => print.spaced(["allKw", "privilegesKw", "columns"]),
|
|
37
|
+
grant_resource_table: (print) => group(print.spaced(["tableKw", "tables"])),
|
|
38
|
+
grant_resource_view: (print) => group(print.spaced(["viewKw", "views"])),
|
|
39
|
+
grant_resource_schema: (print) => group(print.spaced(["schemaKw", "schemas"])),
|
|
40
|
+
grant_resource_sequence: (print) => group(print.spaced(["sequenceKw", "sequences"])),
|
|
41
|
+
grant_resource_database: (print) => group(print.spaced(["databaseKw", "databases"])),
|
|
42
|
+
grant_resource_domain: (print) => group(print.spaced(["domainKw", "domains"])),
|
|
43
|
+
grant_resource_foreign_data_wrapper: (print) => group(print.spaced(["foreignDataWrapperKw", "dataWrappers"])),
|
|
44
|
+
grant_resource_foreign_server: (print) => group(print.spaced(["foreignServerKw", "servers"])),
|
|
45
|
+
grant_resource_function: (print) => group(print.spaced(["functionKw", "functions"])),
|
|
46
|
+
grant_resource_language: (print) => group(print.spaced(["languageKw", "languages"])),
|
|
47
|
+
grant_resource_large_object: (print) => group(print.spaced(["largeObjectKw", "oids"])),
|
|
48
|
+
grant_resource_postgresql_option: (print) => group(print.spaced(["parameterKw", "options"])),
|
|
49
|
+
grant_resource_tablespace: (print) => group(print.spaced(["tablespaceKw", "tablespaces"])),
|
|
50
|
+
grant_resource_type: (print) => group(print.spaced(["typeKw", "types"])),
|
|
51
|
+
grant_resource_all_tables_in_schema: (print) => group(print.spaced(["allTablesInSchemaKw", "schemas"])),
|
|
52
|
+
grant_resource_all_sequences_in_schema: (print) => group(print.spaced(["allSequencesInSchemaKw", "schemas"])),
|
|
53
|
+
grant_resource_all_functions_in_schema: (print) => group(print.spaced(["allFunctionsInSchemaKw", "schemas"])),
|
|
54
|
+
with_grant_option_clause: (print) => group(print.spaced(["withKw", "nameKw", "value"])),
|
|
55
|
+
grant_option_for_clause: (print) => group(print.spaced(["nameKw", "optionForKw"])),
|
|
56
|
+
granted_by_clause: (print) => group(print.spaced(["grantedByKw", "role"])),
|
|
57
|
+
grantee_public: (print) => print("publicKw"),
|
|
58
|
+
grantee_group: (print) => group(print.spaced(["groupKw", "name"])),
|
|
59
|
+
alter_default_privileges_stmt: (print) => group(join(print.dynamicLine(), [
|
|
60
|
+
print.spaced("alterDefaultPrivilegesKw"),
|
|
61
|
+
...print("clauses"),
|
|
62
|
+
print("action"),
|
|
63
|
+
])),
|
|
64
|
+
default_acl_for_role_clause: (print) => group(print.spaced(["forKw", "roleKw", "roles"])),
|
|
65
|
+
default_acl_in_schema_clause: (print) => group(print.spaced(["inKw", "schemaKw", "schemas"])),
|
|
66
|
+
grant_default_privileges_action: (print) => group(join(line, [
|
|
67
|
+
group(print.spaced(["grantKw", "privileges", "onKw", "resourcesKw"])),
|
|
68
|
+
group(print.spaced(["toKw", "roles", "withGrantOption"])),
|
|
69
|
+
])),
|
|
70
|
+
revoke_default_privileges_action: (print) => group(join(line, [
|
|
71
|
+
group([
|
|
72
|
+
print.spaced(["revokeKw", "grantOptionFor"]),
|
|
73
|
+
indent([
|
|
74
|
+
line,
|
|
75
|
+
join(line, [
|
|
76
|
+
group(print("privileges")),
|
|
77
|
+
print.spaced(["onKw", "resourcesKw"]),
|
|
136
78
|
]),
|
|
137
79
|
]),
|
|
138
|
-
|
|
139
|
-
]))
|
|
140
|
-
|
|
80
|
+
]),
|
|
81
|
+
group(print.spaced(["fromKw", "roles", "behaviorKw"])),
|
|
82
|
+
])),
|
|
141
83
|
};
|
package/dist/syntax/delete.js
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
exports.deleteMap = {
|
|
6
|
-
delete_stmt: function (print) { return (0, print_utils_1.group)((0, print_utils_1.join)(print.dynamicLine(), print("clauses"))); },
|
|
7
|
-
delete_clause: function (print) {
|
|
8
|
-
return print.spaced(["deleteKw", "modifiers", "fromKw", "tables"]);
|
|
9
|
-
},
|
|
1
|
+
import { group, join } from "../print_utils";
|
|
2
|
+
export const deleteMap = {
|
|
3
|
+
delete_stmt: (print) => group(join(print.dynamicLine(), print("clauses"))),
|
|
4
|
+
delete_clause: (print) => print.spaced(["deleteKw", "modifiers", "fromKw", "tables"]),
|
|
10
5
|
};
|
|
@@ -1,130 +1,84 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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.bigqueryMap = void 0;
|
|
13
|
-
var print_utils_1 = require("../../print_utils");
|
|
14
|
-
exports.bigqueryMap = {
|
|
15
|
-
bigquery_options: function (print) { return print.spaced(["optionsKw", "options"]); },
|
|
16
|
-
bigquery_option_default_collate: function (print) {
|
|
17
|
-
return print.spaced(["defaultCollateKw", "collation"]);
|
|
18
|
-
},
|
|
1
|
+
import { group, hardline, join } from "../../print_utils";
|
|
2
|
+
export const bigqueryMap = {
|
|
3
|
+
bigquery_options: (print) => print.spaced(["optionsKw", "options"]),
|
|
4
|
+
bigquery_option_default_collate: (print) => print.spaced(["defaultCollateKw", "collation"]),
|
|
19
5
|
// ROW ACCESS POLICY
|
|
20
|
-
create_row_access_policy_stmt:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"orReplaceKw",
|
|
25
|
-
"rowAccessPolicyKw",
|
|
26
|
-
"ifNotExistsKw",
|
|
27
|
-
"name",
|
|
28
|
-
"onKw",
|
|
29
|
-
"table",
|
|
30
|
-
])
|
|
31
|
-
], print("clauses"), true)));
|
|
32
|
-
},
|
|
33
|
-
row_access_policy_grant_clause: function (print) {
|
|
34
|
-
return print.spaced(["grantToKw", "grantees"]);
|
|
35
|
-
},
|
|
36
|
-
row_access_policy_filter_clause: function (print) {
|
|
37
|
-
return print.spaced(["filterUsingKw", "expr"]);
|
|
38
|
-
},
|
|
39
|
-
drop_row_access_policy_stmt: function (print) {
|
|
40
|
-
return (0, print_utils_1.group)(print.spaced([
|
|
41
|
-
"dropKw",
|
|
42
|
-
"allKw",
|
|
6
|
+
create_row_access_policy_stmt: (print) => group(join(hardline, [
|
|
7
|
+
print.spaced([
|
|
8
|
+
"createKw",
|
|
9
|
+
"orReplaceKw",
|
|
43
10
|
"rowAccessPolicyKw",
|
|
44
|
-
"
|
|
11
|
+
"ifNotExistsKw",
|
|
45
12
|
"name",
|
|
46
13
|
"onKw",
|
|
47
14
|
"table",
|
|
48
|
-
])
|
|
49
|
-
|
|
15
|
+
]),
|
|
16
|
+
...print("clauses"),
|
|
17
|
+
])),
|
|
18
|
+
row_access_policy_grant_clause: (print) => print.spaced(["grantToKw", "grantees"]),
|
|
19
|
+
row_access_policy_filter_clause: (print) => print.spaced(["filterUsingKw", "expr"]),
|
|
20
|
+
drop_row_access_policy_stmt: (print) => group(print.spaced([
|
|
21
|
+
"dropKw",
|
|
22
|
+
"allKw",
|
|
23
|
+
"rowAccessPolicyKw",
|
|
24
|
+
"ifExistsKw",
|
|
25
|
+
"name",
|
|
26
|
+
"onKw",
|
|
27
|
+
"table",
|
|
28
|
+
])),
|
|
50
29
|
// CAPACITY
|
|
51
|
-
create_capacity_stmt:
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
},
|
|
58
|
-
drop_capacity_stmt: function (print) {
|
|
59
|
-
return (0, print_utils_1.group)(print.spaced(["dropKw", "capacityKw", "ifExistsKw", "name"]));
|
|
60
|
-
},
|
|
30
|
+
create_capacity_stmt: (print) => group([
|
|
31
|
+
print.spaced(["createKw", "capacityKw", "name"]),
|
|
32
|
+
hardline,
|
|
33
|
+
print("options"),
|
|
34
|
+
]),
|
|
35
|
+
drop_capacity_stmt: (print) => group(print.spaced(["dropKw", "capacityKw", "ifExistsKw", "name"])),
|
|
61
36
|
// RESERVATION
|
|
62
|
-
create_reservation_stmt:
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
},
|
|
69
|
-
drop_reservation_stmt: function (print) {
|
|
70
|
-
return (0, print_utils_1.group)(print.spaced(["dropKw", "reservationKw", "ifExistsKw", "name"]));
|
|
71
|
-
},
|
|
37
|
+
create_reservation_stmt: (print) => group([
|
|
38
|
+
print.spaced(["createKw", "reservationKw", "name"]),
|
|
39
|
+
hardline,
|
|
40
|
+
print("options"),
|
|
41
|
+
]),
|
|
42
|
+
drop_reservation_stmt: (print) => group(print.spaced(["dropKw", "reservationKw", "ifExistsKw", "name"])),
|
|
72
43
|
// ASSIGNMENT
|
|
73
|
-
create_assignment_stmt:
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
},
|
|
80
|
-
drop_assignment_stmt: function (print) {
|
|
81
|
-
return (0, print_utils_1.group)(print.spaced(["dropKw", "assignmentKw", "ifExistsKw", "name"]));
|
|
82
|
-
},
|
|
44
|
+
create_assignment_stmt: (print) => group([
|
|
45
|
+
print.spaced(["createKw", "assignmentKw", "name"]),
|
|
46
|
+
hardline,
|
|
47
|
+
print("options"),
|
|
48
|
+
]),
|
|
49
|
+
drop_assignment_stmt: (print) => group(print.spaced(["dropKw", "assignmentKw", "ifExistsKw", "name"])),
|
|
83
50
|
// ALTER ORGANIZATION
|
|
84
|
-
alter_organization_stmt:
|
|
85
|
-
return (0, print_utils_1.group)((0, print_utils_1.join)(print_utils_1.hardline, [print.spaced("alterOrganizationKw"), print("actions")]));
|
|
86
|
-
},
|
|
51
|
+
alter_organization_stmt: (print) => group(join(hardline, [print.spaced("alterOrganizationKw"), print("actions")])),
|
|
87
52
|
// ALTER PROJECT
|
|
88
|
-
alter_project_stmt:
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
]));
|
|
105
|
-
},
|
|
106
|
-
alter_reservation_stmt: function (print) {
|
|
107
|
-
return (0, print_utils_1.group)((0, print_utils_1.join)(print_utils_1.hardline, [
|
|
108
|
-
print.spaced(["alterReservationKw", "name"]),
|
|
109
|
-
print("actions"),
|
|
110
|
-
]));
|
|
111
|
-
},
|
|
53
|
+
alter_project_stmt: (print) => group(join(hardline, [
|
|
54
|
+
print.spaced(["alterProjectKw", "name"]),
|
|
55
|
+
print("actions"),
|
|
56
|
+
])),
|
|
57
|
+
alter_bi_capacity_stmt: (print) => group(join(hardline, [
|
|
58
|
+
print.spaced(["alterBiCapacityKw", "name"]),
|
|
59
|
+
print("actions"),
|
|
60
|
+
])),
|
|
61
|
+
alter_capacity_stmt: (print) => group(join(hardline, [
|
|
62
|
+
print.spaced(["alterCapacityKw", "name"]),
|
|
63
|
+
print("actions"),
|
|
64
|
+
])),
|
|
65
|
+
alter_reservation_stmt: (print) => group(join(hardline, [
|
|
66
|
+
print.spaced(["alterReservationKw", "name"]),
|
|
67
|
+
print("actions"),
|
|
68
|
+
])),
|
|
112
69
|
// ASSERT
|
|
113
|
-
assert_stmt:
|
|
70
|
+
assert_stmt: (print) => group(print.spaced(["assertKw", "expr", "as"])),
|
|
114
71
|
// EXPORT
|
|
115
|
-
export_data_stmt:
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
], false)));
|
|
122
|
-
},
|
|
72
|
+
export_data_stmt: (print) => group(join(hardline, [
|
|
73
|
+
print.spaced("exportDataKw"),
|
|
74
|
+
...print.spaced(["withConnection"]),
|
|
75
|
+
print.spaced("options"),
|
|
76
|
+
print.spaced("as"),
|
|
77
|
+
])),
|
|
123
78
|
// LOAD
|
|
124
|
-
load_data_stmt:
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
from_files_options: function (print) { return print.spaced(["fromFilesKw", "options"]); },
|
|
79
|
+
load_data_stmt: (print) => group(join(hardline, [
|
|
80
|
+
print.spaced(["loadDataKw", "intoKw", "table", "columns"]),
|
|
81
|
+
...print("clauses"),
|
|
82
|
+
])),
|
|
83
|
+
from_files_options: (print) => print.spaced(["fromFilesKw", "options"]),
|
|
130
84
|
};
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.mysqlMap = void 0;
|
|
4
|
-
exports.mysqlMap = {
|
|
5
|
-
mysql_modifier: function (print) { return print.spaced("modifierKw"); },
|
|
1
|
+
export const mysqlMap = {
|
|
2
|
+
mysql_modifier: (print) => print.spaced("modifierKw"),
|
|
6
3
|
};
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
postgresql_with_options: function (print) {
|
|
10
|
-
return (0, print_utils_1.group)(print.spaced(["withKw", "options"]));
|
|
11
|
-
},
|
|
12
|
-
postgresql_options: function (print) { return print.spaced(["optionsKw", "options"]); },
|
|
13
|
-
postgresql_option_element: function (print) { return print.spaced(["name", "value"]); },
|
|
1
|
+
import { group } from "../../print_utils";
|
|
2
|
+
export const postgresqlMap = {
|
|
3
|
+
postgresql_operator_expr: (print) => print(["operatorKw", "expr"]),
|
|
4
|
+
postgresql_operator: (print) => print("operator"),
|
|
5
|
+
postgresql_operator_class: (print) => print.spaced(["name", "options"]),
|
|
6
|
+
postgresql_with_options: (print) => group(print.spaced(["withKw", "options"])),
|
|
7
|
+
postgresql_options: (print) => print.spaced(["optionsKw", "options"]),
|
|
8
|
+
postgresql_option_element: (print) => print.spaced(["name", "value"]),
|
|
14
9
|
};
|
|
@@ -1,18 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
detach_database_stmt: function (print) {
|
|
10
|
-
return (0, print_utils_1.group)(print.spaced(["detachKw", "databaseKw", "schema"]));
|
|
11
|
-
},
|
|
12
|
-
vacuum_stmt: function (print) {
|
|
13
|
-
return (0, print_utils_1.group)(print.spaced(["vacuumKw", "schema", "intoKw", "file"]));
|
|
14
|
-
},
|
|
15
|
-
pragma_stmt: function (print) { return (0, print_utils_1.group)(print.spaced(["pragmaKw", "pragma"])); },
|
|
16
|
-
pragma_assignment: function (print) { return (0, print_utils_1.join)(" = ", print(["name", "value"])); },
|
|
17
|
-
pragma_func_call: function (print) { return print(["name", "args"]); },
|
|
1
|
+
import { group, join } from "../../print_utils";
|
|
2
|
+
export const sqliteMap = {
|
|
3
|
+
attach_database_stmt: (print) => group(print.spaced(["attachKw", "databaseKw", "file", "asKw", "schema"])),
|
|
4
|
+
detach_database_stmt: (print) => group(print.spaced(["detachKw", "databaseKw", "schema"])),
|
|
5
|
+
vacuum_stmt: (print) => group(print.spaced(["vacuumKw", "schema", "intoKw", "file"])),
|
|
6
|
+
pragma_stmt: (print) => group(print.spaced(["pragmaKw", "pragma"])),
|
|
7
|
+
pragma_assignment: (print) => join(" = ", print(["name", "value"])),
|
|
8
|
+
pragma_func_call: (print) => print(["name", "args"]),
|
|
18
9
|
};
|
package/dist/syntax/do.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var print_utils_1 = require("../print_utils");
|
|
5
|
-
exports.doMap = {
|
|
6
|
-
do_stmt: function (print) { return (0, print_utils_1.group)(print.spaced(["doKw", "language", "body"])); },
|
|
1
|
+
import { group } from "../print_utils";
|
|
2
|
+
export const doMap = {
|
|
3
|
+
do_stmt: (print) => group(print.spaced(["doKw", "language", "body"])),
|
|
7
4
|
};
|
package/dist/syntax/domain.js
CHANGED
|
@@ -1,20 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
: [],
|
|
12
|
-
]);
|
|
13
|
-
},
|
|
14
|
-
alter_domain_stmt: function (print) {
|
|
15
|
-
return (0, print_utils_1.group)(print.spaced(["alterDomainKw", "name", "action"]));
|
|
16
|
-
},
|
|
17
|
-
drop_domain_stmt: function (print) {
|
|
18
|
-
return (0, print_utils_1.group)(print.spaced(["dropDomainKw", "ifExistsKw", "domains", "behaviorKw"]));
|
|
19
|
-
},
|
|
1
|
+
import { group, line, indent, join } from "../print_utils";
|
|
2
|
+
export const domainMap = {
|
|
3
|
+
create_domain_stmt: (print, node) => group([
|
|
4
|
+
print.spaced(["createDomainKw", "name", "asKw", "dataType"]),
|
|
5
|
+
node.constraints.length > 0
|
|
6
|
+
? indent([print.dynamicLine(), join(line, print("constraints"))])
|
|
7
|
+
: [],
|
|
8
|
+
]),
|
|
9
|
+
alter_domain_stmt: (print) => group(print.spaced(["alterDomainKw", "name", "action"])),
|
|
10
|
+
drop_domain_stmt: (print) => group(print.spaced(["dropDomainKw", "ifExistsKw", "domains", "behaviorKw"])),
|
|
20
11
|
};
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"ifExistsKw",
|
|
12
|
-
"tables",
|
|
13
|
-
"behaviorKw",
|
|
14
|
-
]));
|
|
15
|
-
},
|
|
1
|
+
import { group } from "../print_utils";
|
|
2
|
+
export const dropTableMap = {
|
|
3
|
+
drop_table_stmt: (print) => group(print.spaced([
|
|
4
|
+
"dropKw",
|
|
5
|
+
"kind",
|
|
6
|
+
"tableKw",
|
|
7
|
+
"ifExistsKw",
|
|
8
|
+
"tables",
|
|
9
|
+
"behaviorKw",
|
|
10
|
+
])),
|
|
16
11
|
};
|
package/dist/syntax/explain.js
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return (0, print_utils_1.group)([
|
|
8
|
-
print.spaced(["explainKw", "analyzeKw", "queryPlanKw"]),
|
|
9
|
-
(0, print_utils_1.indent)([print_utils_1.line, print("statement")]),
|
|
10
|
-
]);
|
|
11
|
-
},
|
|
1
|
+
import { group, indent, line } from "../print_utils";
|
|
2
|
+
export const explainMap = {
|
|
3
|
+
explain_stmt: (print) => group([
|
|
4
|
+
print.spaced(["explainKw", "analyzeKw", "queryPlanKw"]),
|
|
5
|
+
indent([line, print("statement")]),
|
|
6
|
+
]),
|
|
12
7
|
};
|