Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created December 17, 2018 14:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codecademydev/5003a01382d544b422824800675e24b5 to your computer and use it in GitHub Desktop.
Save codecademydev/5003a01382d544b422824800675e24b5 to your computer and use it in GitHub Desktop.
Codecademy export
const { printQueryResults } = require('./utils');
// require the 'sqlite3' package here
const sqlite3 = require('sqlite3');
// open up the SQLite database in './db.sqlite'
const db = new sqlite3.Database('./db.sqlite');
db.all('SELECT * FROM TemperatureData ORDER BY year', (error, rows) => {
if (error) {
throw error;
}
printQueryResults(rows);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment