Sqlite3 database and Ruby query classes