Show HN: PgTyped – Typesafe SQL in TypeScript and Postgres
1–10 of 90 posts
Re: Show HN: PgTyped – Typesafe SQL in TypeScript and Postgres
#2Re: Show HN: PgTyped – Typesafe SQL in TypeScript and Postgres
#3I like the idea of code generation instead of doing the work at runtime (like in ORMs). This is like making your database schema the IDL spec.
Re: Show HN: PgTyped – Typesafe SQL in TypeScript and Postgres
#4Re: Show HN: PgTyped – Typesafe SQL in TypeScript and Postgres
#5Is there anything like this for Rust or C++? I like the idea of code generation instead of doing the work at runtime (like in ORMs). This is like making your database schema the IDL spec.
Also hugsql for clojure and pugsql for python.
Re: Show HN: PgTyped – Typesafe SQL in TypeScript and Postgres
#6sqlc currently has great support for Go and experimental support for Kotlin. I'm planning on adding TypeScript support in the future, so it's great to see that others in the TypeScript community find this workflow useful.
Re: Show HN: PgTyped – Typesafe SQL in TypeScript and Postgres
#7Is there anything like this for Rust or C++? I like the idea of code generation instead of doing the work at runtime (like in ORMs). This is like making your database schema the IDL spec.
https://github.com/launchbadge/sqlx perhaps Also hugsql for clojure and pugsql for python.
Re: Show HN: PgTyped – Typesafe SQL in TypeScript and Postgres
#8Re: Show HN: PgTyped – Typesafe SQL in TypeScript and Postgres
#9Is there anything like this for Rust or C++? I like the idea of code generation instead of doing the work at runtime (like in ORMs). This is like making your database schema the IDL spec.
Re: Show HN: PgTyped – Typesafe SQL in TypeScript and Postgres
#10Say `SELECT * FROM user LEFT JOIN post ON user.id = post.id` would be mapped to `[{userId: 1, name: renke1, posts: [{postId: 2, title: "foo"]]`.
You probably need some kind of meta data to figure out how tables and thus objects relate to each other though.
Basically, I want to be able to leverage the full power of modern databases without being constrainted by typical ORM limitations. Also, I don't need features like lazy loading, sessions, caches and things like that.
A great advantage is that you can (provided you have some test data) easily test your queries while you develop a new feature (think IntelliJ IDEA where you can simply execute an SQL query on the fly).