Another one in a similar vein with strict typing and really nice SQL interpolation for Postgres: https://github.com/gajus/slonik
Show HN: PgTyped – Typesafe SQL in TypeScript and Postgres
11–20 of 90 posts
Re: Show HN: PgTyped – Typesafe SQL in TypeScript and Postgres
#12Looks a little like the Typescript equivalent of Xo ( https://github.com/xo/xo ) for Go. Especially with Go, getting help with some initial scaffolding can be a huge timesaver. I'm assuming it's a similar gain for Typescript.
Re: Show HN: PgTyped – Typesafe SQL in TypeScript and Postgres
#13Looks pretty cool. What I really want though is a library that let's me write plain SQL queries which are then mapped into nested objects in a smart way without too much manual work (I know Postgres can do JSON stuff, but the queries look pretty complicated for what little they actually do). Say `SELECT * FROM user LEFT JOIN post ON user.id = post.id` would be mapped to `[{userId: 1, name: renke1, posts: [{postId: 2,…
Will grouping fields by tables they belong to good enough? Or is there some different grouping logic you have in mind?
Re: Show HN: PgTyped – Typesafe SQL in TypeScript and Postgres
#14Looks a little like the Typescript equivalent of Xo ( https://github.com/xo/xo ) for Go. Especially with Go, getting help with some initial scaffolding can be a huge timesaver. I'm assuming it's a similar gain for Typescript.
A better equivalent in Go is https://github.com/kyleconroy/sqlc
Re: Show HN: PgTyped – Typesafe SQL in TypeScript and Postgres
#15Looks pretty cool. What I really want though is a library that let's me write plain SQL queries which are then mapped into nested objects in a smart way without too much manual work (I know Postgres can do JSON stuff, but the queries look pretty complicated for what little they actually do). Say `SELECT * FROM user LEFT JOIN post ON user.id = post.id` would be mapped to `[{userId: 1, name: renke1, posts: [{postId: 2,…
Re: Show HN: PgTyped – Typesafe SQL in TypeScript and Postgres
#16Looks pretty cool. What I really want though is a library that let's me write plain SQL queries which are then mapped into nested objects in a smart way without too much manual work (I know Postgres can do JSON stuff, but the queries look pretty complicated for what little they actually do). Say `SELECT * FROM user LEFT JOIN post ON user.id = post.id` would be mapped to `[{userId: 1, name: renke1, posts: [{postId: 2,…
Re: Show HN: PgTyped – Typesafe SQL in TypeScript and Postgres
#17Looks pretty cool. What I really want though is a library that let's me write plain SQL queries which are then mapped into nested objects in a smart way without too much manual work (I know Postgres can do JSON stuff, but the queries look pretty complicated for what little they actually do). Say `SELECT * FROM user LEFT JOIN post ON user.id = post.id` would be mapped to `[{userId: 1, name: renke1, posts: [{postId: 2,…
You should check objection.js[1] as I think it would get you what you describe and probably more. It is a relational query builder built on top of knex, which is a query builder. [1] https://vincit.github.io/objection.js/
Re: Show HN: PgTyped – Typesafe SQL in TypeScript and Postgres
#18Looks pretty cool. What I really want though is a library that let's me write plain SQL queries which are then mapped into nested objects in a smart way without too much manual work (I know Postgres can do JSON stuff, but the queries look pretty complicated for what little they actually do). Say `SELECT * FROM user LEFT JOIN post ON user.id = post.id` would be mapped to `[{userId: 1, name: renke1, posts: [{postId: 2,…