added Database.query function