https://github.com/AmrDeveloper/ClangQL Skip to content Toggle navigation Sign in * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions For + Enterprise + Teams + Startups + Education By Solution + CI/CD & Automation + DevOps + DevSecOps Resources + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} AmrDeveloper / ClangQL Public * * Notifications * Fork 3 * Star 103 * ClangQL is a tool that allow you to run SQL-like query on C/C++ Code instead of database files using the GitQL SDK crates.io/crates/clangql License MIT license 103 stars 3 forks Branches Tags Activity Star Notifications * Code * Issues 6 * Pull requests 0 * Actions * Projects 0 * Security * Insights Additional navigation options * Code * Issues * Pull requests * Actions * Projects * Security * Insights AmrDeveloper/ClangQL This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. master BranchesTags Go to file Code Folders and files Name Name Last commit Last commit message date Latest commit History 11 Commits .github .github media media src src .gitignore .gitignore CODE_OF_CONDUCT.md CODE_OF_CONDUCT.md CONTRIBUTING.md CONTRIBUTING.md Cargo.lock Cargo.lock Cargo.toml Cargo.toml LICENSE LICENSE README.md README.md RELEASING.md RELEASING.md View all files Repository files navigation * README * Code of conduct * MIT license ClangQL - Clang AST Query Language [clangql_logo] Crates.io Deps GitHub issues GitHub ClangQL is a tool that allow you to run SQL-like query on C/C++ Code instead of database files using the GitQL SDK. animated --------------------------------------------------------------------- Samples Note that all Keywords in ClangQL are case-insensitive, similar to SQL. SELECT 1 SELECT 1 + 2 SELECT LEN("File Query Language") SELECT "One" IN ("One", "Two", "Three") SELECT "File Query Language" LIKE "%Query%" SELECT * FROM functions SELECT COUNT(name) from functions WHERE return_type = "int" SELECT DISTINCT name AS function_name FROM functions --------------------------------------------------------------------- Functions table structure Name Type Description name Text Function or Method name signature Text Parameters and return type literal args_count Integer Number of arguments return_type Text Return type literal is_method Boolean True if it's a method --------------------------------------------------------------------- Download or Install Note that Building from source or installing from Cargo.io requires LibClang 17 to be installed * Install from Cargo.io cargo install clangql * Build from source code git clone https://github.com/AmrDeveloper/clangql.git cd clangql cargo build Run ClangQL ClangQL is a SQL like query language to run on local files Usage: ClangQL [OPTIONS] Options: -f, --files Path for local files to run query on -q, --query ClangQL query to run on selected files -p, --pagination Enable print result with pagination -ps, --pagesize Set pagination page size [default: 10] -o, --output Set output format [render, json, csv] -a, --analysis Print Query analysis -h, --help Print ClangQL help -v, --version Print ClangQL Current Version License MIT License Copyright (c) 2024 Amr Hesham Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. About ClangQL is a tool that allow you to run SQL-like query on C/C++ Code instead of database files using the GitQL SDK crates.io/crates/clangql Topics parser database cpp llvm ast clang gitql llvm-clang llvm-fro Resources Readme License MIT license Code of conduct Code of conduct Activity Stars 103 stars Watchers 1 watching Forks 3 forks Report repository Releases No releases published Sponsor this project Sponsor Learn more about GitHub Sponsors Packages 0 No packages published Languages * Rust 100.0% Footer (c) 2024 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact * Manage cookies * Do not share my personal information You can't perform that action at this time.