Closed carlpaten closed 5 months ago
Kysely doesn't detect anything. It only operates on the types you provide it. Just provide the correct type for that column in your table interface and it already works.
If you're using some type generator, note that they are all third party libraries and we don't maintain or develop them. We have no control over their features.
Coming from a Hasura background, I'm used to being able to define enum tables.
An enum table is a table whose rows are understood to represent values in an enum type. Example:
color
with three rows having primary key"red"
,"green"
and"blue"
.teacup
whose rowcolor
has a foreign key to the tablecolor
.color
table somewhere (maybe inkysely-codegen
config).Then I'd like Kysely to recognize that
db.selectFrom("teacup").select("color")
has type("red" | "green" | "blue")[]
.This is the single feature I find myself missing from Hasura.