{"id":13393088,"url":"https://github.com/dinedal/textql","last_synced_at":"2025-05-14T00:07:45.256Z","repository":{"id":13774282,"uuid":"16469292","full_name":"dinedal/textql","owner":"dinedal","description":"Execute SQL against structured text like CSV or TSV","archived":false,"fork":false,"pushed_at":"2023-10-22T22:51:40.000Z","size":1038,"stargazers_count":9087,"open_issues_count":39,"forks_count":299,"subscribers_count":165,"default_branch":"master","last_synced_at":"2025-04-10T02:17:30.607Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/dinedal.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2014-02-03T03:48:49.000Z","updated_at":"2025-04-07T20:15:36.000Z","dependencies_parsed_at":"2022-07-21T00:53:27.591Z","dependency_job_id":"f25d3fac-e77f-463d-83e0-ce7ed5dbdc82","html_url":"https://github.com/dinedal/textql","commit_stats":{"total_commits":126,"total_committers":27,"mean_commits":4.666666666666667,"dds":0.4285714285714286,"last_synced_commit":"fca00ecc76c8d9891b195ad2c1359d39f0213604"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinedal%2Ftextql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinedal%2Ftextql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinedal%2Ftextql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinedal%2Ftextql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dinedal","download_url":"https://codeload.github.com/dinedal/textql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254043836,"owners_count":22005025,"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":[],"created_at":"2024-07-30T17:00:42.672Z","updated_at":"2025-05-14T00:07:45.234Z","avatar_url":"https://github.com/dinedal.png","language":"Go","funding_links":[],"categories":["Go","Misc","Using SQL","Data Processing","Developer Tools","\u003ca name=\"data-management-tabular\"\u003e\u003c/a\u003eData management - Tabular data","SQL"],"sub_categories":["CLI","Command Line Tools","Über SQL"],"readme":"# TextQL\n\n[![Build Status](https://travis-ci.org/dinedal/textql.svg)](https://travis-ci.org/dinedal/textql) [![Go Report Card](http://goreportcard.com/badge/dinedal/textql)](http://goreportcard.com/report/dinedal/textql)\n\nAllows you to easily execute SQL against structured text like CSV or TSV.\n\nExample session:\n\n![textql_usage_session](https://raw.github.com/dinedal/textql/master/textql_usage.gif)\n\n## Major changes!\n\nIn the time since the initial release of textql, I've made some improvements as well as made the project much more modular. There've also been additional performance tweaks and added functionality, but this comes at the cost of breaking the original command-line flags and changing the install command.\n\n### Changes since v1\n\nAdditions:\n\n- Numeric values are automatically recognized in more cases.\n- Date / Time / DateTime values are automatically recognized in reasonable formats. See [Time Strings](https://www.sqlite.org/lang_datefunc.html) for a list for accepted formats, and how to convert from other formats.\n- Added join support! Multiple files / directories can be loaded by listing them at the end of the command.\n- Directories are read by reading each file inside, and this is non-recursive.\n- You can list as many files / directories as you like.\n- Added flag '-output-file' to save output directly to a file.\n- Added flag '-output-dlm' to modify the output delimiter.\n- Added \"short SQL\" syntax.\n  - For the case of a single table, the `FROM [table]` can be dropped from the query.\n  - For simple selects, the `SELECT` keyword can be dropped from the query.\n  - This means the v1 command `textql -sql \"select * from tbl\" -source some_file.csv` can be shortened to `textql -sql \"*\" some_file.csv`\n\nChanges:\n\n- The flag '-outputHeader' was renamed to '-output-header'.\n\nRemovals:\n\n- Dropped the ability to override table names. This makes less sense after the automatic tablename generation based on filename, joins, and shorter SQL syntax changes.\n- Removed '-source', any files / paths at the end of the command are used, as well as piped-in data.\n\nBug fixes:\n\n- Writing to a directory no longer fails silently.\n\n## Key differences between textql and sqlite importing\n\n- sqlite import will not accept stdin, breaking unix pipes. textql will happily do so.\n- textql supports quote-escaped delimiters, sqlite does not.\n- textql leverages the sqlite in-memory database feature as much as possible and only touches disk if asked.\n\n## Is it any good?\n\n[Yes](https://news.ycombinator.com/item?id=3067434)\n\n## Requirements\n\n- Go 1.4 or later\n\n## Install\n\n**Latest release on Homebrew (OS X)**\n\n```bash\nbrew install textql\n```\n\n**Build from source**\n\n```bash\ngo get -u github.com/dinedal/textql/...\n```\n\n## Docker\n\nFirst build the image.\n\n```bash\ndocker build -t textql .\n```\n\nNow use that image mounting your current directory into the container.\n\n```bash\ndocker run --rm -it -v $(pwd):/tmp textql [rest_of_command]\n```\n\n### Alias\n\nYou can add the following alias to your system to provide quick access to TextQL:\n\n```bash\nalias textql='docker run --rm -it -v $(pwd):/tmp textql '\n```\n\n## AUR\n\n**Using an AUR-Helper**\n\n```bash\nyaourt textql-git\n```\n\n**Building from PKGBUILD**\nFirst clone the repository.\n```bash\nmakepkg -cs\n```\nThen install the package using pacman or your favorite Package Manager\n\n\n## Usage\n\n```bash\n  textql [-console] [-save-to path path] [-output-file path] [-output-dlm delimter] [-output-header] [-pretty] [-quiet] [-header] [-dlm delimter] [-sql sql_statements] [path ...]\n\n  -console\n        After all statements are run, open SQLite3 REPL with this data\n  -dlm string\n        Input delimiter character between fields -dlm=tab for tab, -dlm=0x## to specify a character code in hex (default \",\")\n  -header\n        Treat input files as having the first row as a header row\n  -output-dlm string\n        Output delimiter character between fields -output-dlm=tab for tab, -dlm=0x## to specify a character code in hex (default \",\")\n  -output-file file\n        Filename to write output to, if empty no output is written (default \"stdout\")\n  -output-header\n        Display column names in output\n  -quiet\n        Suppress logging\n  -pretty\n        Pretty print output\n  -save-to file\n        SQLite3 db is left on disk at this file\n  -sql string\n        SQL Statement(s) to run on the data\n  -version\n        Print version and exit\n```\n\n## I want stdev, average, other functions\n\nJust follow the install directions at [go-sqlite3-extension-functions](https://github.com/dinedal/go-sqlite3-extension-functions) and textql will automatically load this library.\n\nFull function list:\n\n- Math: acos, asin, atan, atn2, atan2, acosh, asinh, atanh, difference, degrees, radians, cos, sin, tan, cot, cosh, sinh, tanh, coth, exp, log, log10, power, sign, sqrt, square, ceil, floor, pi.\n- String: replicate, charindex, leftstr, rightstr, ltrim, rtrim, trim, replace, reverse, proper, padl, padr, padc, strfilter.\n- Aggregate: stdev, variance, mode, median, lower_quartile, upper_quartile\n\n## License\n\nNew MIT License - Copyright (c) 2015, 2016 Paul Bergeron [http://pauldbergeron.com/](http://pauldbergeron.com/)\n\nSee LICENSE for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdinedal%2Ftextql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdinedal%2Ftextql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdinedal%2Ftextql/lists"}