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

Column name error when filtering on parameters #962

Open
elpum4 opened this issue Nov 29, 2023 · 0 comments
Open

Column name error when filtering on parameters #962

elpum4 opened this issue Nov 29, 2023 · 0 comments

Comments

@elpum4
Copy link

elpum4 commented Nov 29, 2023

When I use a parameter to filter columns dynamically, the query executes correctly, and the database returns what I expected.

SELECT ST_AsBinary(geometry) AS geometry, id, collection_id, $1
            FROM table_features WHERE geometry && ST_MakeEnvelope(-63.7,-31.61,-63.72,-31.57,4326) 
AND collection_id = $2 with args [elevation my_uuid_collection_id]

My params config:

[[maps.params]]              
      name = "param"         
      token = "!param!"             
      type = "string"              
      sql = ",?"            
                                
      
[[providers.layers]]
      name = "table_features"  
      geometry_fieldname = "geometry"  
      geometry_type="GeometryCollection"
      id_fieldname = "id"
      sql = """SELECT ST_AsBinary(geometry) AS geometry, id,  collection_id !param!
            FROM table_features WHERE geometry && !BBOX! !COL!"""

When I used a parameter (for example !param!) in the query selct in the response I got something similar to this:

?column?:"elevation"

However, when I detail the column directly, the select is executed in the same way but I correctly obtain something similar to this:

 [[providers.layers]]
      name = "table_features"  
      geometry_fieldname = "geometry"  
      geometry_type="GeometryCollection"
      id_fieldname = "id"
      sql = """SELECT ST_AsBinary(geometry) AS geometry, id,  collection_id, elevation
            FROM table_features WHERE geometry && !BBOX! !COL!"""

elevation: value

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

1 participant