Skip to content

Commit 5f1bacb

Browse files
committed
Swap out duckdb-async for @duckdb/node-api.
1 parent c235f87 commit 5f1bacb

File tree

4 files changed

+707
-1545
lines changed

4 files changed

+707
-1545
lines changed

backend/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"vitest": "^4.0.16"
5050
},
5151
"dependencies": {
52+
"@duckdb/node-api": "*",
5253
"@octokit/graphql-schema": "^15.26.1",
5354
"@octokit/plugin-paginate-graphql": "^6.0.0",
5455
"@octokit/plugin-retry": "^8.0.3",
@@ -58,7 +59,6 @@
5859
"esno": "^4.8.0",
5960
"fs-extra": "^11.3.3",
6061
"octokit": "^5.0.5",
61-
"yaml": "^2.8.2",
62-
"duckdb-async": "^1.4.2"
62+
"yaml": "^2.8.2"
6363
}
6464
}

backend/src/fetchers/fetch_parquet.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Config, Result } from '../index';
66
import { CustomOctokit } from '../lib/octokit';
77
import { queryRepoNames } from './fetcher_utils';
88

9-
import { Database } from 'duckdb-async';
9+
import { DuckDBInstance } from '@duckdb/node-api';
1010

1111
async function downloadParquetFile(url: string, outputPath: string) {
1212
return new Promise((resolve, reject) => {
@@ -74,7 +74,7 @@ export const addCondaData = async (result: Result, octokit: CustomOctokit, confi
7474
}
7575
}
7676

77-
const db = await Database.create( `:memory:` );
77+
const db = await DuckDBInstance.create( `:memory:` );
7878
const formattedString = packages.map((pkg) => `'${pkg}'`).join(',');
7979

8080
const totalDownloads = await db.all(`SELECT pkg_name, SUM(counts)::INTEGER AS total FROM '${baseDir}/*.parquet' WHERE pkg_name IN (${formattedString}) GROUP BY pkg_name`);

0 commit comments

Comments
 (0)