AnswerDotAI / AnswerDotAI/sqlite-minutils

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

オープン
#20 コメント 0 件 リアクション 0 件 担当者 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 を実行し、last_insert_rowid と WITHOUT ROWID テーブルに関するリンク先の SQLite ドキュメントを読んでください。整数ではない主キーに対する last_rowid の挙動を追跡してください。last_id のチェックが、隠れた整数 ROWID ではなく、割り当てられた主キー値を返すようになれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python, sqlite
領域
database
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。