SaaSHub helps you find the best software and product alternatives Learn more →
Top 19 TypeScript Query Builder Projects
-
Prisma
Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
-
-
-
tusken
100% type-safe query builder compatible with any Postgres client 🐘 Generated table/function types, tree-shakable, implicit type casts, and more
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
-
-
sql-puzzle
sql-puzzle is a type-safe, highly composable, and functional query builder for Sequelize, written in TypeScript.
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
Project mention: Seeking a Type-Safe Ruby on Rails in TypeScript, I Started Developing an ORM | dev.to | 2024-06-11For example, the increasingly popular Prisma has high type safety but adopts the Table Gateway pattern. The closest fit was TypeORM, which uses the Active Record pattern, but its type support is weaker compared to recent ORMs, and its release frequency has been low recently.
The most interesting JS DB lib I came across was https://github.com/kysely-org/kysely but still didn't feel as good as EF Core.
Project mention: PostgresJs: The Fastest full featured PostgreSQL client for Node.js and Deno | news.ycombinator.com | 2023-10-14Super happy user of this [1] it's rather minimalistic but great.
[1] https://github.com/Ff00ff/mammoth
Project mention: Don't use your ORM entities for everything – embrace the SQL | news.ycombinator.com | 2024-03-29I guess I failed to set the context correctly given that you presented solutions for Clojure and Python, where it isn't as much of a problem since from the start the language fails to provide compiler guarantees you usually come to expect out of a SQL driver wrapper in typed languages (even though Clojure macros are probably powerful enough to allow this).
As a comparison, DX-wise this is no safer and is indeed very similar to the usual idiom in Go for example, where you just concatenate (pre-interpolated) SQL strings. But when you actually want the compiler to prove the correctness of your queries even in a rudimentary way, these .sql file solutions usually (if not, everytime) fail to provide the necessary external checker that processes templates and uses an accurate model of your database and SQL to verify that all used combinations make sense.
The closest thing to a proper take on this I've seen is https://github.com/andywer/squid with https://github.com/andywer/postguard which, although the SQL is inlined in the code, it uses the right approach for verifying correctness as far as I could tell in the little time I experimented with it.
Positioning the Ark parser as a unified string syntax for runtime types (to me at least) makes the rationales and justifications for string parsing much more apparent and focused, much more so than just saying "hey, here's a library to write your types with strings just because". It also services as a prototypal implementation of what JS types "could" look like one day (if only we could drop the `scope` and `type` and just write the types naturally in JavaScript), I took a similar approach with https://github.com/sinclairzx81/linqbox many years ago.
Project mention: Show HN: Kysely, a type-safe SQL query builder for TypeScript | news.ycombinator.com | 2023-06-21postgres.js is dope! I'm maintaining a Kysely community dialect for it. https://github.com/igalklebanov/kysely-postgres-js
Project mention: tRPC – Move Fast and Break Nothing. End-to-end typesafe APIs made easy | news.ycombinator.com | 2023-08-12I'm honestly pretty happy with TypeGraphQL. TypeGraphQL works code-first and lets you integrate request-scoped DI for resolvers, which makes writing more complex resolves significantly more pleasant.
Admittedly for the front end I couldn't find a satisfactory tool so I built typed-graphql-builder (https://typed-graphql-builder.spion.dev/). You do have to run it if your backend schema changes, but not when your queries change as the queries are written in typescript and inferred on the fly. (I should probably write a watch mode for the cli, that should largely take care of the rest of the toil when quickly prototyping)
Project mention: Prisma-GPT, query your database using natural language | news.ycombinator.com | 2023-06-28
Project mention: Show HN: Tsynamo – Type-friendly DynamoDB query builder for TypeScript | news.ycombinator.com | 2024-04-10
TypeScript Query Builder discussion
TypeScript Query Builder related posts
-
Create a Blog web app using Adonis.js 6
-
sql-puzzle, a highly composable and functional query builder
-
Show HN: SQL-puzzle, a highly composable and functional query builder
-
What do you guys think of this SQL LINQ-like syntax?
-
Why we ditched GraphQL for tRPC
-
Closest library/setup/configuration to JOOQ?
-
Type safety problem of Knex query builder
-
A note from our sponsor - SaaSHub
www.saashub.com | 17 Jun 2024
Index
What are some of the best open-source Query Builder projects in TypeScript? This list will help you:
Project | Stars | |
---|---|---|
1 | Prisma | 37,856 |
2 | kysely | 9,644 |
3 | mammoth | 491 |
4 | orchid-orm | 474 |
5 | gql-query-builder | 390 |
6 | workers-qb | 223 |
7 | tusken | 208 |
8 | ucast | 180 |
9 | Sqlmancer | 139 |
10 | squid | 137 |
11 | linqbox | 122 |
12 | kysely-postgres-js | 57 |
13 | typed-graphql-builder | 48 |
14 | ts-sql-codegen | 44 |
15 | prisma-gpt | 42 |
16 | slonik-trpc | 25 |
17 | tsynamo | 24 |
18 | refql | 15 |
19 | sql-puzzle | 14 |