GlareDB / glaredb

GlareDB: An analytics DBMS for distributed data
https://glaredb.com
GNU Affero General Public License v3.0
535 stars 35 forks source link

string templating function #2925

Open universalmind303 opened 3 weeks ago

universalmind303 commented 3 weeks ago

Description

it'd be nice to have a string formatting function similar to format! in rust, or js's backtick syntax

example usage

// using inside the brackets
select format("hello my name is {first_name} {last_name}") from users;
// varargs
select format("hello my name is {} {}", first_name, last_name) from users;

// should work with other dtypes as well
select format("hello my name is {} {}\n today's date is {}", first_name, last_name, now()) from users;