import sqlite3 import pandas as pd df = pd.DataFrame({'MyID': [1, 2, 3], 'Data': [3, 2, 6]}) with sqlite3.connect('foo.db') as con: df.to_sql('df', con=con, dtype={'MyID': 'INTEGER PRIMARY KEY AUTOINCREMENT'})