TypeScript Query Builder

Open-source TypeScript projects categorized as Query Builder

Top 19 TypeScript Query Builder Projects

  • Prisma

    Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB

  • Project mention: Deploy Full-Stack Next.js T3App with Cognito and Prisma using AWS Lambda | dev.to | 2024-04-15

    generator client { provider = "prisma-client-js" binaryTargets = ["native", "rhel-openssl-1.0.x"] } datasource db { provider = "postgresql" // NOTE: When using mysql or sqlserver, uncomment the @db.Text annotations in model Account below // Further reading: // https://next-auth.js.org/adapters/prisma#create-the-prisma-schema // https://www.prisma.io/docs/reference/api-reference/prisma-schema-reference#string url = env("DATABASE_URL") } model Post { id Int @id @default(autoincrement()) name String createdAt DateTime @default(now()) updatedAt DateTime @updatedAt createdBy User @relation(fields: [createdById], references: [id]) createdById String @@index([name]) } // ... rest of the schema

  • kysely

    A type-safe typescript SQL query builder

  • Project mention: Show HN: Tsynamo – Type-friendly DynamoDB query builder for TypeScript | news.ycombinator.com | 2024-04-10

    Hello HN! I was recently introduced to Kysely (https://github.com/kysely-org/kysely), a type-safe Typescript SQL query builder, and instantly fell in love! I got inspired and wanted to make something similar for AWS DynamoDB.

    Thus, I developed Tsynamo! Instead of calling it type-safe, I decided to go with type-friendly, because the library is still in an early stage, and is not 100% type-safe.

    Under the hood, Tsynamo compiles the built queries into AWS SDK v3 commands. I feel that Tsynamo simplifies the AWS SDK API quite a lot since the developer doesn't have to mess around with condition/filter expressions or attribute names/values themselves, and as a bonus gets autocompletion for building the queries!

    There's also a playground to test it out in your browser: https://try.tsynamo.dev. It might not have the most up-to-date API of the library in use yet, but you can get the library's main idea from there.

    Since the project is still in its early stages, it doesn't yet have 100% support for all DynamoDB features, like querying indexes. The next steps will be increasing the support coverage and perhaps adding automatic type generation as inspired by kysely-codegen (https://github.com/RobinBlomberg/kysely-codegen).

    Would love to get some feedback, thanks in advance!

  • 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.

    SurveyJS logo
  • mammoth

    A type-safe Postgres query builder for TypeScript. (by Ff00ff)

  • Project mention: PostgresJs: The Fastest full featured PostgreSQL client for Node.js and Deno | news.ycombinator.com | 2023-10-14

    Super happy user of this [1] it's rather minimalistic but great.

    [1] https://github.com/Ff00ff/mammoth

  • orchid-orm

    Orchid ORM

  • gql-query-builder

    🔧 Simple GraphQL Query Builder

  • workers-qb

    Zero dependencies Query Builder for Cloudflare Workers

  • tusken

    100% type-safe query builder compatible with any Postgres client 🐘 Generated table/function types, tree-shakable, implicit type casts, and more

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • ucast

    Conditions query translator for everything

  • Sqlmancer

    Conjure SQL from GraphQL queries 🧙🔮✨

  • squid

    🦑 Provides SQL tagged template strings and schema definition functions. (by andywer)

  • Project mention: Don't use your ORM entities for everything – embrace the SQL | news.ycombinator.com | 2024-03-29

    I 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.

  • linqbox

    Language Integrated Query for JavaScript

  • Project mention: TypeScript please give us types | /r/typescript | 2023-07-08

    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.

  • kysely-postgres-js

    Kysely dialect for PostgreSQL using the Postgres.js client.

  • Project mention: Show HN: Kysely, a type-safe SQL query builder for TypeScript | news.ycombinator.com | 2023-06-21

    postgres.js is dope! I'm maintaining a Kysely community dialect for it. https://github.com/igalklebanov/kysely-postgres-js

  • typed-graphql-builder

    A fully type-safe graphql query builder, inspired by tql

  • Project mention: tRPC – Move Fast and Break Nothing. End-to-end typesafe APIs made easy | news.ycombinator.com | 2023-08-12

    I'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)

  • prisma-gpt

    Prisma extension that lets you query your database with natural language using GPT

  • Project mention: Prisma-GPT, query your database using natural language | news.ycombinator.com | 2023-06-28
  • ts-sql-codegen

    Database driven code generation for ts-sql-query

  • slonik-trpc

    Type-safe efficient query API engine using slonik and zod

  • tsynamo

    Type-friendly TypeScript DynamoDB query builder!

  • Project mention: Show HN: Tsynamo – Type-friendly DynamoDB query builder for TypeScript | news.ycombinator.com | 2024-04-10
  • refql

    A Node.js and Deno library for composing and running SQL queries.

  • Project mention: I've created a Semigroup Query Builder for TypeScript and JavaScript that is compliant with Fantasy Land | /r/functionalprogramming | 2023-06-06
  • sql-puzzle

    sql-puzzle is a type-safe, highly composable, and functional query builder for Sequelize, written in TypeScript.

  • 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.

    InfluxDB logo
NOTE: The open source projects on this list are ordered by number of github stars. The number of mentions indicates repo mentiontions in the last 12 Months or since we started tracking (Dec 2020).

TypeScript Query Builder related posts

Index

What are some of the best open-source Query Builder projects in TypeScript? This list will help you:

Project Stars
1 Prisma 37,151
2 kysely 9,289
3 mammoth 492
4 orchid-orm 461
5 gql-query-builder 388
6 workers-qb 213
7 tusken 191
8 ucast 168
9 Sqlmancer 139
10 squid 130
11 linqbox 122
12 kysely-postgres-js 48
13 typed-graphql-builder 45
14 prisma-gpt 40
15 ts-sql-codegen 40
16 slonik-trpc 24
17 tsynamo 18
18 refql 14
19 sql-puzzle 14

Sponsored
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.
www.influxdata.com