sqio

module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: MIT

README

sqio

English README: README.en.md

sqio は MySQL、PostgreSQL、SQLite、SQL Server、Oracle、DuckDB、 ClickHouse に対応した Go 製の TUI/CLI 統合データベースクライアントです。

CLI が主要なインターフェースです。TUI は同じサービス層の フロントエンドとして動作するため、主要なワークフローは スクリプト、CI、AI エージェントからも利用できます。

コマンド

sqio exec --sql 'select 1' --format json
sqio explain --conn local --sql 'select * from users'
sqio config validate
sqio conn list
sqio conn add local --driver sqlite --database ./local.db
sqio conn remove local
sqio conn test --conn local
sqio complete --prefix 'sel'
sqio query --sql 'select 1'
sqio query --pick
sqio fmt --sql 'select * from users'
sqio lint --sql 'select * from users'
sqio schemas --conn local
sqio tables --conn local
sqio columns --conn local --schema public --table users
sqio indexes --conn local --table users
sqio roles --conn local
sqio grants --conn local --role app_user
sqio ddl --conn local --table users
sqio schema export --conn local --format json
sqio schema diff --from before.json --to after.json
sqio er --conn local --format mermaid
sqio er --conn local --format mermaid --clipboard
sqio dump --conn local --table users --format csv --out users.csv
sqio dump --conn local --table users --format csv --out users.csv.gz
sqio load --conn local --table users --file users.csv
sqio load --conn local --table users --file users.json --format json
sqio load --conn local --table users --file users.jsonl --format jsonl
sqio load --conn local --table users --file users.yaml --format yaml
sqio load --conn local --table users --file users.csv.gz --format csv
sqio edit insert --conn local --table users --set name=alice
sqio edit update --conn local --table users --set name=bob --where 'id = 1'
sqio edit delete --conn local --table users --where 'id = 1'
sqio migrate status --conn local --dir migrations
sqio migrate plan --conn local --dir migrations
sqio migrate apply --conn local --dir migrations
sqio migrate rollback --conn local --dir migrations
sqio plugin list
sqio plugin run hello --arg
sqio history --format json
sqio history --search 'select' --favorite
sqio history favorite 1
sqio history tag 1 --tags report
sqio history run 1 --conn local
sqio tui --conn local

インストール

ソースから build できます。

go install github.com/isksss/sqio/cmd/sqio@latest

このリポジトリを checkout 済みの場合:

go build -o /tmp/sqio ./cmd/sqio
/tmp/sqio --help

ドキュメント

Directories

Path Synopsis
cmd
sqio command
Package main contains the sqio command entrypoint.
Package main contains the sqio command entrypoint.
internal
cli
Package cli wires Cobra commands to sqio services and terminal I/O.
Package cli wires Cobra commands to sqio services and terminal I/O.
config
Package config loads sqio configuration from defaults, TOML files, and environment variables.
Package config loads sqio configuration from defaults, TOML files, and environment variables.
db
Package db opens database connections and executes SQL against supported drivers.
Package db opens database connections and executes SQL against supported drivers.
dbdriver
Package dbdriver centralizes database driver names, aliases, and small classification helpers used across sqio.
Package dbdriver centralizes database driver names, aliases, and small classification helpers used across sqio.
editor
Package editor opens SQL text in the user's preferred external editor.
Package editor opens SQL text in the user's preferred external editor.
formatter
Package formatter contains sqio's lightweight SQL formatter.
Package formatter contains sqio's lightweight SQL formatter.
history
Package history stores executed SQL statements in a local SQLite database.
Package history stores executed SQL statements in a local SQLite database.
linter
Package linter implements sqio's SQL safety and style checks.
Package linter implements sqio's SQL safety and style checks.
output
Package output serializes query results into CLI-friendly formats.
Package output serializes query results into CLI-friendly formats.
picker
Package picker discovers SQL files and selects one interactively when possible.
Package picker discovers SQL files and selects one interactively when possible.
plugin
Package plugin discovers and runs external sqio plugin executables.
Package plugin discovers and runs external sqio plugin executables.
query
Package query reads, splits, and classifies SQL input.
Package query reads, splits, and classifies SQL input.
secret
Package secret resolves encrypted configuration values.
Package secret resolves encrypted configuration values.
service
Package service provides application-level operations shared by the CLI and TUI frontends.
Package service provides application-level operations shared by the CLI and TUI frontends.
tui
Package tui implements the Bubble Tea terminal user interface.
Package tui implements the Bubble Tea terminal user interface.
tunnel
Package tunnel manages SSH local port forwarding for database connections.
Package tunnel manages SSH local port forwarding for database connections.

Jump to

Keyboard shortcuts

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