{"id":19952616,"url":"https://github.com/qxip/elasql","last_synced_at":"2026-02-14T19:04:07.461Z","repository":{"id":49263459,"uuid":"132382312","full_name":"QXIP/elasql","owner":"QXIP","description":"Generic SQL to Elasticsearch DSL query translator","archived":false,"fork":false,"pushed_at":"2021-06-21T11:41:26.000Z","size":11,"stargazers_count":23,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-04T10:04:49.497Z","etag":null,"topics":["convert","dsl","elastic","elasticsearch","nodejs","query","sql","translate"],"latest_commit_sha":null,"homepage":"http://qxip.net","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/QXIP.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-06T22:55:59.000Z","updated_at":"2023-11-23T02:43:10.000Z","dependencies_parsed_at":"2022-09-07T19:10:34.118Z","dependency_job_id":null,"html_url":"https://github.com/QXIP/elasql","commit_stats":null,"previous_names":["lmangani/elasql"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QXIP%2Felasql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QXIP%2Felasql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QXIP%2Felasql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QXIP%2Felasql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/QXIP","download_url":"https://codeload.github.com/QXIP/elasql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252241941,"owners_count":21717073,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["convert","dsl","elastic","elasticsearch","nodejs","query","sql","translate"],"created_at":"2024-11-13T01:13:53.064Z","updated_at":"2026-02-14T19:04:07.435Z","avatar_url":"https://github.com/QXIP.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# {ela}sql \u003cimg src=\"https://user-images.githubusercontent.com/1423657/38137158-590eefbc-3423-11e8-96dd-487022b5618c.gif\" width=100 /\u003e\n\nGeneric SQL to Elasticsearch DSL query translator. Designed for [SENTINL](https://github.com/sirensolutions/sentinl)\n\n### Status\n* Experimental - Join us hacking this!\n\n## Installation\n```\nnpm install elasql\n```\n\n## Usage\n```\nconst convert = require('elasql').convert\nconvert('SELECT id,name FROM shop WHERE shop_id BETWEEN 5 AND 10 AND type = \"cat\"')\n```\n##### Output\n```\n{\n  \"query\": {\n    \"bool\": {\n      \"must\": [\n        {\n          \"match\": {\n            \"type\": \"cat\"\n          }\n        }\n      ],\n      \"must_not\": [],\n      \"filter\": [\n        {\n          \"range\": {\n            \"shop_id\": {\n              \"gte\": {\n                \"type\": \"number\",\n                \"value\": 5\n              },\n              \"lte\": {\n                \"type\": \"number\",\n                \"value\": 10\n              }\n            }\n          }\n        }\n      ]\n    }\n  },\n  \"aggregations\": {\n    \"id\": {\n      \"terms\": {\n        \"field\": \"id\"\n      },\n      \"aggregations\": {\n        \"name\": {\n          \"terms\": {\n            \"field\": \"name\"\n          }\n        }\n      }\n    }\n  }\n}\n\n```\n\n### License\n(C) QXIP BV 2018, released under the MIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqxip%2Felasql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqxip%2Felasql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqxip%2Felasql/lists"}