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

> The ToSqlOptions interface of @salmonui/query-builder/sql.

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

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

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 ToSqlOptions {
    readonly named?: boolean;
    readonly inline?: boolean;
    readonly quoteIdentifier?: boolean | ((name: string) => string);
    readonly dialect?: SqlDialect;
    readonly operators?: Readonly<Record<string, (ctx: SqlOperatorContext) => string>>;
    readonly pathSeparator?: string;
    readonly paramPrefix?: string;
}
```

Members (7):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `named` | `readonly named?: boolean;` | optional | Named placeholders (`:p1`, `@p1` on mssql) with `params` as a record. Default false. |
| `inline` | `readonly inline?: boolean;` | optional | Escaped literals instead of placeholders (`params` is empty). Default false. |
| `quoteIdentifier` | `readonly quoteIdentifier?: boolean \| ((name: string) => string);` | optional | Quotes identifiers for the dialect (each path segment), or quotes with a function. Default false. |
| `dialect` | `readonly dialect?: SqlDialect;` | optional | Placeholder and quoting style. Default `'ansi'` (`?`, `"x"`); postgres `$1`, mssql `@p1` and `[x]`, mysql `` `x` ``. |
| `operators` | `readonly operators?: Readonly<Record<string, (ctx: SqlOperatorContext) => string>>;` | optional | SQL of custom operators, keyed by operator name; they also override built-ins. |
| `pathSeparator` | `readonly pathSeparator?: string;` | optional | Separator of nested field paths. Default `'.'`. |
| `paramPrefix` | `readonly paramPrefix?: string;` | optional | Prefix of named parameters. Default `'p'`. |
