Is 800 bound variables, documented anywhere?  in a later comment, you say: "sqlite allows up to 500 rows per insert".  Maybe we should define those magic numbers in a header somewhere, and always use them, for maintainability / documentation purposes.