Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

prettier-plugin-sql-cst

Package Overview
Dependencies
Maintainers
0
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prettier-plugin-sql-cst - npm Package Compare versions

Comparing version 0.12.0 to 0.12.1

dist/syntax/role.d.ts

19

dist/syntax/alter_action.js

@@ -180,2 +180,21 @@ "use strict";

},
alter_action_with_role_options: function (print, node) {
return node.withKw
? (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"))])])
: // This works in tandem with the logic inside alter_role_stmt
(0, print_utils_1.group)((0, print_utils_1.join)(print_utils_1.line, print("options")));
},
alter_action_set_postgresql_option: function (print) {
return print.spaced(["setKw", "name", "operator", "value"]);
},
alter_action_set_postgresql_option_from_current: function (print) {
return print.spaced(["setKw", "name", "fromCurrentKw"]);
},
alter_action_reset_postgresql_option: function (print) {
return print.spaced(["resetKw", "name"]);
},
alter_action_add_user: function (print) { return (0, print_utils_1.group)(print.spaced(["addUserKw", "users"])); },
alter_action_drop_user: function (print) {
return (0, print_utils_1.group)(print.spaced(["dropUserKw", "users"]));
},
// ENABLE/DISABLE ..

@@ -182,0 +201,0 @@ toggle_trigger: function (print) { return print.spaced(["triggerKw", "name"]); },

4

dist/syntax/dcl.d.ts

@@ -1,3 +0,3 @@

import { AllDclStatements } from "sql-parser-cst";
import { AllDclNodes } from "sql-parser-cst";
import { CstToDocMap } from "../CstToDocMap";
export declare const dclMap: CstToDocMap<AllDclStatements>;
export declare const dclMap: CstToDocMap<AllDclNodes>;
"use strict";
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -6,16 +15,94 @@ exports.dclMap = void 0;

exports.dclMap = {
grant_stmt: function (print) {
return (0, print_utils_1.group)((0, print_utils_1.join)(print.dynamicLine(), [
(0, print_utils_1.group)([print("grantKw"), (0, print_utils_1.indent)([print_utils_1.line, print("roles")])]),
(0, print_utils_1.group)(print.spaced(["onKw", "resourceType", "resourceName"])),
(0, print_utils_1.group)([print("toKw"), (0, print_utils_1.indent)([print_utils_1.line, print("users")])]),
]));
grant_privilege_stmt: function (print) {
return (0, print_utils_1.group)((0, print_utils_1.join)(print.dynamicLine(), __spreadArray([
(0, print_utils_1.group)([print("grantKw"), (0, print_utils_1.indent)([print_utils_1.line, print("privileges")])]),
(0, print_utils_1.group)(print.spaced(["onKw", "resource"])),
(0, print_utils_1.group)([print("toKw"), (0, print_utils_1.indent)([print_utils_1.line, print("roles")])])
], print("clauses"), true)));
},
revoke_stmt: function (print) {
return (0, print_utils_1.group)((0, print_utils_1.join)(print.dynamicLine(), [
(0, print_utils_1.group)([print("revokeKw"), (0, print_utils_1.indent)([print_utils_1.line, print("roles")])]),
(0, print_utils_1.group)(print.spaced(["onKw", "resourceType", "resourceName"])),
(0, print_utils_1.group)([print("fromKw"), (0, print_utils_1.indent)([print_utils_1.line, print("users")])]),
]));
grant_role_stmt: function (print) {
return (0, print_utils_1.group)((0, print_utils_1.join)(print.dynamicLine(), __spreadArray([
(0, print_utils_1.group)((0, print_utils_1.join)(print_utils_1.line, [
(0, print_utils_1.group)([print("grantKw"), (0, print_utils_1.indent)([print_utils_1.line, print("grantedRoles")])]),
(0, print_utils_1.group)([print("toKw"), (0, print_utils_1.indent)([print_utils_1.line, print("granteeRoles")])]),
]))
], print("clauses"), true)));
},
revoke_privilege_stmt: function (print) {
return (0, print_utils_1.group)((0, print_utils_1.join)(print.dynamicLine(), __spreadArray([
(0, print_utils_1.group)([
print.spaced(["revokeKw", "option"]),
(0, print_utils_1.indent)([print_utils_1.line, print("privileges")]),
]),
(0, print_utils_1.group)(print.spaced(["onKw", "resource"])),
(0, print_utils_1.group)([print("fromKw"), (0, print_utils_1.indent)([print_utils_1.line, print("roles")])])
], print(["grantedBy", "behaviorKw"]), true)));
},
revoke_role_stmt: function (print) {
return (0, print_utils_1.group)((0, print_utils_1.join)(print.dynamicLine(), __spreadArray([
(0, print_utils_1.group)((0, print_utils_1.join)(print_utils_1.line, [
(0, print_utils_1.group)([
print.spaced(["revokeKw", "option"]),
(0, print_utils_1.indent)([print_utils_1.line, print("grantedRoles")]),
]),
(0, print_utils_1.group)([print("fromKw"), (0, print_utils_1.indent)([print_utils_1.line, print("granteeRoles")])]),
]))
], print(["grantedBy", "behaviorKw"]), true)));
},
privilege: function (print) { return print.spaced(["privilegeKw", "columns"]); },
all_privileges: function (print) { return print.spaced(["allKw", "privilegesKw", "columns"]); },
grant_resource_table: function (print) { return (0, print_utils_1.group)(print.spaced(["tableKw", "tables"])); },
grant_resource_view: function (print) { return (0, print_utils_1.group)(print.spaced(["viewKw", "views"])); },
grant_resource_schema: function (print) {
return (0, print_utils_1.group)(print.spaced(["schemaKw", "schemas"]));
},
grant_resource_sequence: function (print) {
return (0, print_utils_1.group)(print.spaced(["sequenceKw", "sequences"]));
},
grant_resource_database: function (print) {
return (0, print_utils_1.group)(print.spaced(["databaseKw", "databases"]));
},
grant_resource_domain: function (print) {
return (0, print_utils_1.group)(print.spaced(["domainKw", "domains"]));
},
grant_resource_foreign_data_wrapper: function (print) {
return (0, print_utils_1.group)(print.spaced(["foreignDataWrapperKw", "dataWrappers"]));
},
grant_resource_foreign_server: function (print) {
return (0, print_utils_1.group)(print.spaced(["foreignServerKw", "servers"]));
},
grant_resource_function: function (print) {
return (0, print_utils_1.group)(print.spaced(["functionKw", "functions"]));
},
grant_resource_language: function (print) {
return (0, print_utils_1.group)(print.spaced(["languageKw", "languages"]));
},
grant_resource_large_object: function (print) {
return (0, print_utils_1.group)(print.spaced(["largeObjectKw", "oids"]));
},
grant_resource_postgresql_option: function (print) {
return (0, print_utils_1.group)(print.spaced(["parameterKw", "options"]));
},
grant_resource_tablespace: function (print) {
return (0, print_utils_1.group)(print.spaced(["tablespaceKw", "tablespaces"]));
},
grant_resource_type: function (print) { return (0, print_utils_1.group)(print.spaced(["typeKw", "types"])); },
grant_resource_all_tables_in_schema: function (print) {
return (0, print_utils_1.group)(print.spaced(["allTablesInSchemaKw", "schemas"]));
},
grant_resource_all_sequences_in_schema: function (print) {
return (0, print_utils_1.group)(print.spaced(["allSequencesInSchemaKw", "schemas"]));
},
grant_resource_all_functions_in_schema: function (print) {
return (0, print_utils_1.group)(print.spaced(["allFunctionsInSchemaKw", "schemas"]));
},
with_grant_option_clause: function (print) {
return (0, print_utils_1.group)(print.spaced(["withKw", "nameKw", "value"]));
},
grant_option_for_clause: function (print) {
return (0, print_utils_1.group)(print.spaced(["nameKw", "optionForKw"]));
},
granted_by_clause: function (print) { return (0, print_utils_1.group)(print.spaced(["grantedByKw", "role"])); },
grantee_public: function (print) { return print("publicKw"); },
grantee_group: function (print) { return (0, print_utils_1.group)(print.spaced(["groupKw", "name"])); },
};

@@ -14,3 +14,3 @@ "use strict";

},
alter_domain_stmt: function (print, node) {
alter_domain_stmt: function (print) {
return (0, print_utils_1.group)(print.spaced(["alterDomainKw", "name", "action"]));

@@ -17,0 +17,0 @@ },

@@ -25,2 +25,3 @@ "use strict";

]; },
function_signature: function (print) { return print(["name", "params"]); },
function_param: function (print) {

@@ -27,0 +28,0 @@ return print.spaced(["mode", "name", "dataType", "default"]);

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.transactionMap = void 0;
var print_utils_1 = require("../print_utils");
exports.transactionMap = {
start_transaction_stmt: function (print) {
return print.spaced(["startKw", "behaviorKw", "transactionKw"]);
start_transaction_stmt: function (print, node) {
return (0, print_utils_1.group)([
print.spaced(["startKw", "behaviorKw", "transactionKw"]),
node.modes ? (0, print_utils_1.indent)([print_utils_1.line, print("modes")]) : [],
]);
},
commit_transaction_stmt: function (print) {
return print.spaced(["commitKw", "transactionKw"]);
return print.spaced(["commitKw", "transactionKw", "chain"]);
},
rollback_transaction_stmt: function (print) {
return print.spaced(["rollbackKw", "transactionKw", "savepoint"]);
return print.spaced(["rollbackKw", "transactionKw", "savepoint", "chain"]);
},

@@ -21,2 +25,11 @@ rollback_to_savepoint: function (print) {

},
transaction_chain_clause: function (print) { return print.spaced("andChainKw"); },
transaction_no_chain_clause: function (print) { return print.spaced("andNoChainKw"); },
transaction_mode_isolation_level: function (print) {
return print.spaced(["isolationLevelKw", "levelKw"]);
},
transaction_mode_deferrable: function (print) { return print.spaced("deferrableKw"); },
transaction_mode_not_deferrable: function (print) { return print.spaced("notDeferrableKw"); },
transaction_mode_read_only: function (print) { return print.spaced("readOnlyKw"); },
transaction_mode_read_write: function (print) { return print.spaced("readWriteKw"); },
};

@@ -36,2 +36,3 @@ "use strict";

var rename_table_1 = require("./rename_table");
var role_1 = require("./role");
var prepared_statements_1 = require("./prepared_statements");

@@ -56,2 +57,2 @@ var procedural_language_1 = require("./procedural_language");

var postgresql_1 = require("./dialects/postgresql");
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);
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);

@@ -61,5 +61,17 @@ "use strict";

]; },
alter_trigger_stmt: function (print) {
return (0, print_utils_1.group)((0, print_utils_1.join)(print.dynamicLine(), [
print.spaced(["alterTriggerKw", "trigger", "target"]),
print("action"),
]));
},
drop_trigger_stmt: function (print) {
return print.spaced(["dropTriggerKw", "ifExistsKw", "trigger"]);
return print.spaced([
"dropTriggerKw",
"ifExistsKw",
"trigger",
"target",
"behaviorKw",
]);
},
};
{
"name": "prettier-plugin-sql-cst",
"version": "0.12.0",
"version": "0.12.1",
"description": "Prettier plugin for SQL",

@@ -39,3 +39,3 @@ "contributors": [

"prettier": "^3.0.3",
"sql-parser-cst": "^0.30.0"
"sql-parser-cst": "^0.31.1"
},

@@ -42,0 +42,0 @@ "devDependencies": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc