You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by theelderbeever January 25, 2022
Version info:
piccolo = "0.64.0"
I am attempting to use some of the query building tools to generate custom complex queries that aren't directly possible through the ORM at the moment. During this I ran into a case where Attempting to run the str(MyTable.insert(MyTable())) doesn't seem to work with uuid or date columns as they aren't wrapped in ''.
I believe the following minimal example should work
It is contrived but the query fails with a SQL error midway through the UUID string that gets output. The uuid value should be wrapped in '' I believe.
Example Error
PostgresSyntaxError: syntaxerroratornear"fa"
This seems to come down to how the Table.querystring is formed. The values don't get wrapped and the datetime doesn't replace the ' ' with a T. Relevant Code
Ultimate goal here is that I am writing some custom on conflict statements and was taking inspiration from the Insert.postgres_querystrings method to construct them when I ran into this.
The text was updated successfully, but these errors were encountered:
Discussed in #403
Originally posted by theelderbeever January 25, 2022
Version info:
piccolo = "0.64.0"
I am attempting to use some of the query building tools to generate custom complex queries that aren't directly possible through the ORM at the moment. During this I ran into a case where Attempting to run the
str(MyTable.insert(MyTable()))
doesn't seem to work with uuid or date columns as they aren't wrapped in''
.I believe the following minimal example should work
It is contrived but the query fails with a SQL error midway through the UUID string that gets output. The uuid value should be wrapped in
''
I believe.Example Error
This seems to come down to how the
Table.querystring
is formed. The values don't get wrapped and the datetime doesn't replace the' '
with aT
. Relevant CodeUltimate goal here is that I am writing some custom on conflict statements and was taking inspiration from the
Insert.postgres_querystrings
method to construct them when I ran into this.The text was updated successfully, but these errors were encountered: