Boolean parameters not working

Jeff Turner January 28, 2016

I guess this is a bug report. When a database table has column of type boolean (or anything non-String), the :param mechanism fails. In a macro I set the :param's value to 'true', and I just get:

org.postgresql.util.PSQLException: ERROR: operator does not exist: boolean = character varying

Evidently the text 'true' is being wrapped in quotes or typecast to a varchar.

 

Otherwise, thanks for an excellent plugin!

1 answer

0 votes
Felix Grund (Scandio)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 29, 2016

Hi Jeff,

Thank you for your interest in PocketQuery! You're right. Booleans are not actually passed as booleans to the query, but as strings. I tested this locally and found that MySQL seems not to complain about it but translates the values somehow vice-versa. I don't know if I'd call this a but or simply a missing feature. Anyhow, we already have the Patameter Types configuration for queries. I added another type Boolean and you should now be able to mark your parameter as boolean by writing paramName=Boolean in the input Parameter Types next to your query. I created a temporary version for you here. Could you test if this works for you? If so, I'll plan to release this feature with PocketQuery 2.1 in February.

Regards, Felix (Scandio)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events