Commit graph

6 commits

Author SHA1 Message Date
vishalkaay
65b3fc8789 Allow table.get() to look up rows by column values
table.get() now accepts column=value keyword arguments and returns the
first matching row, so a row can be fetched by a unique column rather
than only by its primary key. Passing both a primary key and keyword
arguments raises ValueError, and calling get() with neither raises
TypeError.

Refs #588
2026-09-26 01:35:28 +05:30
Simon Willison
38fe466700 Use db.table() and db.view() in tests, closes #838 2026-08-12 14:03:04 -07:00
Simon Willison
69a1c0d960
Fixes for Ruff>=0.16.0 (#814)
* Automated upgrades by Ruff

    uvx --with 'ruff>=0.16.0' ruff check . --fix --unsafe-fixes

* Fix remaining Ruff errors with GPT-5.6 Sol high

https://gist.github.com/simonw/6da7906a9fea6e90da131c21a9055199

* Fix flake E501 long lines
* New Protocol for migrations to make ty happy
2026-07-25 14:53:12 -07:00
Simon Willison
fc38868bd4 Refactored tests into new test_rows.py, refs #76 2020-04-15 18:04:55 -07:00
Simon Willison
c65b67ca46
.get() method plus support for compound primary keys (#40)
* create_table now handles compound primary keys
* CLI now accepts multiple --pk for compound primary keys
* Docs for compound primary keys with CLI and Python library
* New .get() method plus documentation

Closes #36, closes #39
2019-07-14 21:28:51 -07:00
Simon Willison
f70e35c9bb Added table.rows_where(where, args) method 2019-07-14 11:58:40 -07:00