dbcli / dbcli/litecli

Automatically decode hex for BLOB fields.

Đang mở
#244 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
3.3k
Fork
95
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

LiteCLI has a terrific feature in which BLOB fields (e.g. used to store an UUID primary key) are automatically encoded for display as hex:

```
CREATE TABLE notes (
id BLOB PRIMARY KEY,
content TEXT NOT NULL
)

notes.db>
+------------------------------------+---------------------------------------------------+
| id | content |
+------------------------------------+---------------------------------------------------+
| 0x019b5525a6f878709a20d7da96f5e599 | Note the first. |
+------------------------------------+---------------------------------------------------+
```

However, that hex value can not be used in a query:

```
notes.db> select * from notes where id = '0x019b5525a6f878709a20d7da96f5e599';
0 rows in set
Time: 0.000s

notes.db> select * from notes where id = '019b5525a6f878709a20d7da96f5e599';
0 rows in set
Time: 0.000s
```

**Please consider automatically decoding hex values used on BLOB fields.**

For reference, this is what the SELECT query looks like in sqlite3:

```
sqlite> select id, content from notes;
+------------+---------------------------------------------------+
| id | content |
+------------+---------------------------------------------------+
| | Note the first. |
| �U%��xp� �ږ��� | |
+------------+---------------------------------------------------+
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.