{"size": 462, "ext": "js", "max_stars_repo_path": "db/photos_queries.js", "max_stars_repo_name": "chelciebritt/Kuva-Server", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "db/photos_queries.js", "max_issues_repo_name": "chelciebritt/Kuva-Server", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "db/photos_queries.js", "max_forks_repo_name": "chelciebritt/Kuva-Server", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 22.0, "max_line_length": 73, "alphanum_fraction": 0.5887445887}
//pulls in the knex.js file found in db
const knex = require('./knex')

module.exports = {
  getAll() {
    return knex('photo');
  },
  getOne(id) {
    return knex('photo').where('photo_id', id).first();
  },
  create(photo) {
    return knex('photo').insert(photo, '*');
  },
  update(id, photoDetails) {
    return knex('photo').where('photo_id', id).update(photoDetails, '*');
  },
  delete(id) {
    return knex('photo').where('photo_id', id).del();
  }
}
