Strings

Strings in PRQL can use either single or double quotes:

PRQL

from my_table
select x = "hello world"

SQL

SELECT
  'hello world' AS x
FROM
  my_table

PRQL

from my_table
select x = 'hello world'

SQL

SELECT
  'hello world' AS x
FROM
  my_table

To quote a string containing quotes, either use the “other” type of quote, or use three-or-more quotes, and close with the same number.

PRQL

from my_table
select x = '"hello world"'

SQL

SELECT
  '"hello world"' AS x
FROM
  my_table

PRQL

from my_table
select x = """I said "hello world"!"""

SQL

SELECT
  'I said "hello world"!' AS x
FROM
  my_table

PRQL

from my_table
select x = """""I said """hello world"""!"""""

SQL

SELECT
  'I said """hello world"""!' AS x
FROM
  my_table

F-Strings and S-Strings

These special case strings can be used to:

F-Strings - Build up a new string from a set of columns or values

S-Strings - Insert SQL statements directly into the query. Use when PRQL doesn’t have an equivalent facility.

Note

Currently PRQL does not adjust escape characters.

Warning

Currently PRQL allows multiline strings with either a single character or multiple character quotes. This may change for strings using a single character quote in future versions.