Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/AmrDeveloper/FileQL
A tool that allow you to run SQL-like query on local files instead of database files using the GitQL SDK.
https://github.com/AmrDeveloper/FileQL
database engine files gitql parser sql tokenizer
Last synced: 14 days ago
JSON representation
A tool that allow you to run SQL-like query on local files instead of database files using the GitQL SDK.
- Host: GitHub
- URL: https://github.com/AmrDeveloper/FileQL
- Owner: AmrDeveloper
- License: mit
- Created: 2024-02-16T11:08:37.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2024-08-07T19:00:53.000Z (5 months ago)
- Last Synced: 2024-08-07T22:22:48.076Z (5 months ago)
- Topics: database, engine, files, gitql, parser, sql, tokenizer
- Language: Rust
- Homepage: https://crates.io/crates/fileql
- Size: 871 KB
- Stars: 70
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
FileQL - File Query Language
FileQL is a tool that allow you to run SQL-like query on local files instead of database files using the GitQL SDK.
---
### Samples
Note that all Keywords in FileQL are case-insensitive, similar to SQL.
```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 files
SELECT COUNT(path) from files
SELECT DISTINCT parent AS folders FROM files
SELECT CHILDREN_COUNT(parent) FROM files
```---
### Files table structure
| Name | Type | Description |
| --------- | ------- | ------------------------ |
| path | Text | File path |
| parent | Text | File parent path |
| extension | Text | Extension of the file |
| is_dir | Boolean | True if it's a directory |
| is_file | Boolean | True if it's a file |
| size | Integer | Size of the file |---
### Files QL Functions
| Name | Parameters | Return | Description |
| ----------- | ---------- | ------- | ------------------------------------------------------------ |
| FILES_COUNT | Text | Integer | Number of children for directory or 0 if it's not valid path |---
### Download or Install
- Install from Cargo.io
```
cargo install fileql
```- Install from Winget
```
winget install fileql
```- Build from source code
```
git clone https://github.com/AmrDeveloper/fileql.git
cd fileql
cargo build
```### Run FileQL
```
FileQL is a SQL like query language to run on local files
Usage: FileQL [OPTIONS]Options:
-f, --files Path for local files to run query on
-e, --excludes Path for local files to exclude from query scope
-q, --query FileQL 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 FileQL help
-v, --version Print FileQL Current Version
```### License
```
MIT LicenseCopyright (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.
```