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

sql: string interpolation #84029

Closed
shermanCRL opened this issue Jul 7, 2022 · 3 comments
Closed

sql: string interpolation #84029

shermanCRL opened this issue Jul 7, 2022 · 3 comments
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)

Comments

@shermanCRL
Copy link
Contributor

shermanCRL commented Jul 7, 2022

Is your feature request related to a problem? Please describe.
It would be elegant for have a string interpolation function.

Describe the solution you'd like
Something similar to sprintf format strings or placeholders in prepared statements. MS SQL has a function called FORMATMESSAGE.

Describe alternatives you've considered
We already have CONCAT, which would be the likely substitute.

Additional context
It would be helpful for this planned use case:

Jira issue: CRDB-17419

@shermanCRL shermanCRL added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) labels Jul 7, 2022
@rafiss
Copy link
Collaborator

rafiss commented Jul 7, 2022

Postgres does this using format (https://www.postgresql.org/docs/current/functions-string.html), which we have tracked here: #68330

@rafiss
Copy link
Collaborator

rafiss commented Jul 7, 2022

I'll close this in favor of the linked issue

@rafiss rafiss closed this as completed Jul 7, 2022
@shermanCRL
Copy link
Contributor Author

Addressed by:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Projects
None yet
Development

No branches or pull requests

2 participants