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

How to escape a colon ':' character in a core module query? #30

Open
rjaros opened this issue Sep 17, 2018 · 1 comment
Open

How to escape a colon ':' character in a core module query? #30

rjaros opened this issue Sep 17, 2018 · 1 comment

Comments

@rjaros
Copy link

rjaros commented Sep 17, 2018

Is there any possibility to use a colon ':' character in a query? It seems to be always used as a query parameter.
For instance there is no way to use a string 'HH:mm' or PostgreSQL casting '3'::int.

@thinkslynk
Copy link

Super old comment on what looks to be an unmaintained project, but just in case anyone else runs into this, I got around this issue by passing in the date format as a parameter.

db.update(
    "UPDATE my_table SET my_date=to_timestamp(:my_date, :format) at time zone 'Etc/UTC'",
    mapOf(
                "format" to "YYYY-MM-DD HH24:MI:SS",
                "my_date" to setTo
    )
)

Not sure if there's an official way to get around this, but you can always pass in chunks like that as a work around.

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

2 participants