{"id":14991150,"url":"https://github.com/amrdeveloper/clangql","last_synced_at":"2025-05-14T23:06:35.811Z","repository":{"id":231713847,"uuid":"782547300","full_name":"AmrDeveloper/ClangQL","owner":"AmrDeveloper","description":" ClangQL is a tool that allow you to run SQL-like query on C/C++ Code instead of database files using the GitQL SDK","archived":false,"fork":false,"pushed_at":"2025-04-22T18:22:48.000Z","size":3160,"stargazers_count":511,"open_issues_count":4,"forks_count":13,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-05-14T23:06:19.338Z","etag":null,"topics":["ast","clang","cpp","database","gitql","llvm","llvm-clang","llvm-frontend","parser"],"latest_commit_sha":null,"homepage":"https://amrdeveloper.github.io/ClangQL/","language":"Rust","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/AmrDeveloper.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"amrdeveloper"}},"created_at":"2024-04-05T14:12:53.000Z","updated_at":"2025-05-13T21:13:55.000Z","dependencies_parsed_at":"2024-06-04T20:42:32.128Z","dependency_job_id":"376ca093-6301-42d0-888b-99b46f6b5d74","html_url":"https://github.com/AmrDeveloper/ClangQL","commit_stats":{"total_commits":62,"total_committers":1,"mean_commits":62.0,"dds":0.0,"last_synced_commit":"53bf604072104e1e84148ea27aedfb31e94b77de"},"previous_names":["amrdeveloper/clangql"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmrDeveloper%2FClangQL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmrDeveloper%2FClangQL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmrDeveloper%2FClangQL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmrDeveloper%2FClangQL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AmrDeveloper","download_url":"https://codeload.github.com/AmrDeveloper/ClangQL/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254243362,"owners_count":22038046,"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":["ast","clang","cpp","database","gitql","llvm","llvm-clang","llvm-frontend","parser"],"created_at":"2024-09-24T14:21:35.967Z","updated_at":"2025-05-14T23:06:30.799Z","avatar_url":"https://github.com/AmrDeveloper.png","language":"Rust","readme":"\u003ch1 align=\"center\"\u003eClangQL - Clang AST Query Language\u003c/h1\u003e\u003c/br\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"media/clangql_logo.svg\" width=\"20%\" height=\"20%\"/\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"Crates.io\" src=\"https://img.shields.io/crates/v/clangql?style=flat-square\"\u003e\n  \u003cimg alt=\"Deps\" src=\"https://deps.rs/repo/github/amrdeveloper/clangql/status.svg\"\u003e\n  \u003cimg alt=\"GitHub issues\" src=\"https://img.shields.io/github/issues/amrdeveloper/clangql\"\u003e\n  \u003cimg alt=\"GitHub\" src=\"https://img.shields.io/github/license/amrdeveloper/clangql\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\nClangQL is a tool that allow you to run SQL-like query on C/C++ Code instead of database files using the GitQL SDK.\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"media/clangql_demo.PNG\" alt=\"animated\" width=\"100%\"/\u003e\n\u003c/p\u003e\n\n---\n\n### Samples\n\nNote that all Keywords in ClangQL are case-insensitive, similar to SQL.\n\n```sql\nSELECT 1\nSELECT 1 + 2\nSELECT LEN(\"Clang Query Language\")\nSELECT \"One\" IN (\"One\", \"Two\", \"Three\")\nSELECT \"Clang Query Language\" LIKE \"%Query%\"\n\nSELECT name, source_loc FROM functions WHERE m_function(ast_function, (m_public() \u0026\u0026 m_constructor()) || m_default_constructor());\n\nSELECT * FROM functions\nSELECT COUNT(name) from functions WHERE return_type = \"int\"\nSELECT DISTINCT name AS function_name FROM functions\nSELECT name, source_loc FROM functions WHERE m_function(ast_function, m_constructor());\nSELECT name, source_loc FROM functions WHERE m_function(ast_function, m_copy_constructor());\nSELECT name, source_loc FROM functions WHERE m_function(ast_function, m_move_constructor());\nSELECT name, source_loc FROM functions WHERE m_function(ast_function, m_pure_virtual());\n\nSELECT * FROM globals\nSELECT COUNT(name) from globals WHERE type = \"int\"\nSELECT * FROM globals WHERE is_volatile\n```\n\n### Download or Install\n\nNote that Building from source or installing from Cargo.io requires LibClang 17 to be installed\n\n- Install from Cargo.io\n\n```\ncargo install clangql\n```\n\n- Install from Homebrew\n\n```\nbrew install clangql\n```\n\n- Build from source code\n\n```\ngit clone https://github.com/AmrDeveloper/clangql.git\ncd clangql\ncargo build\n```\n\n### Run ClangQL\n\n```\nClangQL is a SQL like query language to run on local files\nUsage: ClangQL [OPTIONS]\n\nOptions:\n  -f,  --files \u003cpaths\u003e        Path for local files to run query on\n  -s,  --script \u003cfile\u003e        Script file contains one or more query\n  -q,  --query \u003cGQL Query\u003e    ClangQL query to run on selected files\n  -p,  --pagination           Enable print result with pagination\n  -ps, --pagesize             Set pagination page size [default: 10]\n  -o,  --output               Set output format [render, json, csv]\n  -a,  --analysis             Print Query analysis\n  -h,  --help                 Print ClangQL help\n  -v,  --version              Print ClangQL Current Version\n```\n\n### License\n```\nMIT License\n\nCopyright (c) 2024 Amr Hesham\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","funding_links":["https://github.com/sponsors/amrdeveloper"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famrdeveloper%2Fclangql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famrdeveloper%2Fclangql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famrdeveloper%2Fclangql/lists"}