-
Notifications
You must be signed in to change notification settings - Fork 217
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
TypeError: Invalid column syntax: "source-layer". #494
Comments
This is by design, see the API: http://vitaly-t.github.io/pg-promise/helpers.Column.html
|
So there is no way to use helpers with this kind of columns then? |
Are you using string presentation for your source property names? If not, then what is your source property name? |
I've |
I understand that, I asked about the name of the property in the source object that contains the value. |
Yes, I'm using string presentation for property names. |
If property names in your source object do not satisfy the open-variable syntax for JavaScript, then type Column cannot directly map to such properties. This is because the whole idea of the What you are doing is unusual, and can only happen when trying to work-around some legacy bad written database. New databases should never use names like If you still have such awkward columns to deal with, you would have to provide a value override, i.e. your column would be: {name: 'column-layer', prop: 'unused', init: c => c.source['column-layer']} i.e. you'd have to provide any Just shorter alternative: {name: 'column-layer', prop: '_', init: c => c.source['column-layer']} |
Thanks for the reply! That makes things clear. |
Related issue, with explanation - #937 |
It seems that
pg-promise
doesn't support column names with-
sign.Expected behavior
Actual behavior
Steps to reproduce
Environment
P.S. I've tried different modifiers with
but it didn't succeeded.
The text was updated successfully, but these errors were encountered: