Skip to content

Commit

Permalink
More syntax highlighting for README
Browse files Browse the repository at this point in the history
  • Loading branch information
codeinthehole committed Nov 29, 2012
1 parent 2a9489c commit 8898ad7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Expand Up @@ -11,9 +11,11 @@

In MySQL you can do this:

```mysql
mysql> LOAD DATA INFILE '/tmp/data.csv'
-> REPLACE INTO TABLE 'my_data'
-> FIELDS (isbn, price, stock);
```

to load CSV data from `/tmp/data.csv` into the `my_data` table, replacing rows
that match on a unique constraint. Sadly, the Postgres's `COPY` command does
Expand All @@ -22,16 +24,23 @@ not support this option.
This package provides a work-around to allow using CSVs to update tables in
Postgres.

```bash
$ pip install foiegras
$ python
```

```python
>>> import psycopg2, foiegras
>>> conn = psycopg2.connect("dbname=mydb")
>>> goose = foiegras.Goose(conn)
>>> goose.load('my_data', '/tmp/data.csv', ('isbn', 'price', 'stock'))
```

Yay! Don't forget to close the connection:

```python
>>> conn.close()
```

## Interesting... tell me more

Expand Down

0 comments on commit 8898ad7

Please sign in to comment.