denodb icon indicating copy to clipboard operation
denodb copied to clipboard

table column names being changed?

Open ralyodio opened this issue 2 years ago • 1 comments

I have a table column hashedPassword and I get this error:

[uncaught application error]: SqliteError - table users has no column named hashed_password

Does it convert camel case to underscores? Is there a way to disable this behavior?

ralyodio avatar Oct 30 '21 00:10 ralyodio

Hello, sorry for your issue. Yes, it does. This is because certain parts of the program expect tables to be formatted in a certain way. This is a design flaw, but it's hard to fix because it would require every LOC to be reverified to make sure it no longer makes those expectations.

A pull request, #320, has been opened to convert snake case to camel case (these aforementioned expectations actually only apply to camel case!). This will fix your issue, but users using snake_case will encounter issues when they see their snake_case converted to camelCase!

Is there a way to disable this behavior?

Not native, but a modification is trivial. Simply fork this repository, modify https://github.com/eveningkid/denodb/blob/master/lib/translators/sql-translator.ts to remove calls to snakeCase(), and update your imports to point to https://raw.githubusercontent.com/ralyodio/denodb/master/mod.ts. NOTE: THIS IS UNDEFINED BEHAVIOR, ISSUES AS A RESULT OF THIS CHANGE ARE YOUR RESPONSIBILITY

boehs avatar Jan 09 '22 16:01 boehs