{"id":20859367,"url":"https://github.com/engineeringsoftware/fqs","last_synced_at":"2026-02-16T16:34:36.210Z","repository":{"id":252026840,"uuid":"839139022","full_name":"EngineeringSoftware/fqs","owner":"EngineeringSoftware","description":"fqs - Command line tool for writing file queries","archived":false,"fork":false,"pushed_at":"2024-08-08T05:23:25.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-12-26T06:06:37.354Z","etag":null,"topics":["cli","file","fqs","queries","sql"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EngineeringSoftware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-08-07T03:44:20.000Z","updated_at":"2024-08-08T05:23:28.000Z","dependencies_parsed_at":"2024-08-07T08:58:12.438Z","dependency_job_id":"dea4214c-4e1a-4f67-9751-d766ecedaf33","html_url":"https://github.com/EngineeringSoftware/fqs","commit_stats":null,"previous_names":["engineeringsoftware/fqs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/EngineeringSoftware/fqs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EngineeringSoftware%2Ffqs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EngineeringSoftware%2Ffqs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EngineeringSoftware%2Ffqs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EngineeringSoftware%2Ffqs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EngineeringSoftware","download_url":"https://codeload.github.com/EngineeringSoftware/fqs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EngineeringSoftware%2Ffqs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29513262,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T09:05:14.864Z","status":"ssl_error","status_checked_at":"2026-02-16T08:55:59.364Z","response_time":115,"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":["cli","file","fqs","queries","sql"],"created_at":"2024-11-18T04:49:37.546Z","updated_at":"2026-02-16T16:34:36.173Z","avatar_url":"https://github.com/EngineeringSoftware.png","language":"Rust","readme":"## fqs - file queries\n\n[![test](https://github.com/EngineeringSoftware/fqs/actions/workflows/test.yml/badge.svg)](https://github.com/EngineeringSoftware/fqs/actions/workflows/test.yml)\n[![coverage](https://github.com/EngineeringSoftware/fqs/actions/workflows/coverage.yml/badge.svg)](https://github.com/EngineeringSoftware/fqs/actions/workflows/coverage.yml)\n[![fmt](https://github.com/EngineeringSoftware/fqs/actions/workflows/fmt.yml/badge.svg)](https://github.com/EngineeringSoftware/fqs/actions/workflows/fmt.yml)\n[![Crates.io Version](https://img.shields.io/crates/v/fqs.svg)](https://crates.io/crates/fqs)\n\n`fqs` is a command line tool for writing queries over files. Query\nsyntax is inspired by SQL. In many ways `fqs` is similar to one (or\ncombination) of the following: `cut`, `paste`, `bc`, `grep`, and\n`awk`, but `fqs` provides SQL-like declarative query language.\n\nHere is an example command that prints the values from the second\ncolumn for each row if a value in the first column is greater than\n1000.\n\n```\nfqs \"select str(@1) from path/to/file where int(@0) \u003e 1000\"\n```\n\n`fqs` uses ' ' as a delimiter of columns in the given file.  (This is\nequivalent to `cut -d' '`.)\n\n## Examples\n\nThis section provides several examples. Let's say that we have the\nfollowing file (`demo.txt`).\n\n```\n33 77.0 true text\n44 88.98 false more\n77 123. true next\n```\n\nThe next command prints all the values from the first column of the\nfile. Note that we use `@0` as a column reference.\n\n```\nfqs \"select int(@0) from demo.txt\"\n```\n\nThe next command prints values from the first column doubled.\n\n```\nfqs \"select int(@0) * 2 from demo.txt\"\n```\n\nThe next command prints values from the first column only if the third\ncolumn is `true`.\n\n```\nfqs \"select int(@0) from demo.txt where bool(@2) = true\"\n```\n\nThe next command reorders columns, changes one of the columns from\nlower-case letters to upper-case letters and processes only rows in\nwhich the second column has value greater than 80.\n\n```\nfqs \"select upper(str(@3)), sin(int(@0)) from demo.txt where float(@1) \u003e 80\"\n```\n\nThe next command shows the number of rows, the sum of all values in\nthe first column, and the max value in the second column.\n\n```\nfqs \"select count(1), sum(int(@0)), max(float(@1)) from demo.txt\"\n```\n\n## Query language\n\nAt the moment, `fqs` supports the `select` statement.  In many ways\nthe `select` statement is similar to the one you might know from SQL,\nbut there are differences due to the nature of the data. Below is the\n(approximate) grammar of the language:\n\n```\nQuery ::= \"select\" Columns \"from\" Path [\"where\" Condition]\nColumns ::= Aggs | Exprs\nAggs ::= AggFunc [,AggFunc]*\nAggFunc ::= Id \"(\" CExpr \")\" # see the list of functions later in this document\nExprs ::= CExpr [, CExpr]*\nCExpr ::= ScaFunc | AExprs\nAExprs ::= MExprs [Aop AExprs]\nMExprs ::= MExprs [Mop Operand] | Operand\nScaFunc ::= Id \"(\" CExpr \")\" # see the list of functions later in this document\nPath ::= path to a file that contains data to process\nCondition ::= WExp\nWExp ::= Operand Lop Operand\nOperand ::= Cast | Int | Float | Bool | String\nCast ::= Type \"(\" ColRef \")\"\nType ::= \"int\" | \"float\" | \"bool\" | \"str\"\nColRef ::= \"@\"Int\nInt ::= int constant\nFloat ::= float constant\nBool ::= \"true\" | \"false\"\nString ::= \"'\"string\"'\"\nAop ::= \"+\" | \"-\"\nMop ::= \"*\" | \"/\"\nLop ::= \"\u003c\" | \"\u003e\" | \"\u003c=\" | \"\u003e=\" | \"=\" | \"!=\"\nId ::= an identifier\n```\n\n\n### Keywords\n\nThis section contains the list of keywords.\n\n`select`, `from`, `limit`, `where`, `int`, `float`, `str`, `bool`,\n`true`, `false`.\n\n\n### Scalar functions\n\nThis section contains the list of scalar functions.  All functions in\nthis section report an error if the given argument has an incorrect\ntype.\n\n#### upper(str)\n\n* Returns a string in which all lower-case characters are converted to\ntheir upper-case equivalent. It returns null if the argument is null.\n\n#### lower(str)\n\n* Returns a string in which all upper-case characters are converted to\ntheir lower-case equivalent. It returns null if the argument is null.\n\n#### length(str)\n\n* Returns the number of characters in the string argument. It returns\nnull if the argument is null.\n\n#### rev(str)\n\n* Reverses the given argument string. It returns null if the argument\nis null.\n\n#### abs(int|float)\n\n* Computes the absolute value of the argument. It returns null if the\nargument is null.\n\n#### sign(int|float)\n\n* Returns the sign of the given numerical argument. It returns null if\nthe argument is null.\n\n#### ceil(int|float)\n\n* Round the given number to an integer greater than or equal to the\ninput number. It returns null if the argument is null.\n\n#### floor(int|float)\n\n* Returns integer value less than or equal to the given argument. It\nreturns null if the argument is null.\n\n#### round(int|float)\n\n* Rounds the given argument numeric value to integer. It returns null\nif the argument is null.\n\n#### cos(int|float)\n\n* Returns the cosine of the given numeric argument in radians. It\nreturns null if the argument is null.\n\n#### sin(int|float)\n\n* Returns the sine of the given numeric argument in radians. It\nreturns null if the argument is null.\n\n### Aggregate functions\n\nThis section contains the list of aggregate functions.\n\n#### sum(int|float)\n\n* Returns the sum of non-null values.\n\n#### count(any)\n\n* Returns the number non-null values.\n\n#### max(int|float)\n\n* Finds the max numerical value. Null values are ignored.\n\n#### min(int|float)\n\n* Finds the min numerical value. Null values are ignored.\n\n#### avg(int|float)\n\n* Computes the average value. Null values are ignored.\n\n\n## Contributing\n\nPlease check [this page](CONTRIBUTING.md).\n\n\n## License\n\n[BSD-3-Clause license](LICENSE).\n\n\n## Contact\n\nFeel free to get in touch if you have any comments: Milos Gligoric\n`\u003cmilos.gligoric@gmail.com\u003e`.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fengineeringsoftware%2Ffqs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fengineeringsoftware%2Ffqs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fengineeringsoftware%2Ffqs/lists"}