Postgres to TypeScript Interfaces and Enums

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

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.io
featured
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.
www.influxdata.com
featured
  • vramework

  • This is awesome! the json types part is perfect. If I found your fork earlier I would have just used that as its what I need for jsonb.

    The dates solution I fixed in a rest API wrapper on the client side. It's not great but it hides away the date serialisation issues

    https://github.com/vramework/vramework/blob/243db4830d22c537...

    Is it performant? Not really. But it stopped us from having to deal with the string issue which worked great.

  • prisma1

    Discontinued 💾 Database Tools incl. ORM, Migrations and Admin UI (Postgres, MySQL & MongoDB) [deprecated]

  • Seems like it generates TS types, but doesn’t help with data access? i.e. not trying to compete with tools that generate full data access layers, like Prisma https://www.prisma.io/ ?

    If so, out of curiosity, what’s the use case for generating just the types? How are you actually getting data to/from the DB?

  • 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
  • ts-sql

    A SQL database implemented purely in TypeScript type annotations.

  • Maybe this may help as some inspiration https://github.com/codemix/ts-sql

  • squabble

    An extensible linter for SQL queries and migrations.

  • kanel

    Generate Typescript types from Postgres

  • We are using Kanel[1] for this right now — is there an advantage to using this instead?

    [1]: https://github.com/kristiandupont/kanel

  • Paste JSON as Code • quicktype

    Xcode extension to paste JSON as Swift, Objective-C, and more

  • doesn't it already exist? but it converts from your json https://quicktype.io/

  • pgtyped

    pgTyped - Typesafe SQL 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
  • pg-to-ts

    Generate TypeScript interface definitions from your Postgres schema

  • There are many forks of schemats out there that add various features. Here’s mine: https://github.com/danvk/pg-to-ts

    It copies Postgres comments over to JSDoc/TSDoc comments, emits some data about foreign key relationships and supports TS types for json/jsonb columns via @type comments. Feel free to copy any of those feature if you think they’re good ideas :)

  • sqlx

    🧰 The Rust SQL Toolkit. An async, pure Rust SQL crate featuring compile-time checked queries without a DSL. Supports PostgreSQL, MySQL, and SQLite. (by launchbadge)

  • sqlx is able to do this, but using compile time macros. For a typescript project you'd possibly need a running process reading your source files for queries and probing the database for what will come back.

    https://github.com/launchbadge/sqlx/#compile-time-verificati...

  • mfsqlchecker

    Statically validate correctness of all your SQL queries. TypeScript, PostgreSQL

  • This library does exactly what you want: https://github.com/MedFlyt/mfsqlchecker

    and it also validates the types of the parameters that go into the query

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Don't use your ORM entities for everything – embrace the SQL

    4 projects | news.ycombinator.com | 29 Mar 2024
  • Squawk – A Linter for Postgres Migrations

    1 project | news.ycombinator.com | 30 Apr 2024
  • Get started with Drizzle ORM and Xata's Postgres service

    1 project | dev.to | 16 Apr 2024
  • Type-Safe Printf() in TypeScript

    4 projects | news.ycombinator.com | 24 Mar 2024
  • Introducing pgzx: create PostgreSQL extensions using Zig

    3 projects | news.ycombinator.com | 21 Mar 2024