Confused by Kysely
I'm using kysely for a project and I'm using it to create tables, however now that I create the tables with the columns and behaviors I want, I need to essentially do the same by writing the typescript type, which seems bad. Am I missing something or is that really how I'm expected to do this?
for example here is a users table
Now if I want this to have typescript types I have to write this as well
I would think that the library should be able to auto generate this type from all the information I give it when I create the damn table
4 Replies
🤢 absolutely vile
yes, you still need to define the types
typescript types are static, the sucky code from kysely's migration is run when the code runs, therefore it has no previous knowledge of the types you set, you'd need to have a script that can transform that info to actual types but the end result is the same, additional TS files for the db info
yikes
will switching to drizzle solve this issue?
I do not know tbh
for now I'm going to codegen and just deal with codegening after running migrations every time