qsave

command module
v0.0.0-...-e0e3f49 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2026 License: MIT Imports: 13 Imported by: 0

README

qsave

qsave Logo

qsave is a simple command-line interface (CLI) tool written in Go that allows you to easily save, list, search, edit, and manage frequently used SQL queries or any text snippets. It stores your queries in a local SQLite database, making them readily accessible from your terminal.

Features

  • Add Queries: Save new queries with a given name. The content is edited using your default system editor (EDITOR environment variable, vim for Unix-like, notepad for Windows).
  • List Queries: Display the names of all saved queries.
  • Show Query: View the content of a specific saved query by its name and automatically copy it to the clipboard.
  • Search Queries: Find queries containing a specific text token within their body.
  • Edit Queries: Modify the content of an existing query.
  • Rename Queries: Rename an existing query.
  • Delete Queries: Remove saved queries.

Installation

To install qsave, make sure you have Go installed. Then, run the following command:

go install github.com/machin0r/qsave@latest

This will install the qsave executable in your Go bin directory (usually $GOPATH/bin). Make sure this directory is in your system's PATH.

Usage

Once installed, you can use qsave from your terminal.

Add a new query

This will open your default editor. Type or paste your query, save, and exit the editor.

qsave add <query-name>

Example:

qsave add my_complex_join
List all saved queries
qsave list
Show a specific query

Displays the query and copies it to your clipboard.

qsave show <query-name>

Example:

qsave show my_complex_join
Search for queries
qsave search <search-token>

Example:

qsave search "CREATE TABLE"
Edit an existing query

This will open your default editor with the current content of the query. Edit, save, and exit.

qsave edit <query-name>

Example:

qsave edit my_complex_join
Rename a query
qsave rename <old-name> <new-name>

Example:

qsave rename my_typo_name my_correct_name
Delete a query
qsave delete <query-name>

Example:

qsave delete my_old_query

Database Location

qsave stores its data in an SQLite database file named qsave.db located in your user's home directory.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL