Implement bulk upload. Speed up for sqlite by adding transaction block.