<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/7AxjeWOO1" -->

---
title: TypeScript scripts as DuckDB Table Functions | daily.dev
description: DuckDB's shellfs and arrow extensions can be combined with Bun's TypeScript runtime to query REST APIs, GraphQL endpoints, and web pages directly using SQL. By...
canonical: https://daily.dev/posts/7axjewoo1
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: TypeScript scripts as DuckDB Table Functions | daily.dev
og:description: DuckDB's shellfs and arrow extensions can be combined with Bun's TypeScript runtime to query REST APIs, GraphQL endpoints, and web pages directly using SQL. By...
og:url: https://daily.dev/posts/7axjewoo1
og:image: https://api.daily.dev/og/posts/7AxjeWOO1.png
og:image:alt: Post cover image
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# TypeScript scripts as DuckDB Table Functions

**[DuckDB dev](https://daily.dev/sources/duckdbdev)** · [@mehdio](https://daily.dev/mehdio) · 0 upvotes · 0 comments

## Summary

DuckDB's shellfs and arrow extensions can be combined with Bun's TypeScript runtime to query REST APIs, GraphQL endpoints, and web pages directly using SQL. By creating a macro that pipes Bun script output to DuckDB's read_arrow function, any TypeScript script that outputs Apache Arrow IPC format becomes a queryable table. The json-to-arrow-ipc npm package converts JSON to Arrow IPC format without dictionary encoding. Practical examples include querying GitHub repositories, Hashnode blog posts, npm package statistics, and Hacker News stories, all without ETL pipelines or intermediate files.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://tobilg.com/posts/typescript-scripts-as-duckdb-table-functions/>

## Similar posts on daily.dev

- [DuckDB's WebAssembly Client Allows Querying Iceberg Datasets in the Browser](https://daily.dev/posts/duckdb-s-webassembly-client-allows-querying-iceberg-datasets-in-the-browser-oososiecy) · InfoQ · 2 upvotes · 0 comments
- [Tinybird, now in TypeScript](https://daily.dev/posts/tinybird-now-in-typescript-x0nuoqfsr) · Tinybird · 94 upvotes · 1 comments
- [Iceberg in the Browser](https://daily.dev/posts/iceberg-in-the-browser-4kdqxhgvb) · DuckDB · 3 upvotes · 0 comments
- [Bun: a faster JavaScript runtime](https://daily.dev/posts/bun-a-faster-javascript-runtime-hnnh26fm5) · Flavio Copes · 0 upvotes · 0 comments

---

Tags: [#apache-arrow](https://daily.dev/tags/apache-arrow), [#bun](https://daily.dev/tags/bun), [#duckdb](https://daily.dev/tags/duckdb), [#sql](https://daily.dev/tags/sql), [#typescript](https://daily.dev/tags/typescript)

[View this post on daily.dev](https://daily.dev/posts/7axjewoo1)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"DiscussionForumPosting","mainEntityOfPage":"https://daily.dev/posts/7axjewoo1","headline":"TypeScript scripts as DuckDB Table Functions","text":"Shared: TypeScript scripts as DuckDB Table Functions","url":"https://daily.dev/posts/7axjewoo1","datePublished":"2025-12-13T09:57:09.933Z","dateModified":"2026-06-04T02:13:58.905Z","author":{"@type":"Person","name":"mehdio","url":"https://daily.dev/mehdio","image":"https://avatars.githubusercontent.com/u/19834862?v=4","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":560}},"image":"https://media.daily.dev/image/upload/s--OHB84bZF--/f_auto/v1722860399/public/Placeholder%2010","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"sharedContent":{"@type":"WebPage","url":"https://api.daily.dev/r/NXsBXTsym"},"isPartOf":{"@type":"WebPage","url":"https://daily.dev/squads/duckdbdev","name":"DuckDB dev"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"DuckDB dev","item":"https://daily.dev/squads/duckdbdev"},{"@type":"ListItem","position":3,"name":"TypeScript scripts as DuckDB Table Functions"}]}
```

