Skip to content

Escaping single quotes for BigQuery SQL target #5099

@syko

Description

@syko

What happened?

Bigquery escapes single quotes with a backslash \ but prql outputs two single quotes ''.

Otherwise it seems highly compatible with bigquery except for this one small thing.

PRQL input

prql target:sql.bigquery

from foo
select {
  a = "a'b"
}

SQL output

SELECT
  'a''b' AS a
FROM
  foo

-- Generated by PRQL compiler version:0.13.2 (https://prql-lang.org)

Expected SQL output

SELECT
  'a\'b' AS a
FROM
  foo

MVCE confirmation

  • Minimal example
  • New issue

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions