{"id":42888,"library":"jelly-sql","title":"Jelly SQL","description":"Jelly SQL is a JavaScript library that allows querying the DOM using SQL syntax, converting SQL queries into CSS selectors for document.querySelectorAll(). Current stable version is 1.1.0. The library has no third-party dependencies, supports both browser and Node.js, and includes TypeScript type definitions. It provides a familiar query interface for developers accustomed to SQL, differentiating itself from other DOM query libraries by offering a SQL-like abstraction instead of traditional CSS selector strings. The package is actively maintained with a GitHub Actions CI pipeline.","status":"active","version":"1.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/andreschoultz/jelly-sql","tags":["javascript","css","html","dom","lexer","queryselector","query","sql","typescript"],"install":[{"cmd":"npm install jelly-sql","lang":"bash","label":"npm"},{"cmd":"yarn add jelly-sql","lang":"bash","label":"yarn"},{"cmd":"pnpm add jelly-sql","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The library exports named exports; default import is not available.","wrong":"const query = require('jelly-sql')","symbol":"query","correct":"import { query } from 'jelly-sql'"},{"note":"When using CDN without a module bundler, the library exposes a global jellySQL object. Using the named import directly will fail.","wrong":"const selector = query(`SELECT * FROM DOM`)","symbol":"jellySQL (global in browser)","correct":"const selector = jellySQL.query(`SELECT * FROM DOM`)"},{"note":"TypeScript types are included. There is no common mistake for type imports.","wrong":null,"symbol":"type exports","correct":"import type { QueryFunction } from 'jelly-sql'"}],"quickstart":{"code":"import { query } from 'jelly-sql';\n\n// Get all anchor tags\nconst selector1 = query(`SELECT * FROM DOM WHERE TAG = 'a'`);\nconsole.log(selector1); // Output: 'a'\n\n// Get elements with class 'active' inside a div\nconst selector2 = query(`SELECT * FROM DOM WHERE TAG = 'div' AND .className = 'active'`);\nconsole.log(selector2); // Output: 'div.active'\n\n// Use the selector with querySelectorAll\nconst elements = document.querySelectorAll(selector2);","lang":"typescript","description":"Demonstrates importing the query function and converting SQL-style queries to CSS selectors for DOM querying."},"warnings":[{"fix":"Use query() to get the selector, then pass it to querySelectorAll().","message":"The query function returns a CSS selector string, not the DOM elements directly. You must call document.querySelectorAll() yourself.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use npm/yarn import instead of CDN global, or use the module version via <script type=\"module\">.","message":"The global `jellySQL` object in CDN builds may not be available in future major versions. Prefer ESM imports.","severity":"deprecated","affected_versions":"<=1.1.0"},{"fix":"Ensure correct case for tag names and attribute values.","message":"SQL keywords like SELECT, FROM, WHERE are case-insensitive, but tag names and attribute values are case-sensitive (matching CSS selector behavior).","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.1.0':29 'abstract':72 'accustom':56 'action':87 'activ':82 'allow':10 'browser':40 'ci':88 'convert':17 'css':21,76,91 'current':25 'definit':47 'depend':37 'develop':55 'differenti':59 'document.queryselectorall':24 'dom':13,63,93 'familiar':51 'github':86 'html':92 'includ':44 'instead':73 'interfac':53 'javascript':7,90 'jelli':1,3 'lexer':94 'librari':8,31,65 'like':71 'maintain':83 'node.js':42 'offer':67 'packag':80 'parti':36 'pipelin':89 'provid':49 'queri':11,19,52,64,96 'queryselector':95 'selector':22,77 'sql':2,4,15,18,58,70,97 'sql-like':69 'stabl':26 'string':78 'support':38 'syntax':16 'third':35 'third-parti':34 'tradit':75 'type':46 'typescript':45,98 'use':14 'version':27","created_at":"2026-06-05T16:57:09.047494+00:00","updated_at":"2026-06-05T16:57:09.047494+00:00","problems":[{"fix":"If using CDN, use `jellySQL.query()`. If using npm, add `import { query } from 'jelly-sql';`.","cause":"Using `query()` directly without importing or when using CDN.","error":"Error: query is not defined"},{"fix":"Use `document.querySelectorAll(selector)` where selector is the result of query().","cause":"Trying to call querySelectorAll on the result of query(), which is a string, not a DOM node.","error":"TypeError: Cannot read properties of undefined (reading 'querySelectorAll')"},{"fix":"Run `npm install jelly-sql` and use `import { query } from 'jelly-sql';`.","cause":"Missing npm installation or incorrect import path.","error":"Module not found: Error: Can't resolve 'jelly-sql'"}],"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://jellysql.com","github":"https://github.com/andreschoultz/jelly-sql","docs":null,"changelog":null,"pypi":null,"npm":"jelly-sql","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"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}}