Automatically decode hex for BLOB fields.
- 主要语言
- Python
- 星标
- 3.3k
- 派生
- 95
- PR 合并指标
- 30 天内没有已合并 PR
描述
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� �ږ��� | |
+------------+---------------------------------------------------+
```
贡献指南
调研方向
首先跟踪 LiteCLI 如何执行所示的 SELECT 查询,以及 SQLite BLOB 值如何表示以供输入和显示。复现 notes 表示例,然后定义并测试带 0x 前缀和不带前缀的十六进制值的预期行为;当显示的值可以用于检索匹配的 BLOB 行时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python, sqlite
- 领域
- cli, databases
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100