---
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-L35)

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

RoboQL's grammar admits exactly two escape sequences inside a double-quoted literal, `\"` and `\\`. There is no `\n`, `\t`, or `\uXXXX` form, so every other character is emitted verbatim, non-ASCII included. `json.dumps` is therefore not a substitute: it defaults to `ensure_ascii=True`, which renders non-ASCII characters as `\uXXXX`, a form RoboQL rejects.

No codepoint from U+0000 through U+001F, such as a tab or a newline, can be carried by a double-quoted literal. Those characters are emitted unchanged rather than escaped or stripped, 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**

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