# query.E() function · @imqueue/pg-sequelize

Source: https://imqueue.org/api/pg-sequelize/latest/pg-sequelize.query.e/
Published: 2026-08-01
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/pg-sequelize 4.2.0 — generated reference, not hand-written

Renders a value as a SQL constant: a number as itself, a string quoted and escaped, anything else as `NULL`.

**Signature:**

```typescript
export function E(input: any): string | number;
```

## Parameters


| Parameter | Type | Description |
| --- | --- | --- |
| input | any | Value to render. |


**Returns:**

string \| number

The number itself, a quoted and escaped string, or `NULL`.

## Remarks

The companion to [query.L()](https://imqueue.org/api/pg-sequelize/latest/pg-sequelize.query.l/) and the only safe way to get a runtime value into a literal. Single quotes inside a string are doubled, which is what Postgres requires — and what this did not do: a value of `O'Brien` came out as a broken string constant, and a value chosen deliberately came out as SQL. The same path escapes a dynamic view's parameters, so a view selected with caller-supplied `viewParams` was open the same way.

Only numbers and strings render as values. Booleans, dates, objects, `null` and `undefined` all become `NULL` — so format a date as a string before passing it, and do not reach for this to render a boolean.

