# QueryRule (@salmonui/query-builder/sql)

> The QueryRule interface of @salmonui/query-builder/sql: One condition: field operator value.

Canonical: https://salmonui.dev/docs/reference/query-builder/sql/QueryRule

```ts
import type { QueryRule } from '@salmonui/query-builder/sql';
```

Also exported from `@salmonui/query-builder`, `@salmonui/query-builder/mongo`.

Entry index: https://salmonui.dev/docs/reference/query-builder/sql (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/query-builder/sql.md).

## Reference

Kind: interface

```ts
interface QueryRule {
    readonly id?: string;
    readonly field: string;
    readonly operator: string;
    readonly value?: Json;
    readonly matchCase?: boolean;
    readonly ignoreAccents?: boolean;
    readonly locked?: boolean;
}
```

One condition: `field operator value`.

Members (7):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `id` | `readonly id?: string;` | optional | Stable node id; assigned by QueryBuilder when missing. |
| `field` | `readonly field: string;` |  | Field path (`address.city` with the default `pathSeparator`). |
| `operator` | `readonly operator: string;` |  | A Data Grid filter operator name (`equal`, `contains`, `between`, ...) or a custom operator. |
| `value` | `readonly value?: Json;` | optional | `between`: `[from, to]`; `in` / `notIn`: an array; value-less operators omit it. |
| `matchCase` | `readonly matchCase?: boolean;` | optional |  |
| `ignoreAccents` | `readonly ignoreAccents?: boolean;` | optional |  |
| `locked` | `readonly locked?: boolean;` | optional | A locked rule cannot be edited, moved or deleted from the UI. |
