{"id":18770034,"url":"https://github.com/yaroslaff/sqlgrep","last_synced_at":"2026-02-12T20:02:26.037Z","repository":{"id":63689722,"uuid":"569706416","full_name":"yaroslaff/sqlgrep","owner":"yaroslaff","description":"grep in SQL (mariadb/mysql/postgresql/sqlite3/...) database tables / fields","archived":false,"fork":false,"pushed_at":"2025-10-31T14:02:12.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-27T22:31:39.247Z","etag":null,"topics":["all","field","filter","find","grep","like","mariadb","mysql","postgresql","regex","regexp","search","select","sql","sqlite","sqlite3","table","where"],"latest_commit_sha":null,"homepage":"","language":"Python","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/yaroslaff.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,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-11-23T12:39:37.000Z","updated_at":"2025-10-31T14:02:16.000Z","dependencies_parsed_at":"2024-05-01T20:01:29.538Z","dependency_job_id":"faa45a40-cf9c-4407-b5d4-ed1aebb7bed5","html_url":"https://github.com/yaroslaff/sqlgrep","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/yaroslaff/sqlgrep","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaroslaff%2Fsqlgrep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaroslaff%2Fsqlgrep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaroslaff%2Fsqlgrep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaroslaff%2Fsqlgrep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yaroslaff","download_url":"https://codeload.github.com/yaroslaff/sqlgrep/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaroslaff%2Fsqlgrep/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29379677,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T19:05:20.189Z","status":"ssl_error","status_checked_at":"2026-02-12T19:01:44.216Z","response_time":55,"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":["all","field","filter","find","grep","like","mariadb","mysql","postgresql","regex","regexp","search","select","sql","sqlite","sqlite3","table","where"],"created_at":"2024-11-07T19:17:51.011Z","updated_at":"2026-02-12T20:02:26.031Z","avatar_url":"https://github.com/yaroslaff.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SQLGrep: Grep in SQL database tables / fields\n\n*If you do not know db schema (drank a lot yesterday, first day on new project or hacking alien starhip database)*\n\nSQLGrep will examine db schema and search (`SELECT ... WHERE ...`) for specified text/number/regex/like (needle) in all fields of all tables.\n\n## Install\n\nTo install mysql version on debian you may need to:\n~~~\napt install pkg-config libmariadb-dev python3-dev gcc\n~~~\n\nInstallation:\n~~~\n# new way, use pipx if you can (with mysql packages)\npipx install sqlgrep[mysql]\n\n# old-fashioned way  (and postgresql support)\npip install sqlgrep[postgresql]\n~~~\n\nsqlite3 is supported by Python natively (just install \"sqlgrep\").\n\n\n## Examples\nI use test db with just one table, so all found records will be in \"libro\" table.\n\n~~~shell\n# We want to know where year is stored and we know, at least one book published in 1991\n# found in table libro, fields: masterid, id, anno, peso\n$ sqlgrep mysql://localhost/libro --limit 1 1991\nlibro(id=1991) masterId: 1991\nlibro(id=1991) id: 1991\nlibro(id=80) anno: '1991'\nlibro(id=169601) peso: 1991\n\n# LIKE search, I'm only interested in mice...\n$ sqlgrep mysql://localhost/libro --like %mice%\nlibro(id=149894) autore: 'Primicerj Giulio'\nlibro(id=37004) title: 'ECONOMICESKAIA GHEOGRAFIA SSSR. - Lialikov H.I. - 1961'\nlibro(id=1359) titolo: 'STUDI MICENEI ED EGEO-ANATOLICI. Fascicolo ottavo.'\nlibro(id=1367) titolo: 'IL TORO DI MINOSSE. Creta, il Minotauro e la civiltà micenea.'\n~~~\n\nTo look in database via socket connection use URL `mysql:///dbname` .\n\n## Speed\nsqlgrep does one SQL SELECT ... WHERE query for each field in database. So, for db of 5 tables and 10 fields in each, there will be 50 queries (sending query to db is very simple and fast operation). All filtering are performed on database side (not in our slow python code), so it goes with maximal speed.\n\n## Database credentials\nSpecify database as SQLAlchemy URL like `mysql://user:password@host/db_name` (or `postgresql://...`)\n\nSee SQLAlchemy [Engine Configuration](https://docs.sqlalchemy.org/en/20/core/engines.html) for details.\n\n## Usage\n~~~\nusage: sqlgrep [-h] [--host HOST] [-t TABLES [TABLES ...]] [--like] [--float] [--int] [--limit N] [-c] [--all]\n               DB URL needle\n\ndatabase search (SQL grep), version: 0.0.6\n\npositional arguments:\n  DB URL                example: mysql://user:password@host/db_name\n  needle\n\noptions:\n  -h, --help            show this help message and exit\n  --host HOST\n  -t TABLES [TABLES ...], --tables TABLES [TABLES ...]\n                        tables (default: all)\n  --like                use SQL LIKE instead of =\n\nTypes (default - string):\n  --float               coerce to float\n  --int                 coerce to integer\n\nOutput:\n  --limit N             Limit to N results for each column\n  -c, --count           Count only\n  --all                 display ALL fields from matching rows\n~~~","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaroslaff%2Fsqlgrep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyaroslaff%2Fsqlgrep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaroslaff%2Fsqlgrep/lists"}