Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
dt-sql-parser
Advanced tools
本项目用于处理sql,目前含有功能
;
将sql分割为数组--
,/**/
类型注释)const dtFilter=require("dt-sql-parser").filter;
const sql=`
/*sttttttttart*/create table /*hhhhhhhh
hhhhhh
aaaaaa*/ sql_task_comment_test(id int comment 'id') comment 'sql test';
--eeeeeeeend
`
console.log(dtFilter.filterComments(sql))//过滤注释
console.log(dtFilter.splitSql(sql));//分割sql
const dtSqlParser=require("dt-sql-parser").parser;
console.log(dtSqlParser.parseSyntax("selet * form",'hive'));
/*
{
"text": "selet",//错误部分
"token": "REGULAR_IDENTIFIER",//类型
"line": 0,
"loc": {//错误位置信息
"first_line": 1,
"last_line": 1,
"first_column": 0,
"last_column": 5
},
"ruleId": "0",
"expected": [//建议输入内容
{
"text": "select",//建议内容
"distance": 1//建议优先级
},
{
"text": "delete",
"distance": 2
}
],
"recoverable": false,
"incompleteStatement": true
}
*/
过滤 sql
注释(支持/*
和--
)
自动去除注释,并且提取出各个 sql
校验 sql
语法,如果没错误,则返回 false
,否则返回错误详细信息
可以提供一个含有两个字符串的数组,代表被光标分割的两个 sql片段
解析 sql
语法,根据上下文提示补全字段与其它辅助信息
可以提供一个含有两个字符串的数组,代表被光标分割的两个sql片段
校验 flinksql
语法。
本项目文档不是很详细,也不准确(暂时没精力写),项目功能可以满足 hivesql,sql,impala,flinksql 的语法检查和提示功能。 具体使用方式可以参照代码中的 ts 类型。
hive,impala语法解析文件来自Hue
HUE
方案FAQs
SQL Parsers for BigData, built with antlr4
The npm package dt-sql-parser receives a total of 4,429 weekly downloads. As such, dt-sql-parser popularity was classified as popular.
We found that dt-sql-parser demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.