---
sidebar:
  label: roboto.query.roboql_literal
  order: 4
title: roboto.query.roboql_literal
---
## Module Contents

### as_roboql_string_literal()

```python
def roboto.query.roboql_literal.as_roboql_string_literal(value: str) -> str
```

`from roboto.query.roboql_literal import as_roboql_string_literal`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/query/roboql_literal.py#L8-L39)

Render `value` as a double-quoted RoboQL string literal.

A double-quoted RoboQL literal has exactly two escape sequences, `\"` and `\\`. It has no `\n`, `\t`, or `\uXXXX` form, so every other character is emitted verbatim, non-ASCII included. `json.dumps` cannot stand in for this function: by default it renders non-ASCII characters as `\uXXXX`, which RoboQL rejects.

A double-quoted literal cannot hold a codepoint from U+0000 through U+001F, such as a tab or a newline. This function emits those characters unchanged rather than escaping or stripping them, so a value containing one yields a query that fails to parse.

**Parameters**

- **value** (`str`): Unquoted string to embed in a query, such as a session, topic, or file name.

**Returns**

- `str`: `value` wrapped in double quotes, with backslashes and double quotes escaped.

**Usage**

Escape a double quote:

```python
as_roboql_string_literal('a"b')
# '"a\\"b"'
```

Keep a non-ASCII character as it is:

```python
as_roboql_string_literal("café")
# '"café"'
```
