{"id":25792,"library":"jql2sql","title":"JQL2SQL","description":"JQL2SQL (v0.0.14) transpiles JQL (Jira Query Language) into parameterized SQL queries for safe, flexible searching. It uses a custom parser built with nearley to convert JQL to an AST, then transpiles to SQL WHERE clauses. This package is in early development with irregular releases. Key differentiators: focused solely on JQL-to-SQL conversion, no query execution, and aims for SQL injection safety by generating parameterized queries. Alternatives like jql-parser or custom lexers require more boilerplate.","status":"active","version":"0.0.14","language":"javascript","source_language":"en","source_url":"https://github.com/jql2sql/jql2sql","tags":["javascript","jql","sql","searching","complex searching","transpile"],"install":[{"cmd":"npm install jql2sql","lang":"bash","label":"npm"},{"cmd":"yarn add jql2sql","lang":"bash","label":"yarn"},{"cmd":"pnpm add jql2sql","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Used internally for JQL parser generation; not a runtime dependency but required at build time.","package":"nearley","optional":true}],"imports":[{"note":"Package exports a default function. ESM is preferred; CommonJS require works but may not be fully supported.","wrong":"const jql2sql = require('jql2sql');","symbol":"default","correct":"import jql2sql from 'jql2sql';"},{"note":"Named export is available (undocumented). Ensure correct destructured import.","wrong":"import transpile from 'jql2sql';","symbol":"{ transpile }","correct":"import { transpile } from 'jql2sql';"},{"note":"The parser is exported as a separate entry point. Not part of main export.","wrong":"import { JQLParser } from 'jql2sql';","symbol":"JQLParser","correct":"import JQLParser from 'jql2sql/parser';"}],"quickstart":{"code":"import jql2sql from 'jql2sql';\n\nconst jql = \"(item is 'good' or item is 'so so') and date < now()\";\nconst { sql, params } = jql2sql(jql);\n\nconsole.log(sql);\n// Output: (ITEM LIKE ? OR ITEM LIKE ?) AND DATE < NOW()\nconsole.log(params);\n// Output: ['%good%', '%so so%']\n\n// Use with parameterized query in DB driver:\n// db.query(sql, params).then(rows => ...);","lang":"typescript","description":"Transpile a JQL string into a parameterized SQL WHERE clause and parameters array."},"warnings":[{"fix":"Pin to exact version and test upgrades thoroughly.","message":"Version 0.x: API may change without notice; breaking changes expected.","severity":"breaking","affected_versions":"<1.0.0"},{"fix":"Avoid custom functions or wait for future release.","message":"Function 'myfunction(arg1, arg2)' in JQL is documented but not yet supported; trying to use it will throw an error.","severity":"deprecated","affected_versions":"<=0.0.14"},{"fix":"Use `=` for exact match, `is` for partial match (adds %).","message":"The `is` operator maps to SQL LIKE with wildcards, not `=`. For exact match use `field = 'value'`.","severity":"gotcha","affected_versions":"*"},{"fix":"Verify SQL dialect compatibility; test against your DB.","message":"Field names and values are case-insensitive? Check actual behavior: `select count(*) from items where ${sql}` may need quote handling.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use `import jql2sql from 'jql2sql'` or in CommonJS: `const { default: jql2sql } = require('jql2sql');`","cause":"Attempted to use CommonJS require on an ESM-only package or incorrect import.","error":"TypeError: jql2sql is not a function"},{"fix":"Replace 'does' with 'is' or '=' depending on intended meaning.","cause":"JQL operator 'does' is not supported. Only 'is', '=', '!=', '<', '>', etc.","error":"SyntaxError: Unexpected token: operator 'does'"},{"fix":"Remove custom functions from JQL string or wait for feature update.","cause":"Extended functions are not yet implemented.","error":"Error: Unsupported function: myfunction"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}