## Use sqlacodegen
pip install sqlacodegen
sqlacodegen sqlite:///database.db


## Create an _id primary key field in the autogenerated script

Replace metadata, with

```
 metadata,
Column('_id', Integer, nullable=False, primary_key=True),

```