mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-08-01 15:04:11 +02:00
New db.query() method, refs #290
This commit is contained in:
parent
8cedc6a8b2
commit
9faeef230b
3 changed files with 31 additions and 28 deletions
|
|
@ -827,8 +827,8 @@ def test_insert_thousands_adds_extra_columns_after_first_100_with_alter(fresh_db
|
|||
+ [{"i": 101, "extra": "Should trigger ALTER"}],
|
||||
alter=True,
|
||||
)
|
||||
rows = fresh_db.execute_returning_dicts("select * from test where i = 101")
|
||||
assert [{"i": 101, "word": None, "extra": "Should trigger ALTER"}] == rows
|
||||
rows = list(fresh_db.query("select * from test where i = 101"))
|
||||
assert rows == [{"i": 101, "word": None, "extra": "Should trigger ALTER"}]
|
||||
|
||||
|
||||
def test_insert_ignore(fresh_db):
|
||||
|
|
@ -839,8 +839,8 @@ def test_insert_ignore(fresh_db):
|
|||
# Using ignore=True should cause our insert to be silently ignored
|
||||
fresh_db["test"].insert({"id": 1, "bar": 3}, pk="id", ignore=True)
|
||||
# Only one row, and it should be bar=2, not bar=3
|
||||
rows = fresh_db.execute_returning_dicts("select * from test")
|
||||
assert [{"id": 1, "bar": 2}] == rows
|
||||
rows = list(fresh_db.query("select * from test"))
|
||||
assert rows == [{"id": 1, "bar": 2}]
|
||||
|
||||
|
||||
def test_insert_hash_id(fresh_db):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue