Remix.run Logo
barishnamazov 5 hours ago

How is this different than kysely + kysely-codegen (or hand-made types)?

n_e 5 hours ago | parent | next [-]

Kysely is a query builder: you build queries by calling javascript functions, while with pg-typesafe you write SQL directly.

I've used kysely before creating pg-typesafe, and came to the conclusion that writing SQL directly is more convenient.

A query builder works well for simple cases (db.selectFrom("t").where("id","=","1") looks a lot like the equivalent SQL), however, for more complicated queries it all falls apart. I often had to look at the docs to find how to translate some predicate from SQL to the required idiom. Also, I don't think kysely can automatically infer the return type of PostgreSQL functions, while pg-typed does (it asks PostgreSQL for it).

ZiiS 5 hours ago | parent | prev [-]

It only changes the types; not the code.