Releases: hymkor/sqlbless
Releases · hymkor/sqlbless
v0.27.0
Changes in v0.27.0 (English)
Bug fixes
- Fix: Errors were not reported during execution of
SAVEPOINTandSAVE TRANSACTION. (#19) - SQL Server: Fixed an issue where
ROLLBACK TRANSACTIONwithout a savepoint was not recognized as ending the transaction, causing the prompt to remain asSQL*. (#22)
Specification Changes
- Enable
RELEASE SAVEPOINT(#19),REPLACE INTO(#20,MySQL) andSET(#21) to execute within a transaction.
Changes in v0.27.0 (Japanese)
不具合修正
SAVEPOINT,SAVE TRANSACTIONの実行中にエラーが発生してもメッセージが表示されなかった問題を修正 (#19)- SQL Server: SAVEPOINT を指定しない
ROLLBACK TRANSACTIONでトランザクションは終了するのに、それを認識せず、プロンプトがトランザクション中を意味するSQL*のままになっていた問題を修正 (#22)
仕様変更
v0.26.0
Changes in v0.26.0 (English)
Bug fixes
- Fix: completion — cursor moved to the start of the previous word when the current word was empty (#15, go-readline-ny #17)
- Fix: an issue where pressing
Enteron the result of thedesccommand (table list) did not show the column (desc TABLE) for the selected table on databases other than SQLite3. (#16) - Fix issue where
editcould not launch due to MySQL identifier quoting
Specification changes
- Support
SAVEPOINTas a TCL command (#11) - Support
SAVE TRANSACTIONas a TCL command (#14) - Support
ROLLBACK TO(orROLLBACK TRANSACTION) as a TCL command (#11) - Require
;afterROLLBACKto prevent accidental execution (#11) - Script execution improvements (#12):
- Fix: correct handling of
io.EOF - Suppress output of empty lines and leading/trailing spaces
- Fix:
CSVIlaunched bySELECTin a script now terminates automatically with>,q, andy
- Fix: correct handling of
Internal changes
- Refactor
dialectsubpackage: renamed fields and methods for clarity (#8) - Switched terminal input API calls to use
go-ttyadapterv0.2.0 (#9)
Changes in v0.26.0 (Japanese)
不具合修正
- 補完で、現在の単語が空の場合にカーソルが前の単語の先頭に移動してしまう不具合を修正 (#15,go-readline-ny v1.12.3 #17)
- SQLite3 以外のデータベースで、引数なしのdesc コマンド(テーブル一覧)の中から
Enterを押下して、該当行のテーブルのカラム一覧を表示できなかった不具合を修正 (#16) - MySQL で識別子の引用符が原因で
editコマンドが起動できなかった問題を修正
仕様変更
SAVEPOINTを TCL コマンドとしてサポート (#11)SAVE TRANSACTIONを TCL コマンドとしてサポート (#14)ROLLBACK TO(もしくはROLLBACK TRANSACTION)を TCL コマンドとしてサポート (#11)- 誤操作防止のため、
ROLLBACKには;を必須とした (#11) - スクリプト実行時の修正 (#12)
io.EOFが誤ってエラーとして扱われていた問題を修正した- SQL のログ出力で、空行や行頭・行末の空白が出力されないようにした
SELECTで起動したCSVIは、>,q,yの操作で自動的に終了するようにした
内部修正
v0.25.0
Changes in v0.25.0 (English)
Bug fixes
hostandstart: Fixed a panic in filename completion when the last token was an empty string.
(#4, go-readline-ny#10, Fixed in go-readline-ny v1.21.1 )
Specification changes
- Pressing
rin thedesccommand without a table name now launches theeditcommand for the table under the cursor. - Pressing
Enterin thedesccommand without a table name now launchesdesccommand for the table under the cursor. - Running
editwithout arguments now opens a table selection mode. - The Oracle
MERGEstatement is now treated as a DML command. COMMITandROLLBACKcan now be executed without a semicolon (;).- Added support for the
NO_COLORenvironment variable to disable colored output. (#6)
Internal changes
- Updated internal dependencies (go-multiline-ny v0.22.1, go-box v3) (#4)
- Use context from completion.CmdCompletionOrList.CandidatesContext instead of context.TODO() (#5)
- Rewrote the SQLite3 test written in PowerShell 7 using Go’s standard
go testframework to enable testing on Linux and GitHub Actions. (#7)
Changes in v0.25.0 (Japanese)
不具合修正
host文,start文: 最後のトークンが空文字列のときにファイル名補完で panic が発生する問題を修正
(#4, go-readline-ny#10, go-readline-ny v1.21.1 にて修正)
仕様変更
- テーブル名指定なしの
descコマンド中にrを押下すると、edit (カーソル行のテーブル名)を起動するようにした - テーブル名指定なしの
descコマンド中にEnterを押下すると、desc (カーソル行のテーブル名)を起動するようにした - 引数なしで
editコマンドが起動された時、カーソルでテーブルを選択するモードを起動するようにした。 - Oracle の
MERGE文も DML 扱いするようにした。 COMMITやROLLBACKもセミコロンなしで実行できる1行コマンドとした。- カラー出力を抑制する環境変数の
NO_COLORをサポート (#6)
内部的な変更
v0.24.0
Changes in v0.24.0 (English)
- Fixed an issue in the
editcommand where table names containing spaces were incorrectly expanded in SQL statements. - Changed SQLite3 placeholders from
?to bind variables in the$v%dformat. - In interactive mode, SQL-Bless now prevents exiting (
Ctrl-D,exit,quit) while a transaction is open, showing:transaction is not closed. Please Commit or Rollback.This check is skipped during script execution. - Modified Ctrl-C behavior during command-line editing. Instead of terminating SQL-Bless, it now cancels (discards) the SQL statement currently being edited.
- Enabled record-style display for SQLite3
PRAGMAcommands, similar toSELECTandDESC. - Enabled syntax highlighting for the
HOSTcommand and filename completion afterHOST.
Changes in v0.24.0 (Japanese)
edit文において、行追加・更新時の SQL 上で、空白を含んだテーブル名がおかしい展開をされていた問題を修正- SQLite3 でプレースホルダーとして
$v%d形式のバインド変数を使うようにした - 対話モードでトランザクションが未完了の状態で
Ctrl-D、exit、quitによって終了しようとした場合、transaction is not closed. Please Commit or Rollbackと表示して終了を防止するようにした。 このチェックはスクリプト実行時には行われない。 - コマンドライン編集中の
Ctrl-Cで SQL-Bless が終了してしまっていたが、現在入力中の SQL の破棄するだけに変更した。 - SQLite3 の
PRAGMAコマンドでも、SELECTやDESCと同様にレコードを表示できるようにした。 - OSコマンドを実行する
HOSTに対してシンタックスハイライトを適用。また、HOST以降でファイル名補完が聞くようにした
v0.23.0
Changes in v0.23.0 (English)
- For non-DML SQL,
"database/sql".Connis now used instead of"database/sql".DB- This ensures the same connection is used continuously, avoiding potential issues caused by using different connections for consecutive SQL statements
- Users can no longer use
BEGINstatements- Transactions are automatically started internally, and using
BEGINcould cause inconsistencies
- Transactions are automatically started internally, and using
- Behavior of DDL execution within transactions has been improved
- Previously, all DDL was disallowed within transactions; now the database-specific rules determine which statements can run
- PostgreSQL: All statements are allowed except
VACUUM,REINDEX,CLUSTER,CREATE/DROP DATABASE,CREATE/DROP TABLESPACE - SQLite3: All statements are allowed except
VACUUM
- Update csvi package to v1.15.0 + snapshot:
- Added key bindings
]and[to adjust the width of the current column (widen and narrow, respectively). - Added
-rvoption to prevent unnatural colors on terminals with a white background - At startup, the width of ambiguous-width Unicode characters was being measured, but on terminals that do not support the cursor position query sequence
ESC[6n, this could cause a hang followed by an error. To address this:- If
ESC[6nis not supported, the program now continues without aborting. - Skipped the measurement of ambiguous-width Unicode characters when the environment variable
RUNEWIDTH_EASTASIANis defined.
- If
- Suppress color output if the
NO_COLORenvironment variable is set (following https://no-color.org/ ) - When the environment variable
COLORFGBGis defined in the form(FG);(BG)and(FG)is less than(BG), the program now uses color settings designed for light backgrounds (equivalent to-rv).
- Added key bindings
Changes in v0.23.0 (Japanese)
- DML 以外の SQL について、
"database/sql".DBの代わりに"database/sql".Connを使用するようにした- 前後の SQL で別の接続が使われることで発生しうるトラブルを防ぐため、同一接続を継続使用するように変更
- BEGIN 文をユーザが使用できないようにした
- トランザクションは内部で自動開始されるため、BEGIN を使うと不整合が起こる可能性がある
- トランザクション中の DDL 実行に関する挙動を改善
- 従来は一律不可としていたが、データベースごとに実行可能な文を判定するように変更
- PostgreSQL:
VACUUM,REINDEX,CLUSTER,CREATE/DROP DATABASE,CREATE/DROP TABLESPACE以外はトランザクション内で実行可能 - SQLite3:
VACUUM以外はトランザクション内で実行可能
- CSVI を v1.15.0 + snapshot へ更新:
- カーソル列の幅を広げる
]と、縮める[を実装 - 白背景の端末でも色が不自然にならないよう、
-rvオプションを追加 - 起動時に曖昧幅の Unicode 文字の表示幅を計測していたが、カーソル位置を取得するシーケンス
ESC[6nをサポートしない端末では、入力待ちのままエラー終了してしまう問題があった。そのため:ESC[6nが無効な場合でもエラーとせず、編集を継続できるようにした。- 環境変数
RUNEWIDTH_EASTASIANが定義されていたら、曖昧幅の Unicode 文字の幅計測を省くようにした。
- 環境変数
NO_COLORが定義されている場合、カラー表示を抑制するようにした ( https://no-color.org/ に準拠 ) - 環境変数
COLORFGBGが(FG);(BG)形式で定義されており、(FG) が (BG) より小さい整数の時、白背景を想定した色使いをするようにした (-rvと等価)
- カーソル列の幅を広げる
v0.22.0
Changes in v0.22.0 (English)
- On the
editcommand:- Unified the exit operation to the
ESCkeyESC+y: Apply changes and exitESC+n: Discard changes and exitc: Still supported but deprecatedq: Now equivalent toESC
- Changed the brackets around the table name display from
【】to[] - Added options to apply all (
a) or discard all (N) when applying changes - Adjusted confirmation SQL output to reduce line usage: SET clause, WHERE clause, and parameter list are now shown on a single line each
- Unified the exit operation to the
- Modified the existing CRLF mode to avoid using golang.org/x/text/transform.
Changes in v0.22.0 (Japanese)
editコマンド- 終了操作を
ESCキーに一本化したESC+y: 変更を適用して終了ESC+n: 変更を破棄して終了c: まだ利用可能だが、廃止予定q:ESCと等価
- テーブル名表示を囲む括弧の種類を 【】から [] に変更
- 変更適用時の選択肢に、全てを適用する
a、全て破棄するNを追加した - 確認用の SQL が行数をとりすぎるので、SET句、WHERE句、引数リストはそれぞれ一行におさめるようにした
- 終了操作を
- CRLF モードの実装で、golang.org/x/text/transform を使用しないようにした
v0.21.0
Changes in v0.21.0 (English)
editcommand- Changed to use placeholders for value specification
- Modified SQLite3 datetime column updates to normalize values in
WHEREclauses according to column type:DATETIME/TIMESTAMPcolumns →datetime()DATEcolumns →date()TIMEcolumns →time()
This ensures updates work regardless of whether ISO8601 strings containTorZ
- Aligned behavior with other commands: if the number of affected rows is zero, no transaction is started and the prompt remains at
SQL> - Removed the behavior where the
editcommand wrote the pre-edit SELECT results to the spool destination.
( Theselectcommand continues to output to the spool destination as before. )
- In command-line input, pressing Enter alone previously did not terminate input unless the last line ended with a semicolon. This has been changed so that if the input line begins with one of the following command names, it is executed immediately without requiring a semicolon.
DESC,EDIT,EXIT,HISTORY,HOST,QUIT,REM,SPOOL,START,\D
- Added the
-spool FILENAMEoption to enable spooling from startup. - Added the
hostcommand to execute operating system commands.
Changes in v0.21.0 (Japanese)
editコマンド- 値の指定にプレースホルダーを利用するよう変更
- SQLite3 の日時列更新において、列の型に応じて以下の関数で正規化して比較するよう変更
DATETIME/TIMESTAMP列 →datetime()DATE列 →date()TIME列 →time()
この結果、ISO8601 文字列にTやZが含まれていても、含まれていなくても更新できるよう改善
- 他のコマンドと同様、更新件数が 0 件の場合はトランザクションを開始せず、プロンプトを
SQL>のまま維持するように変更 editコマンドで、編集前の SELECT 結果を spool 先に出力していた動作を廃止
(selectコマンドについては、従来どおり spool 先にも出力する動作を維持 )
- コマンドライン入力で Enter のみを押下した場合、従来は末尾にセミコロンがなければ入力継続とみなしていたが、入力行が以下のコマンド名で始まる場合は、セミコロンがなくても即時に実行するように変更した。
DESC,EDIT,EXIT,HISTORY,HOST,QUIT,REM,SPOOL,START,\D
- 起動時からスプール可能にする
-spool FILENAMEオプションを追加。 - OSコマンドを実行する
hostコマンドを追加。
v0.20.0
Changes in v0.20.0 (English)
- Bug Fixes
- Fixed an issue where the
EDITcommand failed to update tables containing date columns in SQLite3 databases. - Fixed an issue where shared memory connections to SQL Server were not working
- The required subpackage
"github.com/microsoft/go-mssqldb/sharedmemory"was not imported - When using shared memory connections, the connection string must include the parameter
protocol=lpc
Example:server=localhost\SQLEXPRESS01;database=master;trusted_connection=yes;protocol=lpc;
Ref: microsoft/go-mssqldb#96 - Titles were empty when
DESCor\Dcommands were used without a table name.
- The required subpackage
- Fixed an issue where the
- Application Changes
- Changed the representation of
NULLfrom<NULL>to the Unicode character U+2400 (␀, SYMBOL FOR NULL). - In the
EDITcommand, setting a non-string cell to an empty string now results inNULL. - If the first DML affected zero rows, the transaction is not started and the prompt remains
SQL>. DESCand\Dcommands without a table name, and table name completion now exclude non-user tables.
- Changed the representation of
- Library Changes
- Refactored the codebase: split the main package
"sqlbless"into subpackages"dialect","rowstocsv", and"spread". - Moved the database-specific customization packages under
"dialect".
- Refactored the codebase: split the main package
Changes in v0.20.0 (Japanese)
- 不具合修正
- EDIT コマンドで、SQLite3 データベースで日付カラムを含むテーブルに対する更新が失敗していた
- SQL Server で共有メモリ接続ができなかった問題を修正
- 必要なサブパッケージ
"github.com/microsoft/go-mssqldb/sharedmemory"が import されていなかった - 共有メモリ接続を行う場合は、接続文字列にパラメータ
protocol=lpcを指定する必要があります
例:Server=localhost\SQLEXPRESS01;Database=master;Trusted_Connection=True;protocol=lpc;
参考: microsoft/go-mssqldb#96
- 必要なサブパッケージ
- テーブル名なしの
DESC,\Dコマンドで、タイトルが空になっていた
- アプリ仕様変更
- NULL を
<NULL>と表現していたのを Unicode U+2400 (␀, SYMBOL FOR NULL) を用いるようにした - EDIT コマンドで非文字列系セルを0文字にした時、NULL とするようにした。
- 最初の DML が更新行ゼロだった場合は、トランザクションを開始せずプロンプトを SQL> のままにした。
- テーブル名なしの
DESC,\Dコマンドや、テーブル名補完では、ユーザーテーブル以外のオブジェクトは出さないようにした
- NULL を
- ライブラリ仕様変更
- 全体をリファクタリングし、メインパッケージ
"sqlbless"からサブパッケージ"dialect","rowstocsv","spread"にコードを分離した - DB ごとのカスタマイズパッケージのパスを
"dialect"の下へ移動
- 全体をリファクタリングし、メインパッケージ
v0.19.0
Changes in v0.19.0 (English)
- Parameters for the START command are now completed as filenames.
- EDIT, DESC, \D commands complete a table name now.
- Update the SKK library: go-readline-skk to v0.6.0:
- Enabled conversion and word registration for words containing slashes in the conversion result
- Added support for evaluating certain Emacs Lisp forms in conversion results, such as
(concat),(pwd),(substring), and(skk-current-date)(but not(lambda)yet)
- Update the spread library: csvi to v1.14.0:
- Added search command (
*and#) to find the next occurrence of the current cell's content
- Added search command (
Changes in v0.19.0 (Japanese)
- START コマンドでは、パラメータをファイル名として補完するようにした。
- EDIT, DESC, \D コマンドでもテーブル名を補完するようにした。
- SKK かな漢字変換ライブラリ go-readline-skk を v0.6.0 へ更新:
- 変換結果にスラッシュを含む単語も変換・単語登録できるようにした
- emacslisp で書かれた変換結果について
(concat),(pwd),(substring),(skk-current-date)程度は評価できるようにした ((lambda)はまだ)
- スプレッドライブラリ csvi をv1.14.0 へ更新:
- 現在カーソルがあるセルの内容で検索するコマンド
*,#を追加
- 現在カーソルがあるセルの内容で検索するコマンド
v0.18.0
Changes in v0.18.0 (English)
- Updated go-readline-ny to v1.9.1
- Updated go-multiline-ny to v0.21.0
- Added yellow syntax highlighting for comments.
- Switched to using
"go-multiline-ny/completion".CmdCompletionOrList.
- Added support for table name and column name completion (column name completion works only when the corresponding table name appears to the left of the cursor).
- Fix duplicate reading of script content in START command
- Made it possible to build with Go 1.20.14 to support Windows 7, 8, and Server 2008 or later.
Changes in v0.18.0 (Japanese)
- go-readline-ny をv1.9.1 へ更新
- go-multiline-ny を v0.21.0 へ更新
- コメントにも色(黄色)をつけるようにした
"go-multiline-ny/completion".CmdCompletionOrListを使うようにした
- テーブル名・カラム名補完をサポート(ただし、カラム名補完はテーブル名がカーソルより左側に登場している時のみ)
- STARTコマンドの中で、スクリプトの内容を重複して読んでしまう不具合を修正した
- Go 1.20.14 でビルドし、Windows 7,8, Server2008以降で稼動できるようにした。