You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to create table definition using node-sql, I get "Table xxx already has column or property by the name of count". Of course, the conflict is with method count(). None of the other methods seem likely to collide with column names, but count is rather problematic, as it is a rather common column name.
Is there an 'official' strategy for avoiding this collision? Maybe some kind of fudge, where I define my column as "$count" or something, and it gets converted to "count", when generating SQL?
I was also considering using UPPERCASE or TitleCase column names, but that might create a problems with PostgreSQL, if names get quoted (as I presume they will be).
For now, I think I'll fork the lib locally and rename count to doCount or something, while hoping for a more elegant solution I have missed.
Thanks.
UPDATE:
Damn, I just went through older posts and noticed a duplicate by johndyoung.
Disregard.
The text was updated successfully, but these errors were encountered:
I have a table with column "count".
When trying to create table definition using node-sql, I get "Table xxx already has column or property by the name of count". Of course, the conflict is with method count(). None of the other methods seem likely to collide with column names, but count is rather problematic, as it is a rather common column name.
Is there an 'official' strategy for avoiding this collision? Maybe some kind of fudge, where I define my column as "$count" or something, and it gets converted to "count", when generating SQL?
I was also considering using UPPERCASE or TitleCase column names, but that might create a problems with PostgreSQL, if names get quoted (as I presume they will be).
For now, I think I'll fork the lib locally and rename count to doCount or something, while hoping for a more elegant solution I have missed.
Thanks.
UPDATE:
Damn, I just went through older posts and noticed a duplicate by johndyoung.
Disregard.
The text was updated successfully, but these errors were encountered: