mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-08-17 06:44:19 +02:00
Only set last_pk on singular .insert()/.update(), refs #98
This commit is contained in:
parent
6161ebf4de
commit
635c91475a
3 changed files with 41 additions and 14 deletions
|
|
@ -135,7 +135,12 @@ def test_create_table_with_not_null(fresh_db):
|
|||
),
|
||||
)
|
||||
def test_create_table_from_example(fresh_db, example, expected_columns):
|
||||
fresh_db["people"].insert(example)
|
||||
people_table = fresh_db["people"]
|
||||
assert None == people_table.last_rowid
|
||||
assert None == people_table.last_pk
|
||||
people_table.insert(example)
|
||||
assert 1 == people_table.last_rowid
|
||||
assert 1 == people_table.last_pk
|
||||
assert ["people"] == fresh_db.table_names()
|
||||
assert expected_columns == [
|
||||
{"name": col.name, "type": col.type} for col in fresh_db["people"].columns
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue