{"id":36373370,"url":"https://github.com/paknahad/eql","last_synced_at":"2026-01-11T14:03:17.271Z","repository":{"id":57035171,"uuid":"190453975","full_name":"paknahad/eql","owner":"paknahad","description":"SQL into ES DSL (Write on SQL, Search on ElasticSearch)","archived":false,"fork":false,"pushed_at":"2019-12-18T15:17:09.000Z","size":21,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-05-21T02:21:53.522Z","etag":null,"topics":["dsl","elasticsearch","sql-parser"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/paknahad.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":"2019-06-05T19:12:14.000Z","updated_at":"2020-02-04T04:35:43.000Z","dependencies_parsed_at":"2022-08-24T14:11:07.176Z","dependency_job_id":null,"html_url":"https://github.com/paknahad/eql","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/paknahad/eql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paknahad%2Feql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paknahad%2Feql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paknahad%2Feql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paknahad%2Feql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paknahad","download_url":"https://codeload.github.com/paknahad/eql/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paknahad%2Feql/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28306985,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T11:18:18.743Z","status":"ssl_error","status_checked_at":"2026-01-11T11:07:56.842Z","response_time":60,"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":["dsl","elasticsearch","sql-parser"],"created_at":"2026-01-11T14:03:17.210Z","updated_at":"2026-01-11T14:03:17.264Z","avatar_url":"https://github.com/paknahad.png","language":"PHP","readme":"```\n                                                                      \nEEEEEEEEEEEEEEEEEEEEEE     QQQQQQQQQ     LLLLLLLLLLL                  \nE::::::::::::::::::::E   QQ:::::::::QQ   L:::::::::L                  \nE::::::::::::::::::::E QQ:::::::::::::QQ L:::::::::L                  \nEE::::::EEEEEEEEE::::EQ:::::::QQQ:::::::QLL:::::::LL                  \n  E:::::E       EEEEEEQ::::::O   Q::::::Q  L:::::L                    \n  E:::::E             Q:::::O     Q:::::Q  L:::::L                    \n  E::::::EEEEEEEEEE   Q:::::O     Q:::::Q  L:::::L                    \n  E:::::::::::::::E   Q:::::O     Q:::::Q  L:::::L                    \n  E:::::::::::::::E   Q:::::O     Q:::::Q  L:::::L                    \n  E::::::EEEEEEEEEE   Q:::::O     Q:::::Q  L:::::L                    \n  E:::::E             Q:::::O  QQQQ:::::Q  L:::::L                    \n  E:::::E       EEEEEEQ::::::O Q::::::::Q  L:::::L         LLLLLL     \nEE::::::EEEEEEEE:::::EQ:::::::QQ::::::::QLL:::::::LLLLLLLLL:::::L     \nE::::::::::::::::::::E QQ::::::::::::::Q L::::::::::::::::::::::L     \nE::::::::::::::::::::E   QQ:::::::::::Q  L::::::::::::::::::::::L     \nEEEEEEEEEEEEEEEEEEEEEE     QQQQQQQQ::::QQLLLLLLLLLLLLLLLLLLLLLLLL     \n                                   Q:::::Q                            \n                                    QQQQQQ\n```\n\n[![Build Status](https://travis-ci.org/meysampg/eql.svg?branch=master)](https://travis-ci.org/meysampg/eql)\n[![Maintainability](https://api.codeclimate.com/v1/badges/c3377ea017b632d00320/maintainability)](https://codeclimate.com/github/meysampg/eql/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/c3377ea017b632d00320/test_coverage)](https://codeclimate.com/github/meysampg/eql/test_coverage)\n\nOverview\n-----------\n\n\nThis project will a try to be a `php` equivalent of [elasticsql](https://github.com/cch123/elasticsql).\n\nCurrently support:\n\n- [ ] sql and expression\n- [ ] sql or expression\n- [ ] equal(=) support\n- [ ] not equal(!=) support\n- [ ] gt(\u003e) support\n- [ ] gte(\u003e=) support\n- [ ] lt(\u003c) support\n- [ ] lte(\u003c=) support\n- [ ] sql in (eg. id in (1,2,3) ) expression\n- [ ] sql not in (eg. id not in (1,2,3) ) expression\n- [ ] paren bool support (eg. where (a=1 or b=1) and (c=1 or d=1))\n- [ ] sql like expression (currently use match phrase, perhaps will change to wildcard in the future)\n- [ ] sql order by support\n- [ ] sql limit support\n- [ ] sql not like expression\n- [ ] field missing check\n- [ ] support aggregation like count(\\*), count(field), min(field), max(field), avg(field)\n- [ ] support aggregation like stats(field), extended_stats(field), percentiles(field) which are not standard sql function\n- [ ] null check expression(is null/is not null)\n- [ ] join expression\n- [ ] having support\n\nUsage\n-------------\n\n`\u003e composer require meysampg/eql`\n\nDemo :\n```php\n\u003c?php\n\nnamespace Sample;\n\nuse Meysampg\\Eql\\Parser;\n\n$sql = \"\nselect * from aaa\nwhere a=1 and x = '三个男人'\nand create_time between '2015-01-01T00:00:00+0800' and '2016-01-01T00:00:00+0800'\nand process_id \u003e 1 order by id desc limit 100,10\n\";\n\nfunction main() \n{\n    $dsl = Parser::buildFrom($sql);\n    print_r(json_encode($dsl));\n}\n\n```\n\nwill produce :\n```json\n{\n    \"query\": {\n        \"bool\": {\n            \"must\": [\n                {\n                    \"match\": {\n                        \"a\": {\n                            \"query\": \"1\",\n                            \"type\": \"phrase\"\n                        }\n                    }\n                },\n                {\n                    \"match\": {\n                        \"x\": {\n                            \"query\": \"三个男人\",\n                            \"type\": \"phrase\"\n                        }\n                    }\n                },\n                {\n                    \"range\": {\n                        \"create_time\": {\n                            \"from\": \"2015-01-01T00:00:00+0800\",\n                            \"to\": \"2016-01-01T00:00:00+0800\"\n                        }\n                    }\n                },\n                {\n                    \"range\": {\n                        \"process_id\": {\n                            \"gt\": \"1\"\n                        }\n                    }\n                }\n            ]\n        }\n    },\n    \"from\": 100,\n    \"size\": 10,\n    \"sort\": [\n        {\n            \"id\": \"desc\"\n        }\n    ]\n}\n```\n\nIf your sql contains some keywords, eg. order, timestamp, don't forget to escape these fields as follows:\n\n```\nselect * from `order` where `timestamp` = 1 and `desc`.id \u003e 0\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaknahad%2Feql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaknahad%2Feql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaknahad%2Feql/lists"}