Knex/MySQL snake_case to camelCase, typecasting tinyint to boolean #3516
markuslerner
started this conversation in
Ideas
Replies: 1 comment
-
I had similar issue. Thanks, you saved me a lot of time.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was struggling for a long time to find a way to automatically convert snake_case MySQL database fields to camelCase and typecasting tinyint to boolean.
I finally found this solution, which works very well for me. I thought this might be useful to be included in the docs. I guess, it's quite a common case, but unfortunately I didn't find anything there yet. What you do you'll think?
Here's my custom src/mysql.ts:
Beta Was this translation helpful? Give feedback.
All reactions