Skip to content

Commit

Permalink
More clarity on alter=True
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw authored Jan 16, 2024
1 parent 428d631 commit 6154923
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions templates/pages/tutorials/data-analysis.html
Original file line number Diff line number Diff line change
Expand Up @@ -279,13 +279,13 @@
```python
import sqlite_utils
db = sqlite_utils.Database("/tmp/peps.db")
db["peps"].insert_all(peps, pk="PEP", alter=True, replace=True)
db["peps"].insert_all(peps, pk="PEP", replace=True)
```
I got this error:
```
OperationalError: table peps has no column named PEP-Delegate
```
To fix that:
To fix that, use `alter=True` to automatically add any missing columns:
```python
db["peps"].insert_all(peps, pk="PEP", alter=True, replace=True)
print(db["peps"].count)
Expand Down

0 comments on commit 6154923

Please sign in to comment.