ContinuumIO/blaze — pull request #825 by mrocklin (2014-11-11 02:39:00+00:00)
Title: Support SQLAlchemy engines directly

This provides `discover`, `resource` and `compute(field)` access to sqlalchemy engines directly, without need for a `blaze.SQL` object (which I may soon deprecate).

```Python
In [1]: from blaze import *

In [2]: db = Data('sqlite:////home/mrocklin/workspace/blaze/blaze/examples/data/iris.db')

In [3]: db
Out[3]: Engine(sqlite:////home/mrocklin/workspace/blaze/blaze/examples/data/iris.db)

In [4]: db.dshape
Out[4]:
dshape("""{
iris: var * {
sepal_length: ?float64,
sepal_width: ?float64,
petal_length: ?float64,
petal_width: ?float64,
species: ?string
}
}""")

In [5]: db.iris
Out[5]:
sepal_length sepal_width petal_length petal_width species
0 5.1 3.5 1.4 0.2 Iris-setosa
1 4.9 3.0 1.4 0.2 Iris-setosa
2 4.7 3.2 1.3 0.2 Iris-setosa
3 4.6 3.1 1.5 0.2 Iris-setosa
4 5.0 3.6 1.4 0.2 Iris-setosa
5 5.4 3.9 1.7 0.4 Iris-setosa
6 4.6 3.4 1.4 0.3 Iris-setosa
7 5.0 3.4 1.5 0.2 Iris-setosa
8 4.4 2.9 1.4 0.2 Iris-setosa
9 4.9 3.1 1.5 0.1 Iris-setosa
...

In [6]: db.iris.species.distinct()
Out[6]:
species
0 Iris-setosa
1 Iris-versicolor
2 Iris-virginica
```