ported fmi to sqlite3