import duckdb from 'duckdb'; const db = new duckdb.Database('./options.duckdb'); // or a file name for a persistent DB const filename = '/home/brian/Downloads/options-data/2013-01-02options.cvs'; db.run(`CREATE TABLE prices AS SELECT * FROM read_csv_auto('${filename}')`, (err)=>{ if (err) { throw err; } db.all("SELECT count(*) AS count FROM prices WHERE underlying = 'TSLA'", function(err, res) { if (err) { throw err; } console.log(res[0].count) }); });