significantotter
Explore posts from serversAre JSON Arrays not supported for paramterization in the postgres driver?
and here's that helper function:
https://github.com/significantotter/kobold/blob/compendium/src/services/kobold/lib/kysely-json.ts
16 replies
Are JSON Arrays not supported for paramterization in the postgres driver?
Hm, I just found this PR from a year ago about a similar topic. I totally get your reasoning for not putting it into the main code, but I was wondering if you ever made progress on the generic serializer plugin? That kind of thing would be very helpful for my use case, to consolidate the serialization work by type and by input.
16 replies
Are JSON Arrays not supported for paramterization in the postgres driver?
I see! I'll update my kanel types and build a helper, I think. Maybe I can use a utility type like Kanel does for ids to make sure that it gets processed correctly before use
16 replies
Any thoughts on how to move data migrations from knex to kysely?
I've also been wondering about ways to manage brownfield project migration directories. We have a huuuuge problem with this at my work. Small database changes for individual tickets each get their migration file. Then get dumped into a massive directory of impossible to organize code files. And this is the environment where we have to support many databases in the field with very different code versions
9 replies
Any thoughts on how to move data migrations from knex to kysely?
I've never written a migration library, so I don't know the challenges involved, but I wonder why migrations tend to be predicated on an id value instead of a time/datestamp. I was thinking about that after seeing the kysely suggestion of the ISO date as the id value in the file. I feel like a standardized time value, and then maybe a way to init a migrator onto a time value for that environment, would be really useful for solving these kinds of issues (especially when tools like the old knex migrator cli would auto-generate ids for you)
9 replies
Any thoughts on how to move data migrations from knex to kysely?
Totally agree. It just leaves a bit of a sour taste in my mouth to have the best solution be "leave the legacy technology that we have a better implementation for in the app, unable to be improved, but unable to be upgraded or removed"
9 replies
Any thoughts on how to move data migrations from knex to kysely?
Oof, I don't know how much I like that solution, as useful as it might be for maintaining a long-lived project. I might recommend that if I was migrating my company over, since we have an ungodly amount of migration files built up over 7 years, as well as many customers on varying versions, necessitating that we maintain the ability to migrate from an arbitrary point.
Luckily my current project is a personal one, a discord bot that is in production, but only has 3 active databases, prod, staging, and dev. So I don't need to worry too much about database state in the wild. Which is why I was thinking those two options were best for me.
9 replies