camelCase plugin with a strangely named column
We have a column named
cl_companyID
(I'm as confused as you) and I have issues with the camelCase plugin because it thinks the name is cl_company_id
.
Is there a way around this, without renaming the column?
I was thinking maybe we could add support with some kind of lookup table with weird names for the plugin to respect.Solution:Jump to solution
Something like
```ts
class MyCamelCasePlugin extends CamelCasePlugin {
protected override snakeCase(str: string): string {...
7 Replies
You can extends the plugin and override the
snakeCase
and camelCase
methods.We also have one:
cl_LID_c
🥲
"I like snake case but I also like pascal case but also snake case is good"Solution
Something like
Thanks, very helpful!
and I only have information about the column name here?
not the table
Yeah. Figuring out the table is super hard/impossible
Wouldn't be surprised if I found the same column named in different variations. Like
company_id
and company_ID
for different tables
ok
hmm
Maybe I should first make sure we don't have that issue
Thank you @koskimas
Keep up the great work with Kysely ❤️got it working btw 🚀
that's it