AnswerDotAI / AnswerDotAI/sqlite-minutils

last_rowid returns `int ROWID` on non-`int` PKs

未关闭
#20 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
17
派生
9
PR 合并指标
30 天内没有已合并 PR

描述

## Description

Non-int last_pk are called incorrectly, or the table continues to have a ROWID. This results in that `last_id` check on any DB change returns the hidden `int ROWID` rather than whatever the pk was set to.

- https://www.sqlite.org/c3ref/last_insert_rowid.html
- https://www.sqlite.org/withoutrowid.html

## Test

```sh
python tests/test_upsert.py::test_upsert_with_hash_id
```

贡献指南

这个仓库没有索引到贡献指南

调研方向

首先运行 tests/test_upsert.py::test_upsert_with_hash_id,并阅读链接的 SQLite 文档中关于 last_insert_rowid 和 WITHOUT ROWID 表的内容。跟踪非整数主键的 last_rowid 行为。当 last_id 检查返回分配的主键值,而不是隐藏的整数 ROWID 时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
python, sqlite
领域
database
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。