-
-
Notifications
You must be signed in to change notification settings - Fork 198
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
PostGIS driver needs to handle nil tag values #67
Comments
So, this bug is turning out to be a bit deeper then it first appears. The problem isn't jsut the nil, but also other unknow types. That the provider can stuff into the tags map. So, the fix really need to be at the provider level. Basically, the provider need to convert any custom types it may expect into types that can be encoded in the basic type. Most likely this will be converting it to a string. I should probally error if there are tag values that are not supported when the feature is being created, and not when it's being encoded. |
@gdey This still might be two different issues. The "nil" bug has to do when a row does not have a value. This was showing up when custom SQL was being used that returned the The second issue is what you're describing where custom types need to be mapped to a supported format. I think a string would work. |
With the previous configuration I was using this custom SQL without issues: |
@kalxas I'm about to shift into this bug. Thanks for providing the old config. |
@gdey I have a solution that has Bonn rendering again. Essentially if we add a check for "nil" in our feature tag switch here and essentially do nothing, the key will be encoded but the value will be nil. For example: for i, v := range valueMap {
switch tv := val.(type) {
default:
return tags, fmt.Errorf("Value (%[1]v) of type (%[1]T) for key (%[2]v) is not supported.", tv, key)
case nil:
// nil values can be ignored. the key will still be encoded.
case string:
... I do like the idea of keeping the key there even though the value is |
I did some more research and it looks like currently the spec does not support |
The following error is being thrown when a column is nil.
The text was updated successfully, but these errors were encountered: