Show HN: 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://ift.tt/OvXV6Jj [1] https://ift.tt/d3bAFpq https://ift.tt/nrERgJc July 26, 2022 at 04:24PM
Show HN: TypeScript query builder with full type inference https://ift.tt/MH0JK3f
Related Articles
Show HN: Plain Vanilla – a tutorial website for vanilla web development https://ift.tt/8I6OCgQShow HN: Plain Vanilla – a tutorial website for vanilla web developmen… Read More
Show HN: Created an App for People Who Hate Planning Vacations https://ift.tt/caVmKJ2Show HN: Created an App for People Who Hate Planning Vacations Hi HN! … Read More
Show HN: A singing synthesizer for the browser with algorithmic 3-part harmony https://ift.tt/sU8jbXQShow HN: A singing synthesizer for the browser with algorithmic 3-part… Read More
Show HN: Remix Gear and Next.js Gear – The cleanest way to start a project https://ift.tt/pqhw3aDShow HN: Remix Gear and Next.js Gear – The cleanest way to start a pro… Read More
Show HN: Open-source nextjs14 and Supabase and stripe and docs/blog template https://ift.tt/40X9PRKShow HN: Open-source nextjs14 and Supabase and stripe and docs/blog te… Read More
Show HN: AI-Powered Stock Market Analyst with Global Coverage https://ift.tt/dZxvKQsShow HN: AI-Powered Stock Market Analyst with Global Coverage We’re th… Read More
Show HN: I built a solcial-media-inspired fitness App https://ift.tt/ZFq9Jg2Show HN: I built a solcial-media-inspired fitness App Hi Hacker News! … Read More
Show HN: webhooked.email (2023) https://ift.tt/JPab5FwShow HN: webhooked.email (2023) Hey HN, I built this tool a while ago,… Read More
0 Comments: