You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
455 B
JavaScript
15 lines
455 B
JavaScript
import duckdb from "duckdb";
|
|
const db = new duckdb.Database("./options.duckdb");
|
|
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(err2, res) {
|
|
if (err2) {
|
|
throw err2;
|
|
}
|
|
console.log(res[0].count);
|
|
});
|
|
});
|