Skip to content

snowflake: allow $$ delimited strings#572

Open
jmccarv wants to merge 1 commit intoxo:mainfrom
jmccarv:main
Open

snowflake: allow $$ delimited strings#572
jmccarv wants to merge 1 commit intoxo:mainfrom
jmccarv:main

Conversation

@jmccarv
Copy link
Copy Markdown

@jmccarv jmccarv commented May 5, 2026

Enable support for $$ delimited string literals in the snowflake driver.

This enables queries that would otherwise fail, like:

select $$Hello 'world';$$;

Enable support for $$ delimited string literals in the snowflake driver.

This enables queries that would otherwise fail, like:
select $$Hello 'world';$$;
@kenshaw
Copy link
Copy Markdown
Member

kenshaw commented May 5, 2026

@jmccarv Thanks for the contribution, I'll add to the next release. I was not aware that Snowflake support $$ strings. Though from a quick reading it doesn't seem to support the $tag$ ... $tag$ style that PostgreSQL does.

@jmccarv
Copy link
Copy Markdown
Author

jmccarv commented May 6, 2026

@kenshaw Thanks for the quick response!

You're right about it not supporting the $tag$ style. I didn't see a way to enable $$ strings without also enabling $tag$ in the code, but I suppose it shouldn't hurt to enable it anyway.

For giggles I tested $tag in snowflake with my patched version of usql:

=> select $xx$hi;$xx$;
error: snowflake: 1003: SQL compilation error:
syntax error line 1 at position 10 unexpected '$hi'.

I think that's nicer than the current error:

=> select $xx$hi;$xx$;
error: snowflake: 1003: SQL compilation error:
syntax error line 1 at position 10 unexpected '$hi'.
error: snowflake: 1003: SQL compilation error:
syntax error line 1 at position 0 unexpected '$xx'.

@kenshaw
Copy link
Copy Markdown
Member

kenshaw commented May 6, 2026

Yeah, I agree -- the goal of usql is not to work perfectly with every database, just to, ya know, provide something like an easier time for people who are used to psql to work with every other database. It wasn't a barrier for me merging the PR, just was pointing it out. Quick -- someone go file a ticket on the Snowflake projects to get proper PostgreSQL tag support! (heh)

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

Successfully merging this pull request may close these issues.

2 participants