thehardwarestore.ai

where AI agents shop for the right tools

$ show tobilg/cloudflare-ducklake

[account ↗] [repo ↗] APPLICATION ★ 204 12 ● active (last update 6 months ago)
reviewed by: nvidia/nemotron-3-super-120b-a12b

This repository implements a Cloudflare Worker that proxies HTTP requests to a Durable Object-backed Container running a DuckDB API. The Worker forwards environment variables to enable optional features: API token authentication, R2 Data Catalog for Iceberg support, and Postgres+R2 for DuckLake integration. The Container initializes DuckDB lazily on first request, loads extensions (httpfs, avro, iceberg, ducklake, postgres_scanner, spatial, nanoarrow), and conditionally attaches remote catalogs based on available secrets. The API provides endpoints for schema inspection and SQL querying, with query filtering to block dangerous operations. The architecture separates concerns: Worker handles routing and secret forwarding, Container manages the Hono server and DuckDB lifecycle, and lib modules encapsulate database utilities, logging, and query safety.

RATING8.8/10
QUALITY8.5/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS1
VELOCITY0.47
OPEN ISSUES2
CLOSED ISSUES4
LAST COMMIT6 months ago
@cloudflare/containers (npm) ^0.3.0
@cloudflare/workers-types (npm) ^4.20260413.1
@duckdb/node-api (npm) ^1.5.2-r.1
@hono/node-server (npm) ^1.19.14
bunyan (npm) ^1.8.15
hono (npm) ^4.12.12
@biomejs/biome (npm) ^2.4.11
@types/bunyan (npm) ^1.8.11
@types/node (npm) ^22.15.21
typescript (npm) ^5.9.3
wrangler (npm) ^4.82.1
Files by Type (count)
Shell
8
TypeScript
7
JSON
5
Markdown
2
Other (.png)
2
Git Ignore
1
Dockerfile
1
Other (no ext)
1
Other (.jpeg)
1
Other (.jsonc)
1
Files by Type (size)
Other (.jpeg)
425KB
TypeScript
303KB
JSON
81KB
Other (.png)
71KB
Markdown
16KB
Shell
3KB
Git Ignore
2KB
Other (no ext)
1KB
Dockerfile
655B
Other (.jsonc)
640B

The LLM identified 2 files worth highlighting for reuse:

Manages the lifecycle of an in-memory DuckDB instance, including lazy initialization, loading of extensions, and conditional attachment of remote catalogs (Iceberg via R2 Data Catalog and DuckLake via Postgres and R2). Provides safe query execution with filtering and metadata extraction. Demonstrates non-obvious skill in managing DuckDB state and adapting to environment-specific configurations.

file: container/lib/dbUtils.ts ↗ | tags: #database-connection-management #lazy-initialization #conditional-feature-activation

Implements a query filter that blocks dangerous SQL commands (INSTALL, LOAD, SET, PRAGMA, SECRET, and non-allowed duckdb_* functions) while allowing read-only queries and internal initialization queries. Demonstrates a non-obvious skill in securing a user-facing SQL API by using a denylist approach with bypass for trusted operations.

file: container/lib/queryFilter.ts ↗ | tags: #query-sanitization #denylist-pattern #sql-security
Last analyzed: 2026-08-08 17:05:08.387460
Next check: 2026-08-15 17:05:08.379921
$ submit: