Replace node-sql-parser with sqlparser-ts#874
Replace node-sql-parser with sqlparser-ts#874guan404ming wants to merge 2 commits intodrawdb-io:mainfrom
Conversation
|
@guan404ming is attempting to deploy a commit to the dottle's projects Team on Vercel. A member of the Team first needs to authorize it. |
Benchmark: node-sql-parser vs sqlparser-tsSummaryThis optimization slashed the package size by 96% and boosted parse speed by up to 2.7x, while delivering broader SQL dialect coverage and smaller bundle size.
Parse Speed by Dialect1,000 iterations per dialect. Simple SQL uses a single CREATE TABLE with constraints. SQLite (complex) uses an 8-table e-commerce schema with 9 indices, foreign keys, CHECK constraints, and DEFAULT values (17 statements).
MySQL is slightly slower due to WASM overhead on simple queries, but PostgreSQL and MSSQL see significant speedups. The advantage grows with SQL complexity, as shown by the SQLite complex benchmark. Oracle support is now built-in instead of requiring a separate package. |
|
Hi @1ilit, could you help take a look at this, thanks! |
Signed-off-by: Guan-Ming (Wesley) Chiu <105915352+guan404ming@users.noreply.github.com>
Signed-off-by: Guan-Ming (Wesley) Chiu <105915352+guan404ming@users.noreply.github.com>
a7dd05a to
8f6cf81
Compare
Replaced node-sql-parser + oracle-sql-parser with sqlparser-ts, a WASM-powered SQL parser wrapping Rust's sqlparser from Apache DataFusion. It offers superior performance with zero JS/TS dependencies.
The pkg was developed by me and officially adopted by Apache Airflow, this package has proven its stability in production environments.
More detailed bench -> https://github.com/guan404ming/sqlparser-ts/tree/main/benchmark