mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-23 01:14:31 +02:00
Added table.rows_where(where, args) method
This commit is contained in:
parent
72a6f430df
commit
f70e35c9bb
3 changed files with 36 additions and 1 deletions
|
|
@ -65,6 +65,13 @@ To iterate through dictionaries for each of the rows in a table, use ``.rows``::
|
|||
{'id': 1, 'age': 4, 'name': 'Cleo'}
|
||||
{'id': 2, 'age': 2, 'name': 'Pancakes'}
|
||||
|
||||
You can filter rows by a WHERE clause using ``.rows_where(where, where_args)``::
|
||||
|
||||
>>> db = sqlite_utils.Database("dogs.db")
|
||||
>>> for row in db["dogs"].rows_where("age > ?", [3]):
|
||||
... print(row)
|
||||
{'id': 1, 'age': 4, 'name': 'Cleo'}
|
||||
|
||||
Creating tables
|
||||
===============
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue