Research
Security News
Malicious PyPI Package ‘pycord-self’ Targets Discord Developers with Token Theft and Backdoor Exploit
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
sql-parser-ast
Advanced tools
Uses sql-parser-cst to parse SQL first into Concrete Syntax Tree (CST) and then converts the result to Abstract Syntax Tree (AST).
import { parse } from "sql-parser-ast";
parse("SELECT * FROM customer WHERE age > 10", { dialect: "sqlite" });
The parse()
function returns the following AST:
{
"type": "program",
"statements": [
{
"type": "select_stmt",
"columns": [{ "type": "all_columns" }],
"from": {
"type": "identifier",
"name": "customer"
},
"where": {
"type": "binary_expr",
"left": {
"type": "identifier",
"name": "age"
},
"operator": ">",
"right": {
"type": "number_literal",
"value": 10
}
}
}
]
}
For now it takes the exact same parameters as sql-parser-cst.
But the includeSpaces
, includeNewlines
, includeComments
options have no effect.
This project is still in very early stages of development.
It supports a fair amount of SQLite syntax, but a lot of stuff is still missing.
Don't use it in production.
FAQs
Parses SQL into Abstract Syntax Tree (AST)
We found that sql-parser-ast demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.