-
Notifications
You must be signed in to change notification settings - Fork 122
Allow column names to contain any character #249
base: develop
Are you sure you want to change the base?
Conversation
In regards to issues zendframework#8 and zendframework#208 I've created a regex that will allow user to use any character as column name. It will also keep functionality of allowing user to enter 'column as alias' as column name. I've made an assumption that no one in right mind will have spaces on beginning or end of column name so they are ignored by regex.
@metalinspired unit tests are missing for this PR, can you add it? Testing is very important here because you proposed a regex and we need to validate all the possible cases (or at least the most common). Thanks! |
@ezimuel I wouldn't know where to begin. The regex if written so that all existing tests are passing and as you can see I failed three times before succeeding. If the regex fails it will throw an exception and worse that can happen is malformed SQL syntax which was original problem to begin with. Personally I think that some of the undocumented behavior for column names, which I mentioned in #208, should be removed thus eliminating need for this patch. |
@metalinspired I'll try to work on this PR adding the unit test, thanks anyway for your contribution! |
@ezimuel Glad I could help |
Hey @froschdesign @ezimuel - May we have any update for this? We need this in one of our products. So it'll be a great help if this PR gets merged. |
@BJGajjar Still we need unit test for these changes. If you can provide these it will speed up the release. Thanks. |
@metalinspired - It seems like there is some issue here.
|
This repository has been moved to laminas/laminas-db. If you feel that this patch is still relevant, please re-open against that repository, and reference this issue. To re-open, we suggest the following workflow:
|
This repository has been closed and moved to laminas/laminas-db; a new issue has been opened at laminas/laminas-db#70. |
In regards to issues #8 and #208 I've created a regex that will allow user to use any character as column name.
It will also keep functionality of allowing user to enter 'column as alias' as column name.
I've made an assumption that no one in right mind will have spaces on beginning or end of column name so they are ignored by regex.