Connection management for SQLite databases