-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: update deps * feat: 🚀 add devcontainer setup * chore: add sample data loader * docs: 🎨 update charts
- Loading branch information
1 parent
37c003a
commit 4b567d3
Showing
7 changed files
with
267 additions
and
313 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"name": "Development Container", | ||
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-20-bookworm", | ||
"postCreateCommand": "curl -L https://github.com/duckdb/duckdb/releases/download/v1.1.2/duckdb_cli-linux-amd64.zip -o duckdb.zip && unzip -o duckdb.zip && chmod +x duckdb && mkdir -p ~/.local/bin && mv -f duckdb ~/.local/bin/ && rm duckdb.zip", | ||
"postCreateCommand": "curl -L https://github.com/duckdb/duckdb/releases/download/v1.1.2/duckdb_cli-linux-amd64.zip -o duckdb.zip && unzip -o duckdb.zip && chmod +x duckdb && mkdir -p ~/.local/bin && mv -f duckdb ~/.local/bin/ && rm duckdb.zip" | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Database } from "duckdb-async"; | ||
|
||
|
||
const db = await Database.create(":memory:"); | ||
const rows = await db.all(` | ||
SELECT | ||
cast(date as string) as date, | ||
unique_deal_making_providers, | ||
providers_with_active_deals, | ||
providers_with_power, | ||
FROM read_parquet('https://data.filecoindataportal.xyz/filecoin_daily_metrics.parquet') | ||
WHERE date >= CURRENT_DATE() - INTERVAL '90 days' | ||
`); | ||
|
||
// Convert rows to CSV format | ||
const headers = Object.keys(rows[0]).join(','); | ||
const csvRows = rows.map(row => Object.values(row).join(',')); | ||
const csvContent = [headers, ...csvRows].join('\n'); | ||
|
||
// Write to stdout | ||
console.log(csvContent); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.