Skip to content

Commit 017f489

Browse files
authored
Merge pull request #16 from hymkor/push-xqoystklvoql
`desc` → `Enter` failed on Non-SQLite DBs
2 parents 40d2c01 + 58140fe commit 017f489

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

commands.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ import (
1515
"github.com/hymkor/sqlbless/internal/misc"
1616
)
1717

18-
func doSelect(ctx context.Context, ss *session, query string, v *spread.Viewer, pilot commandIn) error {
18+
func doSelect(ctx context.Context, ss *session, query string, v *spread.Viewer, pilot commandIn, args ...any) error {
1919
var rows *sql.Rows
2020
var err error
2121
if ss.tx != nil {
22-
rows, err = ss.tx.QueryContext(ctx, query)
22+
rows, err = ss.tx.QueryContext(ctx, query, args...)
2323
} else {
24-
rows, err = ss.conn.QueryContext(ctx, query)
24+
rows, err = ss.conn.QueryContext(ctx, query, args...)
2525
}
2626
if err != nil {
2727
return fmt.Errorf("query: %[1]w (%[1]T)", err)
@@ -180,7 +180,7 @@ func doDescColumns(ctx context.Context, ss *session, table string, commandIn com
180180
if ss.Debug {
181181
fmt.Println(query)
182182
}
183-
return doSelect(ctx, ss, query, newViewer(ss), commandIn)
183+
return doSelect(ctx, ss, query, newViewer(ss), commandIn, table)
184184
}
185185

186186
func doDesc(ctx context.Context, ss *session, table string, commandIn commandIn) error {

release_note_en.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
### Bug fixes
44

55
- Fix: completion — cursor moved to the start of the previous word when the current word was empty (#15, [go-readline-ny #17](https://github.com/nyaosorg/go-readline-ny/pull/17))
6+
- 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)
67

78
### Specification changes
89

release_note_ja.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
### 不具合修正
44

55
- 補完で、現在の単語が空の場合にカーソルが前の単語の先頭に移動してしまう不具合を修正 (#15,[go-readline-ny v1.12.3 #17](https://github.com/nyaosorg/go-readline-ny/pull/17))
6+
- SQLite3 以外のデータベースで、引数なしのdesc コマンド(テーブル一覧)の中から `Enter` を押下して、該当行のテーブルのカラム一覧を表示できなかった不具合を修正 (#16)
67

78
### 仕様変更
89

0 commit comments

Comments
 (0)