{"id":18053827,"url":"https://github.com/hymkor/sqlbless","last_synced_at":"2026-02-14T04:59:54.287Z","repository":{"id":153342487,"uuid":"624468642","full_name":"hymkor/sqlbless","owner":"hymkor","description":"The Command-line Database Client","archived":false,"fork":false,"pushed_at":"2026-02-01T13:25:24.000Z","size":815,"stargazers_count":19,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-01T16:25:48.076Z","etag":null,"topics":["command-line","mssql","mysql","oracle","postgresql","sql","sql-client","sqlite3","sqlserver"],"latest_commit_sha":null,"homepage":"https://hymkor.github.io/sqlbless/","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/hymkor.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-04-06T14:32:48.000Z","updated_at":"2026-02-01T13:25:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"a6f56d18-fe1e-488e-99a9-6c7c0b47e566","html_url":"https://github.com/hymkor/sqlbless","commit_stats":null,"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"purl":"pkg:github/hymkor/sqlbless","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hymkor%2Fsqlbless","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hymkor%2Fsqlbless/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hymkor%2Fsqlbless/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hymkor%2Fsqlbless/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hymkor","download_url":"https://codeload.github.com/hymkor/sqlbless/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hymkor%2Fsqlbless/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29167871,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T15:38:29.831Z","status":"ssl_error","status_checked_at":"2026-02-06T15:37:48.592Z","response_time":59,"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":["command-line","mssql","mysql","oracle","postgresql","sql","sql-client","sqlite3","sqlserver"],"created_at":"2024-10-31T00:08:12.892Z","updated_at":"2026-02-14T04:59:54.278Z","avatar_url":"https://github.com/hymkor.png","language":"Go","readme":"SQL-Bless\r\n===========\r\n\r\n\u003c!-- stdout:go run github.com/hymkor/example-into-readme/cmd/badges@latest --\u003e\r\n[![Go Test](https://github.com/hymkor/sqlbless/actions/workflows/go.yml/badge.svg)](https://github.com/hymkor/sqlbless/actions/workflows/go.yml)\r\n[![License](https://img.shields.io/badge/License-MIT-red)](https://github.com/hymkor/sqlbless/blob/master/LICENSE)\r\n[![Go Reference](https://pkg.go.dev/badge/github.com/hymkor/sqlbless.svg)](https://pkg.go.dev/github.com/hymkor/sqlbless)\r\n[![GitHub](https://img.shields.io/badge/github-repo-blue?logo=github)](https://github.com/hymkor/sqlbless)\r\n\u003c!-- --\u003e\r\n\r\n**\u0026lt;English\u0026gt;** / [\u0026lt;Japanese\u0026gt;](./README_ja.md)\r\n\r\nSQL-Bless is a command-line database client similar to SQL\\*Plus, supporting multiple database systems.\r\n\r\nIt was designed with reliability and transparency in mind.\r\nIn the past, I had to deliver an unfinished system due to client pressure,\r\nwhich led to serious data inconsistencies that took enormous effort to fix.\r\nThat experience made me realize how important it is to have a tool\r\nthat prevents silent data corruption and keeps a complete, traceable log of every operation.\r\nSQL-Bless is the result of that lesson — a tool that values safety over convenience.\r\n\r\n- Emacs-like keybindings for editing multi-line SQL input.\r\n    - Pressing Enter inserts a line break by default.\r\n    - Use the ↑ (Up) arrow key or Ctrl-P to move the cursor to the previous line for editing.\r\n    - Press Ctrl-J or Ctrl-Enter to execute the input immediately.\r\n    - When you press Enter alone, the input is also executed if the last line ends with a semicolon or if the first word is a non-SQL command such as `EXIT` or `QUIT`.\r\n- Save the result of SELECT in CSV format\r\n- Supported RDBMS\r\n    - SQLite3\r\n    - Oracle\r\n    - PostgreSQL\r\n    - Microsoft SQL Server\r\n    - MySQL\r\n- Allows editing database records directly, similar to a spreadsheet (with the `EDIT` command)\r\n- Transaction mode (auto-commit disabled)\r\n    - A transaction is automatically started when executing DML (INSERT/UPDATE/DELETE)\r\n    - Users cannot input a BEGIN statement (transactions are managed automatically)\r\n    - Transactions can be ended with COMMIT or ROLLBACK\r\n    - Whether DDL (CREATE/ALTER/DROP etc.) can be executed inside a transaction depends on the database:\r\n        - **PostgreSQL**: All DDL can be executed inside a transaction except VACUUM, REINDEX, CLUSTER, CREATE/DROP DATABASE, and CREATE/DROP TABLESPACE\r\n        - **SQLite3**: All DDL can be executed inside a transaction except VACUUM\r\n        - **Oracle / SQL Server / MySQL**: DDL must be executed after ending the transaction with COMMIT or ROLLBACK\r\n        - If a transaction is still active when executing DDL, a warning will be displayed\r\n- Table name and column name completion\r\n    - Column name completion works only when the corresponding table name appears to the left of the cursor\r\n\r\n![image](./demo.gif)\r\n\r\n[Video](https://www.youtube.com/watch?v=_cxBQKpfUds) by [@emisjerry](https://github.com/emisjerry)\r\n\r\n| Key | Binding |\r\n|-----|---------|\r\n| `Enter`, `Ctrl`+`M` | Insert a newline or execute SQL if line ends with `;` or is a short command[^sc] |\r\n| `Ctrl`+`Enter`, `Meta`+`Enter`, `Ctrl`+`J` | Execute SQL |\r\n| `→`, `Ctrl`+`F` | Move Cursor forward |\r\n| `←`, `Ctrl`+`B` | Move Cursor backward |\r\n| `↑`, `Ctrl`+`P` | Move cursor to previous line or last line of previous SQL in history |\r\n| `↓`, `Ctrl`+`N` | Move cursor to next line or first line of next SQL in history |\r\n| `Ctrl`+`D` | Delete character or submit EOF (exit with rollback) |\r\n| `PageUp`, `Ctrl`+`↑`, `Meta`+`P` | Insert the previous SQL (history)|\r\n| `PageDown`, `Ctrl`+`↓`, `Meta`+`N`| Insert the next SQL (history) |\r\n| `Tab` | Table name and column name completion |\r\n\r\n`Meta` means either `Alt`+`key` or `Esc` followed by key.\r\n\r\n[^sc]: `DESC`, `EDIT`, `EXIT`, `HISTORY`, `HOST`, `QUIT`, `REM`, `SPOOL`, `START`, `\\D`\r\n\r\nSupported commands\r\n------------------\r\n\r\n- `SELECT` / `INSERT` / `UPDATE` / `DELETE` / `MERGE` ... `;`\r\n    - `INSERT`, `UPDATE`, `DELETE`, and `MERGE` automatically start a transaction.\r\n    - For these commands, input continues across lines until a semicolon (`;`) or the string specified with the `-term` option is entered.\r\n- `COMMIT`\r\n- `ROLLBACK` `;`  -- semicolon required\r\n- `SAVEPOINT savepoint;`  \r\n   (or `SAVE TRANSACTION savepoint;` for Microsoft SQL Server)\r\n- `ROLLBACK TO savepoint;`  \r\n   (or `ROLLBACK TRANSACTION savepoint;` for Microsoft SQL Server)\r\n- `SPOOL`\r\n    - `spool FILENAME` .. open FILENAME and write log and output.\r\n    - `spool off` .. stop spooling and close.\r\n- `EXIT` / `QUIT`\r\n    - Rollback a transaction and exit SQL-Bless.\r\n- `START filename`\r\n    - Start the SQL script given with filename\r\n- `REM comments`\r\n- `DESC [tablename]` / `\\D [tablename]`\r\n    - When a table name is specified, shows the schema of that table.\r\n    - If omitted, displays a list of tables.\r\n        - In the table list view, the following keys are available:\r\n        - `r`: Open the `EDIT` command for the selected table.\r\n        - `Enter`: Show the schema of the selected table.\r\n- `HISTORY`\r\n    - Show the history of input SQLs\r\n- `EDIT [tablename [WHERE conditions...]]`\r\n    - Start an [editor][csvi] to modify the selected records of the table.\r\n    - In the editor, these keys are bound.\r\n\r\n      | Key | Action |\r\n      | --- | --- |\r\n      | `r` | Replace cell value (using built-in readline) |\r\n      | `o` | Append a new row |\r\n      | `dd`, `dr` | **Delete the current row** |\r\n      | `x` | **Set the current cell to NULL** |\r\n      | `q` | Quit editor (with apply/discard confirmation) |\r\n\r\n      **Note:** The `D` key is disabled to prevent accidental execution due to terminal escape sequence delays. Please use `dd` or `dr` instead.\r\n\r\n    - Because the EDIT statement automatically generates SQL from data changed in the editor, it may not be able to properly represent SQL data for special types specific to individual databases. If you find it, we would appreciate it if you could [contact us](https://github.com/hymkor/sqlbless/issues/new).\r\n- `HOST command-line`\r\n    - Executes an operating system command.\r\n\r\n\u0026nbsp;\r\n\r\n- `;` (or the string specified with `-term string`) is a statement seperator when script is executed\r\n- When sql is input interactively, terminator string (`;` or the string specified with `-term string`) is ignored\r\n\r\nExample of a spooled file\r\n--------------------------\r\n\r\n``` CSV\r\n# (2023-04-17 22:52:16)\r\n# select *\r\n#   from tab\r\n#  where rownum \u003c 5\r\nTNAME,TABTYPE,CLUSTERID\r\nAQ$_INTERNET_AGENTS,TABLE,\u003cNULL\u003e\r\nAQ$_INTERNET_AGENT_PRIVS,TABLE,\u003cNULL\u003e\r\nAQ$_KEY_SHARD_MAP,TABLE,\u003cNULL\u003e\r\nAQ$_QUEUES,TABLE,\u003cNULL\u003e\r\n# (2023-04-17 22:52:20)\r\n# history\r\n0,2023-04-17 22:52:05,spool hoge\r\n1,2023-04-17 22:52:16,\"select *\r\n  from tab\r\n where rownum \u003c 5\"\r\n2,2023-04-17 22:52:20,history\r\n```\r\n\r\nInstall\r\n-------\r\n\r\nDownload the binary package from [Releases](https://github.com/hymkor/sqlbless/releases) and extract the executable.\r\n\r\n### via Scoop-installer (Windows)\r\n\r\n```\r\nscoop install https://raw.githubusercontent.com/hymkor/sqlbless/master/sqlbless.json\r\n```\r\n\r\nor\r\n\r\n```\r\nscoop bucket add hymkor https://github.com/hymkor/scoop-bucket\r\nscoop install sqlbless\r\n```\r\n\r\n### Installing via Go\r\n\r\n```\r\ngo install github.com/hymkor/sqlbless/cmd/sqlbless@latest\r\n```\r\n\r\nConfiguration\r\n-------------\r\n\r\nSQL-Bless does **not** rely on any external configuration files. All settings—including database connection parameters, output format, and other options—are specified directly via command-line arguments.\r\n\r\nFor convenience, you can wrap frequently used connection settings in a shell script or batch file. Sample scripts for various databases are provided in this repository (see `run-*.cmd`). This approach ensures predictable, repeatable startup behavior without relying on hidden configuration files.\r\n\r\nHow to start\r\n-------------\r\n\r\n    $ sqlbless {options} [DRIVERNAME] DATASOURCENAME\r\n\r\nDRIVERNAME can be omitted when DATASOURCENAME contains DRIVERNAME.\r\n\r\n### SQLite3\r\n\r\n    $ sqlbless sqlite3 :memory:\r\n    $ sqlbless sqlite3 path/to/file.db\r\n\r\n- The drivers used are https://github.com/glebarez/go-sqlite\r\n- [Example startup batch file](https://github.com/hymkor/sqlbless/blob/master/run-sqlite3.cmd)\r\n\r\n### Oracle\r\n\r\n    $ sqlbless oracle oracle://USERNAME:PASSWORD@HOSTNAME:PORT/SERVICE\r\n    $ sqlbless oracle://USERNAME:PASSWORD@HOSTNAME:PORT/SERVICE\r\n\r\n- The driver used is https://github.com/sijms/go-ora\r\n- [Example startup batch file](https://github.com/hymkor/sqlbless/blob/master/run-oracle.cmd)\r\n\r\n### PostgreSQL\r\n\r\n    $ sqlbless postgres host=127.0.0.1 port=5555 user=USERNAME password=PASSWORD dbname=DBNAME sslmode=disable\r\n    $ sqlbless postgres postgres://USERNAME:PASSWORD@127.0.0.1:5555/DBNAME?sslmode=verify-full\r\n    $ sqlbless postgres://USERNAME:PASSWORD@127.0.0.1:5555/DBNAME?sslmode=verify-full\r\n\r\n- The driver used is https://github.com/lib/pq\r\n- [Example startup batch file](https://github.com/hymkor/sqlbless/blob/master/run-psql.cmd)\r\n\r\n### SQL Server\r\n\r\n    $ sqlbless sqlserver sqlserver://@localhost?database=master\r\n\r\n( Windows authentication )\r\n\r\n    $ sqlbless sqlserver \"Server=localhost\\SQLEXPRESS;Database=master;Trusted_Connection=True;protocol=lpc\"\r\n\r\n- The driver used is https://github.com/microsoft/go-mssqldb\r\n- [Example startup batch file](https://github.com/hymkor/sqlbless/blob/master/run-mssql.cmd)\r\n\r\n### MySQL\r\n\r\n    $ sqlbless.exe mysql user:password@/database\r\n\r\n- The driver used is http://github.com/go-sql-driver/mysql\r\n- The `?parseTime=true\u0026loc=Local` parameter is preset, but it can be overridden\r\n- [Example startup batch file](https://github.com/hymkor/sqlbless/blob/master/run-mysql.cmd)\r\n\r\nCommon Options\r\n--------------\r\n\r\n- `-crlf`\r\n    - Use CRLF\r\n- `-fs string`\r\n    - Set a field separator (default: `\",\"`)\r\n- `-null string`\r\n    - Set a string representing NULL (default: \u0026#x2400;)\r\n- `-tsv`\r\n    - Use TAB as seperator\r\n- `-f string`\r\n    - Start the script\r\n- `-submit-enter`\r\n    - Submit by [Enter] and insert a new line by [Ctrl]-[Enter]\r\n- `-debug`\r\n    - Print type-information in the header of `SELECT` and `EDIT`\r\n- `-spool filename`\r\n    - Spool to filename from startup\r\n- `-help`\r\n    - Help\r\n* `-rv`\r\n    - Use color schemes designed for light (white) backgrounds.\r\n\r\n[csvi]: https://github.com/hymkor/csvi\r\n\r\n### Environment Variables\r\n\r\n- `NO_COLOR`\r\n  - If defined and non-empty, suppress all color output.\r\n  - If undefined, colors are displayed as usual.\r\n  - (Follows [https://no-color.org/](https://no-color.org/))\r\n- `RUNEWIDTH_EASTASIAN`\r\n  - `\"1\"` — Treat ambiguous-width Unicode characters as double-width (2 cells).\r\n  - Any other non-empty value — Treat them as single-width (1 cell).\r\n- `COLORFGBG`\r\n  - When defined in the form `(FG);(BG)`, where `(FG)` and `(BG)` are integers representing the foreground and background colors respectively, and `(FG)` is less than `(BG)`, CSVI assumes a light background and uses colors suitable for it (equivalent to `-rv`).\r\n\r\nAcknowledgements\r\n-----------------\r\n\r\n- [emisjerry (emisjerry)](https://github.com/emisjerry) - [#1],[#2],[Movie]\r\n\r\n[#1]: https://github.com/hymkor/sqlbless/issues/1\r\n[#2]: https://github.com/hymkor/sqlbless/issues/2\r\n[Movie]: https://youtu.be/_cxBQKpfUds\r\n\r\nAuthor\r\n------\r\n\r\n[hymkor (HAYAMA Kaoru)](https://github.com/hymkor)\r\n\r\nLicense\r\n-------\r\n\r\nMIT License\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhymkor%2Fsqlbless","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhymkor%2Fsqlbless","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhymkor%2Fsqlbless/lists"}