Skip to content

Instantly share code, notes, and snippets.

@Announcement
Last active October 19, 2017 14:37
Show Gist options
  • Save Announcement/b48c358b2130a99800a32dcd90eddb86 to your computer and use it in GitHub Desktop.
Save Announcement/b48c358b2130a99800a32dcd90eddb86 to your computer and use it in GitHub Desktop.
var sqlite = require('sqlite3')
var db = new sqlite.Database('/home/tomato/.mozilla/firefox/kbp250uo.dev/places.sqlite')
function each (query) {
return new Promise((resolve, reject) => {
try {
db.each(query, resolve)
} catch (exception) {
reject(exception)
}
})
}
async function main (..args) {
let results
let query
let done
query = `SELECT fk FROM moz_bookmarks WHERE type=1 ORDER BY lastModified`
results = await each(query)
done = []
if (done.indexOf(row.fk) === -1) {
done.push(row.fk)
console.log(row.fk) // this prints lots of numbers
}
console.log(done)
}
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment