It is a query builder (not an ORM), that (ab)-uses the Typescript type system to give you full type safety, intellisense, autocomplete etc.
Crucially it doesn’t require any build/compile step for your queries which is fantastic.
It is a query builder (not an ORM), that (ab)-uses the Typescript type system to give you full type safety, intellisense, autocomplete etc.
Crucially it doesn’t require any build/compile step for your queries which is fantastic.
(How does the IDE do the autocomplete on strings? Will the compiler also catch "bad strings"?)
Otherwise it looks much like jOOQ but without the "jOOQ generator" (which adds most of the type safety).
I expect those `"a" | "b" | "c"` to be expressed as an enum, not strings and |s.
But hey, why not!
The more distinctive features in TypeScript would be what you can to with keyof/typeof, indexed access types, conditional types and especially mapped types.
Out of curiosity, what do you mean by dynamically? Isn't that just a case statement, or am I misunderstanding?
You can do this in Python too..?
there is kysely-codegen which generates types based on the actual database schema.