Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Name collisions on the Table object #55

Closed
panta82 opened this issue Apr 29, 2013 · 1 comment
Closed

Name collisions on the Table object #55

panta82 opened this issue Apr 29, 2013 · 1 comment

Comments

@panta82
Copy link

panta82 commented Apr 29, 2013

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.

@caseywebdev
Copy link
Collaborator

Closing in favor of #36.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants