Skip to content

Releases: hymkor/sqlbless

v0.27.0

01 Dec 19:28

Choose a tag to compare

Changes in v0.27.0 (English)

Bug fixes

  • Fix: Errors were not reported during execution of SAVEPOINT and SAVE TRANSACTION. (#19)
  • SQL Server: Fixed an issue where ROLLBACK TRANSACTION without a savepoint was not recognized as ending the transaction, causing the prompt to remain as SQL*. (#22)

Specification Changes

  • Enable RELEASE SAVEPOINT(#19), REPLACE INTO(#20,MySQL) and SET(#21) to execute within a transaction.

Changes in v0.27.0 (Japanese)

不具合修正

  • SAVEPOINT, SAVE TRANSACTION の実行中にエラーが発生してもメッセージが表示されなかった問題を修正 (#19)
  • SQL Server: SAVEPOINT を指定しない ROLLBACK TRANSACTION でトランザクションは終了するのに、それを認識せず、プロンプトがトランザクション中を意味する SQL* のままになっていた問題を修正 (#22)

仕様変更

  • RELEASE SAVEPOINT (#19), REPLACE INTO (#20,MySQL), SET(#21) もトランザクション内で実行できるようにした。

v0.26.0

11 Nov 00:26

Choose a tag to compare

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 Enter on the result of the desc command (table list) did not show the column (desc TABLE) for the selected table on databases other than SQLite3. (#16)
  • Fix issue where edit could not launch due to MySQL identifier quoting
    • Launching edit from desc without arguments using the r key for table selection (#17)
    • Launching edit from edit without arguments using Enter key for table selection (#18)

Specification changes

  • Support SAVEPOINT as a TCL command (#11)
  • Support SAVE TRANSACTION as a TCL command (#14)
  • Support ROLLBACK TO (or ROLLBACK TRANSACTION) as a TCL command (#11)
  • Require ; after ROLLBACK to prevent accidental execution (#11)
  • Script execution improvements (#12):
    • Fix: correct handling of io.EOF
    • Suppress output of empty lines and leading/trailing spaces
    • Fix: CSVI launched by SELECT in a script now terminates automatically with >, q, and y

Internal changes

  • Refactor dialect subpackage: renamed fields and methods for clarity (#8)
  • Switched terminal input API calls to use go-ttyadapter v0.2.0 (#9)

Changes in v0.26.0 (Japanese)

不具合修正

  • 補完で、現在の単語が空の場合にカーソルが前の単語の先頭に移動してしまう不具合を修正 (#15,go-readline-ny v1.12.3 #17)
  • SQLite3 以外のデータベースで、引数なしのdesc コマンド(テーブル一覧)の中から Enter を押下して、該当行のテーブルのカラム一覧を表示できなかった不具合を修正 (#16)
  • MySQL で識別子の引用符が原因で edit コマンドが起動できなかった問題を修正
    • 引数なしの desc コマンド中で、r キーによるテーブル選択から edit を起動 (#17)
    • 引数なしの edit コマンド中で、Enter キーによるテーブル選択から起動 (#18)

仕様変更

  • SAVEPOINT を TCL コマンドとしてサポート (#11)
  • SAVE TRANSACTION を TCL コマンドとしてサポート (#14)
  • ROLLBACK TO(もしくは ROLLBACK TRANSACTION)を TCL コマンドとしてサポート (#11)
  • 誤操作防止のため、ROLLBACK には ; を必須とした (#11)
  • スクリプト実行時の修正 (#12)
    • io.EOF が誤ってエラーとして扱われていた問題を修正した
    • SQL のログ出力で、空行や行頭・行末の空白が出力されないようにした
    • SELECT で起動した CSVI は、>, q, y の操作で自動的に終了するようにした

内部修正

  • サブパッケージ dialect をリファクタリング: フィールド・メソッドを改名 (#8)
  • 端末入力系の API 呼び出しを go-ttyadapter v0.2.0 へ切替え (#9)

v0.25.0

03 Nov 07:20

Choose a tag to compare

Changes in v0.25.0 (English)

Bug fixes

  • host and start: 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 r in the desc command without a table name now launches the edit command for the table under the cursor.
  • Pressing Enter in the desc command without a table name now launches desc command for the table under the cursor.
  • Running edit without arguments now opens a table selection mode.
  • The Oracle MERGE statement is now treated as a DML command.
  • COMMIT and ROLLBACK can now be executed without a semicolon (;).
  • Added support for the NO_COLOR environment 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 test framework 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 扱いするようにした。
  • COMMITROLLBACK もセミコロンなしで実行できる1行コマンドとした。
  • カラー出力を抑制する環境変数の NO_COLOR をサポート (#6)

内部的な変更

  • 依存パッケージを更新 (go-multiline-ny v0.22.1, go-box v3) (#4)
  • テーブル名・カラム名補完の際に使用していた context.TODO()completion.CmdCompletionOrList.CandidatesContext が提供するコンテキストに変更 (#5)
  • Linux 環境や GitHub Actions からテストができるよう、PowerShell 7 で記述していた SQLite3 を使ったテストを、go test に置き変えた (#7)

v0.24.0

25 Oct 12:23

Choose a tag to compare

Changes in v0.24.0 (English)

  • Fixed an issue in the edit command where table names containing spaces were incorrectly expanded in SQL statements.
  • Changed SQLite3 placeholders from ? to bind variables in the $v%d format.
  • 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 PRAGMA commands, similar to SELECT and DESC.
  • Enabled syntax highlighting for the HOST command and filename completion after HOST.

Changes in v0.24.0 (Japanese)

  • edit文において、行追加・更新時の SQL 上で、空白を含んだテーブル名がおかしい展開をされていた問題を修正
  • SQLite3 でプレースホルダーとして $v%d 形式のバインド変数を使うようにした
  • 対話モードでトランザクションが未完了の状態で Ctrl-Dexitquit によって終了しようとした場合、transaction is not closed. Please Commit or Rollback と表示して終了を防止するようにした。 このチェックはスクリプト実行時には行われない。
  • コマンドライン編集中の Ctrl-C で SQL-Bless が終了してしまっていたが、現在入力中の SQL の破棄するだけに変更した。
  • SQLite3 の PRAGMA コマンドでも、SELECTDESC と同様にレコードを表示できるようにした。
  • OSコマンドを実行する HOST に対してシンタックスハイライトを適用。また、HOST 以降でファイル名補完が聞くようにした

v0.23.0

14 Oct 03:08

Choose a tag to compare

Changes in v0.23.0 (English)

  • For non-DML SQL, "database/sql".Conn is 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 BEGIN statements
    • Transactions are automatically started internally, and using BEGIN could cause inconsistencies
  • 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 -rv option 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[6n is not supported, the program now continues without aborting.
      • Skipped the measurement of ambiguous-width Unicode characters when the environment variable RUNEWIDTH_EASTASIAN is defined.
    • Suppress color output if the NO_COLOR environment variable is set (following https://no-color.org/ )
    • When the environment variable COLORFGBG is 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).

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

05 Oct 07:46

Choose a tag to compare

Changes in v0.22.0 (English)

  • On the edit command:
    • Unified the exit operation to the ESC key
      • ESC + y: Apply changes and exit
      • ESC + n: Discard changes and exit
      • c: Still supported but deprecated
      • q: Now equivalent to ESC
    • 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
  • 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

27 Sep 13:37

Choose a tag to compare

Changes in v0.21.0 (English)

  • edit command
    • Changed to use placeholders for value specification
    • Modified SQLite3 datetime column updates to normalize values in WHERE clauses according to column type:
      • DATETIME / TIMESTAMP columns → datetime()
      • DATE columns → date()
      • TIME columns → time()
        This ensures updates work regardless of whether ISO8601 strings contain T or Z
    • 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 edit command wrote the pre-edit SELECT results to the spool destination.
      ( The select command 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 FILENAME option to enable spooling from startup.
  • Added the host command to execute operating system commands.

Changes in v0.21.0 (Japanese)

  • edit コマンド
    • 値の指定にプレースホルダーを利用するよう変更
    • SQLite3 の日時列更新において、列の型に応じて以下の関数で正規化して比較するよう変更
      • DATETIME / TIMESTAMP 列 → datetime()
      • DATE 列 → date()
      • TIME 列 → time()
        この結果、ISO8601 文字列に TZ が含まれていても、含まれていなくても更新できるよう改善
    • 他のコマンドと同様、更新件数が 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

14 Sep 02:12

Choose a tag to compare

v0.20.0 Pre-release
Pre-release

Changes in v0.20.0 (English)

  • Bug Fixes
    • Fixed an issue where the EDIT command 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 DESC or \D commands were used without a table name.
  • Application Changes
    • Changed the representation of NULL from <NULL> to the Unicode character U+2400 (␀, SYMBOL FOR NULL).
    • In the EDIT command, setting a non-string cell to an empty string now results in NULL.
    • If the first DML affected zero rows, the transaction is not started and the prompt remains SQL>.
    • DESC and \D commands without a table name, and table name completion now exclude non-user tables.
  • Library Changes
    • Refactored the codebase: split the main package "sqlbless" into subpackages "dialect", "rowstocsv", and "spread".
    • Moved the database-specific customization packages under "dialect".

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 コマンドや、テーブル名補完では、ユーザーテーブル以外のオブジェクトは出さないようにした
  • ライブラリ仕様変更
    • 全体をリファクタリングし、メインパッケージ "sqlbless" からサブパッケージ "dialect", "rowstocsv","spread" にコードを分離した
    • DB ごとのカスタマイズパッケージのパスを "dialect" の下へ移動

v0.19.0

06 Sep 06:09

Choose a tag to compare

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

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

25 Jun 16:45

Choose a tag to compare

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以降で稼動できるようにした。