Ty

TypeScript query builder with full type inference

Hacker News

TypeScript query builder with full type inference

Hey HN! Colin here - a TypeScripter, open sourcer, and engineer at EdgeDB. As the creator of Zod and tRPC, I'm interested in designing tools/APIs that use type inference and generics to make life easier for devs. This query builder represents another step in that direction. We set out to build an EdgeQL query builder that can express queries of arbitrary complexity (EdgeQL has feature parity with SQL, roughly) and infer the static type of the query result. We introspect the database and generate a schema-aware client that represent any query, including ones that use built-in functions, operators, string/array/tuple indexing, aggregations, conditionals, type casting, subqueries, computed properties, etc—things most ORMs can’t represent. This post mostly discusses the API design, which I think will be interesting regardless of familiarity with EdgeQL. I’d love to see some of these ideas bleed into future generations of TypeScript ORMs/query builders too. Best way to try it is to clone the sandbox repo and follow the instructions in the README[0]. Or jump into the docs[1]. [0] https://github.com/edgedb/mcu-sandbox [1] https://www.edgedb.com/docs/clients/js/querybuilder

Share card

Actual performance

4points
Did not reach leaderboard

Launch Intel predictions

Analyze your own launch →
Product HuntOn track for Day 1 leaderboard · Strong signals: apis, open · Missing: mac, agents, macos
84%84% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
best fitHighest predicted score across all platforms for this description.
Hacker NewsStrong engagement from HN community · Strong signals: open source, ide, io · Missing: https docs, excited, just released
58%58% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
Indie HackersIH features products with proven revenue · Strong signals: including · Missing: supports, reddit linkedin, podcasting
48%48% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
TrustMRRLess likely to generate early MRR · Strong signals: way · Missing: mobile apps, ios, personal
38%38% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
AppSumoMay struggle as an AppSumo deal · Strong signals: builder · Missing: plus, platform, intuitive
37%37% predicted probability of success on AppSumo, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Strong signals: arr · Missing: mrr, revenue, profit
19%19% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Missing: web3, chat, crypto
0%0% predicted probability of success on BetaList, based on ML models trained on real launch data.

Incorrect prediction on native model

Similar products

Ts
Tsynamo – Type-friendly DynamoDB query builder for TypeScript59%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Tsynamo – Type-friendly DynamoDB query builder for TypeScript

Hacker News1
I
I made TypeScript's type inference more strict (and smarter)38%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

I made TypeScript's type inference more strict (and smarter)

Hacker News3
Ky
Kysely, a type-safe SQL query builder for TypeScript42%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Kysely, a type-safe SQL query builder for TypeScript

Hacker News1
Ky
Kysely, a type-safe SQL query builder for TypeScript42%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Kysely, a type-safe SQL query builder for TypeScript

Hacker News90
Ty
TypeScript to GraphQL conversion tool with type inference60%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

TypeScript to GraphQL conversion tool with type inference

Hacker News90
OR
ORM for TypeScript with no query-builder, supporting full SQL queries66%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

ORM for TypeScript with no query-builder, supporting full SQL queries

Hacker News220
No
Node Typescript Postgres Query Builder54%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Node Typescript Postgres Query Builder

Hacker News2
Fa
Fastify-zod, type-once, run everywhere (TypeScript/OpenAPI)55%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Fastify-zod, type-once, run everywhere (TypeScript/OpenAPI)

Hacker News7
SQ
SQLBraid – Write SQL directly in TypeScript without a query-builder DSL63%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

SQLBraid – Write SQL directly in TypeScript without a query-builder DSL

Hacker News8
ty
type-kanren – type-level microKanren in TypeScript45%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

type-kanren – type-level microKanren in TypeScript

Hacker News5