{"id":43467,"library":"node-sql-parser-etypes","title":"Node SQL Parser (Extra Types)","description":"A fork of node-sql-parser that adds extra SQL types (e.g., VECTOR) to AST parsing. Version 5.3.14 includes support for multiple database engines (MySQL, PostgreSQL, etc.), an AST-based visitor for table/column lists, and conversion back to SQL. Maintained as a community fork alongside the original taozhi8833998/node-sql-parser. Ships TypeScript types and supports both ESM and CommonJS.","status":"active","version":"5.3.14","language":"javascript","source_language":"en","source_url":"https://github.com/YaroCabbage/node-sql-parser-etypes","tags":["javascript","sql","sql-parser","parser","node","nodejs","node-parser","node-sql-parser","node-sql-parser-etypes","typescript"],"install":[{"cmd":"npm install node-sql-parser-etypes","lang":"bash","label":"npm"},{"cmd":"yarn add node-sql-parser-etypes","lang":"bash","label":"yarn"},{"cmd":"pnpm add node-sql-parser-etypes","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Works in both ESM and CJS. In CJS, use destructuring require or access .Parser.","wrong":"const Parser = require('node-sql-parser-etypes').Parser","symbol":"Parser","correct":"import { Parser } from 'node-sql-parser-etypes'"},{"note":"astify is a method on Parser instance, not a standalone export.","wrong":"import { astify } from 'node-sql-parser-etypes'","symbol":"astify","correct":"import { Parser } from 'node-sql-parser-etypes'; const parser = new Parser(); const ast = parser.astify('SELECT 1')"},{"note":"sqlify is a method on Parser instance.","wrong":"import { sqlify } from 'node-sql-parser-etypes'","symbol":"sqlify","correct":"import { Parser } from 'node-sql-parser-etypes'; const parser = new Parser(); const sql = parser.sqlify(ast)"},{"note":"In browser UMD build, the global is NodeSQLParser, which contains the Parser constructor as a property.","wrong":"const parser = new NodeSQLParser()","symbol":"NodeSQLParser","correct":"const parser = new NodeSQLParser.Parser()"}],"quickstart":{"code":"import { Parser } from 'node-sql-parser-etypes'\n\nconst parser = new Parser()\nconst ast = parser.astify('SELECT id, name FROM students WHERE age < 18')\nconsole.log(JSON.stringify(ast, null, 2))\n\nconst sql = parser.sqlify(ast)\nconsole.log(sql)  // SELECT `id`, `name` FROM `students` WHERE `age` < 18","lang":"typescript","description":"Parses a simple SELECT statement into an AST and converts it back to SQL, showing the round-trip behaviour."},"warnings":[{"fix":"Check the original package for latest features and stability. Evaluate if extra types justify using the fork.","message":"This is a fork – not the original node-sql-parser. The original maintainer is taozhi8833998. This fork (YaroCabbage) adds extra types like VECTOR but may lag behind on updates.","severity":"gotcha","affected_versions":">=0"},{"fix":"Create a Parser instance: const parser = new Parser(); then call parser.astify() / parser.sqlify().","message":"In version 4.x and 5.x, the Parser class API changed from static methods to instance methods. Code using old static methods will break.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Migrate to node-sql-parser (original) or ts-sql-parser if you need active maintenance.","message":"The package is no longer actively maintained? Last release was 2022. Issues may not be addressed. Consider the original node-sql-parser or other alternatives.","severity":"deprecated","affected_versions":">=5.0.0"},{"fix":"Verify AST shape expected by downstream code with your specific SQL statements.","message":"AST output may differ from original parser due to extra type support. Use with caution if relying on exact AST structure.","severity":"gotcha","affected_versions":">=0"}],"env_vars":null,"search_vec":"'5.3.14':24 'add':14 'alongsid':52 'ast':21,36 'ast-bas':35 'back':44 'base':37 'commonj':64 'communiti':50 'convers':43 'databas':29 'e.g':18 'engin':30 'esm':62 'etc':33 'etyp':84 'extra':4,15 'fork':7,51 'includ':25 'javascript':65 'list':41 'maintain':47 'multipl':28 'mysql':31 'node':1,10,71,74,77,81 'node-pars':73 'node-sql-pars':9,76 'node-sql-parser-etyp':80 'nodej':72 'origin':54 'pars':22 'parser':3,12,69,70,75,79,83 'postgresql':32 'ship':56 'sql':2,11,16,46,66,68,78,82 'sql-parser':67 'support':26,60 'table/column':40 'taozhi8833998/node-sql-parser':55 'type':5,17,58 'typescript':57,85 'vector':19 'version':23 'visitor':38","created_at":"2026-06-05T16:59:56.334874+00:00","updated_at":"2026-06-05T16:59:56.334874+00:00","problems":[{"fix":"const parser = new Parser(); parser.astify('SQL')","cause":"Calling astify as a static method on the class, not on an instance.","error":"TypeError: parser.astify is not a function"},{"fix":"npm install node-sql-parser-etypes and import from 'node-sql-parser-etypes'.","cause":"Installed the wrong package? This package is node-sql-parser-etypes, not node-sql-parser.","error":"Cannot find module 'node-sql-parser' or its corresponding type declarations."},{"fix":"Ensure script src is correct: https://unpkg.com/node-sql-parser-etypes/umd/mysql.umd.js and use after window.onload.","cause":"In browser, you included the script but used NodeSQLParser before it loaded, or used wrong script path.","error":"ReferenceError: NodeSQLParser is not defined"},{"fix":"Use parser for the appropriate dialect or check if VECTOR is included in that dialect's grammar.","cause":"This fork should support VECTOR type, but maybe it's not included in the parser instance used (MySQL vs PostgreSQL).","error":"Error: Unsupported column type: VECTOR"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/YaroCabbage/node-sql-parser#readme","github":"https://github.com/YaroCabbage/node-sql-parser-etypes","docs":null,"changelog":null,"pypi":null,"npm":"node-sql-parser-etypes","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database","devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-05","next_check":"2026-09-03","install_tag":null}}