{"id":20461104,"url":"https://github.com/punit-naik/sqles","last_synced_at":"2026-04-19T00:03:11.642Z","repository":{"id":41119276,"uuid":"392723786","full_name":"punit-naik/sqles","owner":"punit-naik","description":"A Clojure library designed to convert SQL statements into Elasticsearch queries","archived":false,"fork":false,"pushed_at":"2026-02-07T22:03:16.000Z","size":167,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-08T06:44:17.535Z","etag":null,"topics":["clojure","elasticsearch","es","query","query-builder","sql","sql-to-elasticsearch","sql-to-es"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/punit-naik.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":"2021-08-04T14:42:01.000Z","updated_at":"2026-02-07T22:03:20.000Z","dependencies_parsed_at":"2023-01-17T22:15:49.826Z","dependency_job_id":null,"html_url":"https://github.com/punit-naik/sqles","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/punit-naik/sqles","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/punit-naik%2Fsqles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/punit-naik%2Fsqles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/punit-naik%2Fsqles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/punit-naik%2Fsqles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/punit-naik","download_url":"https://codeload.github.com/punit-naik/sqles/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/punit-naik%2Fsqles/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31989314,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"ssl_error","status_checked_at":"2026-04-18T20:23:29.375Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["clojure","elasticsearch","es","query","query-builder","sql","sql-to-elasticsearch","sql-to-es"],"created_at":"2024-11-15T12:23:31.619Z","updated_at":"2026-04-19T00:03:11.632Z","avatar_url":"https://github.com/punit-naik.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sqles\n\nA Clojure library designed to convert SQL statements into Elasticsearch requests\n\n[![CircleCI](https://circleci.com/gh/punit-naik/sqles/tree/master.svg?style=svg)](https://circleci.com/gh/punit-naik/sqles/tree/master)\n[![Clojars Project](https://img.shields.io/clojars/v/org.clojars.punit-naik/sqles.svg)](https://clojars.org/org.clojars.punit-naik/sqles)\n\n## Installation\n\nAdd to `project.clj`:\n\n```clj\n[org.clojars.punit-naik/sqles \"0.1.0\"]\n```\n\n## Quickstart\n\n```clj\n(require '[org.clojars.punit-naik.sqles.parse-sql :as sql])\n\n(sql/parse-query \"select * from my-index\")\n;; =\u003e {:url \"http://localhost:9200/my-index/_search\"\n;;     :body {:query {:match_all {}}}\n;;     :method :post}\n```\n\n```clj\n(sql/parse-query \"select name, age from users where age \u003e= 21 order by age desc limit 10\")\n```\n\n## Configuration\n\nThe Elasticsearch server settings are read from:\n\n- Java properties\n- A config file set via `:conf`\n- Environment variables\n\nSupported settings:\n\n- `ES_PROTOCOL` (default: `http`)\n- `ES_HOSTNAME` (required)\n- `ES_PORT` (required)\n- `ES_USERNAME` (optional)\n- `ES_PASSWORD` (optional)\n\nIf the server is not reachable, `parse-query` will throw.\n\n## Supported SQL\n\n- `SELECT` fields or `*`\n- `FROM`\n- `WHERE` with operators: `=`, `!=`, `\u003c\u003e`, `\u003c`, `\u003c=`, `\u003e`, `\u003e=`, `IN`, `BETWEEN`\n- `LIMIT`\n- `ORDER BY` with `asc` or `desc`\n- `COUNT(*)`\n\n## Limitations\n\n- No joins, group by, or aggregations\n- `WHERE` precedence does not follow SQL operator precedence\n- Nested parentheses support is limited\n- Only basic scalar literals are supported\n\n## Development\n\n### Tests\n\n```bash\nlein test\n```\n\n## CLI\n\nYou can run the parser and query runner via `-main`:\n\n```bash\nlein run \"select * from my-index limit 5\"\n```\n\n## Docs\n\n[API Docs](https://punit-naik.github.io/sqles)\n\n### Code Coverage\n\n[Code Coverage Report](https://punit-naik.github.io/sqles/coverage)\n\n## License\n\nCopyright © 2021 [Punit Naik](https://github.com/punit-naik)\n\nThis program and the accompanying materials are made available under the\nterms of the Eclipse Public License 2.0 which is available at\nhttp://www.eclipse.org/legal/epl-2.0.\n\nThis Source Code may also be made available under the following Secondary\nLicenses when the conditions for such availability set forth in the Eclipse\nPublic License, v. 2.0 are satisfied: GNU General Public License as published by\nthe Free Software Foundation, either version 2 of the License, or (at your\noption) any later version, with the GNU Classpath Exception which is available\nat https://www.gnu.org/software/classpath/license.html.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpunit-naik%2Fsqles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpunit-naik%2Fsqles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpunit-naik%2Fsqles/lists"}