Separate SQLite code from Repo code
Summary:
My native autoloader stores data in a SQLite database for fast cold starts and CLI standalone performance. HHVM already uses SQLite to cache bytecode. These SQLite DBs are the `.hhbc` and `.hhbbc` files managed by the `Repo` class. I originally tried storing my autoloader information in the `.hhbc` DB, but this led to terrible performance. SQLite only allows one thread or process to write to a DB at a given time, and the autoloader and unit emitter fought with each other for the ability to write to the DB.
The `Repo` class provides a fairly clean, opinionated, RAII-style wrapper around SQLite. I really liked that, so here I've abstracted the bits that aren't specific to `.hhbc` into a new `SQLite` class. In theory, we can make the `Repo` class depend on this `SQLite` class to reduce the duplication, but I'm more interested in just using this class to power the native autoloader for the time being.
Reviewed By: paulbiss
Differential Revision:
D15562623
fbshipit-source-id:
c53e9a1a186c354d0d24cec7f5fd5d3026e377ae