# SqlRunner.query() method · @imqueue/pg-prisma

Source: https://imqueue.org/api/pg-prisma/latest/pg-prisma.sqlrunner.query/
Published: 2026-08-28
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/pg-prisma 2.0.0 — generated reference, not hand-written

Run a statement, on the open transaction if there is one.

**Signature:**

```typescript
query<Row = unknown>(sql: string | SqlFragment, values?: readonly unknown[]): Promise<Row[]>;
```

## Parameters


| Parameter | Type | Description |
| --- | --- | --- |
| sql | string \| [SqlFragment](https://imqueue.org/api/pg-prisma/latest/pg-prisma.sqlfragment/) | The statement, as text or as a fragment. |
| values | readonly unknown\[\] | _(Optional)_ Bound parameters, where the statement is text. |


**Returns:**

Promise<Row\[\]>

The result rows.

## Remarks

The rows, not the driver's envelope: a raw read is asked for its rows, and every call site would otherwise reach through `.rows` to get them.

A fragment carries its own values, so it is passed on its own; text takes them as a second argument, the way the driver does.

