Paul M Furley c414f85df9 find(): if table doesn't exist, return an iterator
... rather than []

If a table exists, you can treat the output of `find` as an iterator,
specifically you can call `next(find(...))`:

```
>>> db = dataset.connect('sqlite:///:memory1:')
>>> table = db['table_which_exists']
>>> table.insert({'foo': 'x'})
>>> next(table.find(foo='x'))  # no problem
```

But if the table hasn't been created yet, `find(...)` returns an empty list,
which you can't call `next()` on:

```
>>> db = dataset.connect('sqlite:///:memory2:')
>>> table = db_no_table['table_which_doesnt_exis']
>>> next(table.find(foo='x'))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'list' object is not an iterator
```

^^^ rather than a `TypeError`, I'd expect to get a `StopIteration`
exception.
2018-05-29 18:07:32 +01:00
2017-12-05 17:21:08 +01:00
2017-10-25 23:06:31 +02:00
2017-09-02 09:01:30 +02:00
2015-05-23 16:28:29 +02:00
2013-04-01 22:39:04 +02:00
2017-09-29 14:10:32 +02:00
2017-09-09 18:34:32 +02:00
2017-12-04 23:29:24 +01:00
2018-04-04 10:43:51 +02:00

dataset: databases for lazy people

Build Status

In short, dataset makes reading and writing data in databases as simple as reading and writing JSON files.

Read the docs

To install dataset, fetch it with pip:

$ pip install dataset

Note: as of version 1.0, dataset is split into two packages, with the data export features now extracted into a stand-alone package, datafreeze. See the relevant repository here.

S
Description
Upgraded dataset version from https://github.com/pudo/dataset/. This one uses new SQLAlchemy2.
Readme
870 KiB
Languages
Python 99.5%
Makefile 0.5%