Serializing database requests to SQLite