SQLite layer improvements