Open blaketeres opened 1 month ago
I wonder if this is related to https://github.com/samuelcolvin/buildpg/pull/38 and https://github.com/developmentseed/tifeatures/pull/60
Hello @vincentsarago is there any chance I can help provide a solution to this issue? Do we need to fork buildpg
?
sure @blaketeres I'm head down on project work and other open source projects so my time is pretty limited right now but if you know a path to resolve this please start a PR 🙏
Issue
TiPg
responds with a 500 error if any Postgresql keywords are used as column names. I need to support generic datasets without modifying the column names. I have no control over the column names.I did some debugging, and this comes down to how
buildpg
generates itsSELECT
statements without adding double-quotes around column names. Seems like it would be an easy fix inbuildpg
, but that repo appears unmaintained.Steps to reproduce
Build test table
Set env vars
Set environment variables to point to your local database. Also set the following
Run
TiPg
and make requestBy placing a breakpoint in the linked location, you can see the generated query in variable
c
here https://github.com/developmentseed/tipg/blob/main/tipg/collections.py#L647 does not have quotes around column names. I believe that double quoting column names will fix this problem.Thanks in advance for looking at this!