Menu

ClickHouse from TypeScript: TypeORM, Prisma, and what actually works
📰

ClickHouse from TypeScript: TypeORM, Prisma, and what actually works

DEV Community: typescript·Luke·about 11 hours ago
#Hd7oP02U
#devtotypescript#devto#dev#clickhouse#client
Reading 0:00
15s threshold

You've got a TypeScript backend on TypeORM or Prisma. You've added ClickHouse for analytics. The obvious next step is to point your ORM at it.

The short answer: you can't, and you shouldn't want to.

Neither TypeORM nor Prisma ships a ClickHouse driver. Even if one did, an ORM's model of the world is the wrong fit for an analytical database.

Here's why, and what TypeScript teams actually use instead. Disclosure: I maintain one of the options below, hypequery . I'll be clear about where the others are the better choice.

TypeORM, Prisma and Drizzle: where they stand

TypeORM. No ClickHouse driver. You'll find old GitHub issues asking for one and a few small community wrappers, but nothing maintained at the level you'd want in production.

Prisma. No ClickHouse connector. Prisma's $queryRaw only runs against databases Prisma already supports, so it can't reach ClickHouse either.

Drizzle. No first-party ClickHouse dialect at the time of writing.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.