Traditional Unix tools (grep, sed, awk) are powerful but have inconsistent syntax and steep learning curves. sqd (pronounced like squad) provides a familiar SQL interface for common text operations.
This project requires Go version 1.25.4 or higher. Make sure you have a compatible version installed. If needed, download the latest version from https://go.dev/dl/
-
Installation: Installs sqd in the system
go install github.com/albertoboccolini/sqd@latest
-
Start using sqd: See all the open todos in your markdown files
sqd 'SELECT * FROM *.md WHERE content LIKE "%- [ ]%"'
Count all the LaTeX formulas in your notes
sqd 'SELECT count(*) FROM * WHERE content LIKE "%$$"'Refactor your markdown title hierarchy
sqd 'UPDATE *.md SET content="### " WHERE content LIKE "## %"'Remove all DEBUG logs
sqd "DELETE FROM *.log WHERE content LIKE '%DEBUG%'"Let's suppose we have a file with multiple similar titles, but we only want to change specific ones. With sed or awk, we need complex regex or multiple commands. With sqd, we can target exact lines and batch multiple replacements in a single command.
## Title 1 to be updated
## Title 1 not to be updated
## Title 1 TO be updated
## Title 2 to be updated
## Title 2 not to be updated
## Title 2 TO be updatedWith only one sqd command
sqd 'UPDATE example.md
SET content="## Title 1 UPDATED" WHERE content = "## Title 1 to be updated",
SET content="## Title 2 UPDATED" WHERE content = "## Title 2 TO be updated"'You will obtain the following result
## Title 1 UPDATED
## Title 1 not to be updated
## Title 1 TO be updated
## Title 2 to be updated
## Title 2 not to be updated
## Title 2 UPDATED