assets/repl/select.js

12 lines
319 B
JavaScript

import sqlite3 from 'sqlite3'
sqlite3.verbose()
const db = new sqlite3.Database('../db')
db.serialize(async () => {
db.each("SELECT * FROM assets", (err, row) => {
row.date = new Date(row.date).toISOString()
row.date = row.date.substring(0, row.date.length - 14)
console.log(row)
})
})