{"library":"sqlglot-ts","title":"sqlglot-ts","type":"library","description":"TypeScript port of SQLGlot — a SQL parser and transpiler with browser-first design and zero runtime dependencies. Current version 0.1.5 is an early release; DuckDB dialect is thoroughly tested against Python SQLGlot's suite (500+ test cases), while other included dialects (PostgreSQL, BigQuery, Snowflake, etc.) have partial coverage. Unique differentiator: unbundled ESM modules allow tree-shaking per dialect, keeping bundle sizes small (core ~80KB gzipped, plus ~20–40KB per dialect). Unlike alternatives (e.g., node-sql-parser, moo-based parsers), sqlglot-ts emphasizes transpilation between dialects and full AST traversal.","language":"javascript","status":"active","last_verified":"Fri May 01","install":{"commands":["npm install sqlglot-ts"],"cli":null},"imports":["import { parseOne } from 'sqlglot-ts'","import { transpileOne } from 'sqlglot-ts'; import 'sqlglot-ts/dialects/duckdb'; import 'sqlglot-ts/dialects/postgres'","import { DuckDB } from 'sqlglot-ts/dialects'","import * as exp from 'sqlglot-ts/expressions'"],"auth":{"required":false,"env_vars":[]},"links":{"homepage":null,"github":"https://github.com/Flamefork/sqlglot-ts","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/sqlglot-ts","openapi_spec":null,"status_page":null,"smithery":null},"quickstart":{"code":"import { parseOne, transpileOne } from 'sqlglot-ts';\nimport 'sqlglot-ts/dialects/duckdb';\nimport 'sqlglot-ts/dialects/postgres';\nconst ast = parseOne('SELECT TRY_CAST(x AS INT)');\nconsole.log(ast.sql());\nconst result = transpileOne('SELECT TRY_CAST(x AS INT)', { read: 'duckdb', write: 'postgres' });\nconsole.log(result);","lang":"typescript","description":"Parses a DuckDB-specific SQL statement and transpiles it to PostgreSQL, demonstrating dialect imports and transpilation.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}