Merge pull request #3 from gka/readme-fix

fixed readme - thx to @gka!.
This commit is contained in:
Rufus Pollock 2013-02-17 04:02:43 -08:00
commit c0a5ad8154

View File

@ -20,13 +20,15 @@ Example
A typical use case for ``sqlaload`` may include code like this::
```python
from sqlaload import connect, get_table, distinct, update
engine = connect('sqlite:///customers.db')
table = get_table('customers')
table = get_table(engine, 'customers')
for entry in distinct(engine, table, 'post_code', 'city')
lon, lat = geocode(entry['post_code'], entry['city'])
update(entry, {'lon': lon, 'lat': lat})
```
In this example, we selected all distinct post codes and city names
from an imaginary customers database, sent them through our
@ -36,10 +38,11 @@ geo information.
Another example, updating data in a datastore, might look like
this::
````python
from sqlaload import connect, get_table, upsert
engine = connect('sqlite:///things.db')
table = get_table('data')
table = get_table(engine, 'data')
for item in magic_data_source_that_produces_entries():
assert 'key1' in item
@ -48,7 +51,7 @@ this::
# whether an entry with the matching values for
# 'key1' and 'key2' already exists:
upsert(engine, table, item, ['key1', 'key2'])
```
Feedback
--------