Improve SQLite compat

Change-Id: Ia522840c199eb276b2fe596b7603b0b84effba35
Merge "Improve SQLite compat"