import numpy as np
import sqlite3
sqlite3.register_adapter(np.int64, lambda val: int(val))
conn = sqlite3.connect(':memory:')
conn.execute('CREATE TABLE foo (id INTEGER NOT NULL, primary key (id))')
conn.execute('insert into foo values(?)', (np.int64(100),))
inserting numpy integer types into sqlite with python3