Skip to content

Instantly share code, notes, and snippets.

@travisperson
Created December 5, 2015 01:37
Show Gist options
  • Select an option

  • Save travisperson/ce02f307b068bb576e07 to your computer and use it in GitHub Desktop.

Select an option

Save travisperson/ce02f307b068bb576e07 to your computer and use it in GitHub Desktop.
db.all("SELECT Id, Name, Long, Size, Price, Supplier, Country, Grape, Vegeterian, Picture FROM wine WHERE Id=" + req.params.id + " ORDER BY Name", function(err, rows) {
var list = [];
rows.forEach(function (row) {
list.push({
id: row.Id,
name: row.Name,
long: row.Long,
size: row.Size,
price: row.Price,
supplier: row.Supplier,
country: row.Country,
grape: row.Grape,
vegeterian: row.Vegeterian,
picture: row.Picture
});
});
res.json(list);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment