Data primitives for TypeScript — ETL pipelines, transforms, and Drizzle Postgres integration. Current stable version: 0.0.1. Pre-release, API likely unstable. Built for Next.js + Drizzle + Postgres stacks. Key differentiators: first-class Drizzle ORM support, typed pipelines, composable transforms, automatic batching for Postgres parameters, immutable Pipeline builder, and extractors for queries, paginated queries, and custom streams. Lightweight alternative to heavy ETL frameworks like Apache Beam or node-etl. Requires Node >= 18 and drizzle-orm >= 0.35.0 as a peer dependency.
npm install khotan-dataNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Defines a typed ETL pipeline: extracts active users from Drizzle query, filters adults, transforms fields, then inserts into analytics table with batching.
Lock version to a specific patch and test thoroughly on upgrades.
Always use the return value of .transform(), .load(), etc. Do not reuse a Pipeline instance after calling .run().
Ensure query factory returns a Promise or is async: (limit, offset) => db.select()...
Avoid relying on it for production; test error handling explicitly.
Manually set columnsPerRow option in toDrizzle for very wide tables.
Use 'khotan-data' main export instead; drizzle symbols are re-exported there.
Wrap the query in a function: fromQuery('name', () => db.select()...)Ensure drizzle-orm >=0.35.0 is installed and Node >=18.
Create a new Pipeline for each execution: const p = Pipeline.create(...); await p.run();