# Kysoql (/docs/core/reference/api/classes/Kysoql)



[@kysoql/core](/docs/core/reference/api) / Kysoql

Configured query creator for building, compiling, and optionally executing
typed SOQL.

## Extends [#extends]

* [`QueryCreator`](/docs/core/reference/api/classes/QueryCreator)\<`DB`>

## Type Parameters [#type-parameters]

| Type Parameter |
| -------------- |
| `DB`           |

## Constructors [#constructors]

<a id="api-constructor" />

### Constructor [#constructor]

```ts
new Kysoql<DB>(configOrQueryCompiler?): Kysoql<DB>;
```

Creates a query entry point from compiler, executor, schema metadata, and plugin configuration.

#### Parameters [#parameters]

| Parameter               | Type                                                                                                                                                      |
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `configOrQueryCompiler` | \| [`QueryCompiler`](/docs/core/reference/api/interfaces/QueryCompiler) \| [`QueryCreatorConfig`](/docs/core/reference/api/interfaces/QueryCreatorConfig) |

#### Returns [#returns]

`Kysoql`\<`DB`>

#### Inherited from [#inherited-from]

[`QueryCreator`](/docs/core/reference/api/classes/QueryCreator).[`constructor`](/docs/core/reference/api/classes/QueryCreator#constructor)

## Methods [#methods]

<a id="api-withplugin" />

### withPlugin() [#withplugin]

```ts
withPlugin(plugin): this;
```

Returns a `QueryCreator` with the plugin appended to the execution pipeline.

#### Parameters [#parameters-1]

| Parameter | Type                                                               |
| --------- | ------------------------------------------------------------------ |
| `plugin`  | [`KysoqlPlugin`](/docs/core/reference/api/interfaces/KysoqlPlugin) |

#### Returns [#returns-1]

`this`

#### Inherited from [#inherited-from-1]

[`QueryCreator`](/docs/core/reference/api/classes/QueryCreator).[`withPlugin`](/docs/core/reference/api/classes/QueryCreator#withplugin)

***

<a id="api-withoutplugins" />

### withoutPlugins() [#withoutplugins]

```ts
withoutPlugins(): this;
```

Returns a `QueryCreator` with all plugins removed.

#### Returns [#returns-2]

`this`

#### Inherited from [#inherited-from-2]

[`QueryCreator`](/docs/core/reference/api/classes/QueryCreator).[`withoutPlugins`](/docs/core/reference/api/classes/QueryCreator#withoutplugins)

***

<a id="api-selectfrom" />

### selectFrom() [#selectfrom]

```ts
selectFrom<TB>(from): SelectQueryBuilder<DB, TB, unknown, "plain">;
```

Starts a typed query for the specified Salesforce object.

#### Type Parameters [#type-parameters-1]

| Type Parameter          |
| ----------------------- |
| `TB` *extends* `string` |

#### Parameters [#parameters-2]

| Parameter | Type |
| --------- | ---- |
| `from`    | `TB` |

#### Returns [#returns-3]

[`SelectQueryBuilder`](/docs/core/reference/api/interfaces/SelectQueryBuilder)\<`DB`, `TB`, `unknown`, `"plain"`>

#### Inherited from [#inherited-from-3]

[`QueryCreator`](/docs/core/reference/api/classes/QueryCreator).[`selectFrom`](/docs/core/reference/api/classes/QueryCreator#selectfrom)

***

<a id="api-executequery" />

### executeQuery() [#executequery]

Executes a supplied operation tree through this creator's compiler, plugins, and executor.

#### Call Signature [#call-signature]

```ts
executeQuery(compiledQuery, options?): Promise<number>;
```

Executes a supplied operation tree through this creator's compiler, plugins, and executor.

##### Parameters [#parameters-3]

| Parameter       | Type                                                                                 |
| --------------- | ------------------------------------------------------------------------------------ |
| `compiledQuery` | [`CompiledQuery`](/docs/core/reference/api/interfaces/CompiledQuery)\<`number`>      |
| `options?`      | [`AbortableQueryOptions`](/docs/core/reference/api/interfaces/AbortableQueryOptions) |

##### Returns [#returns-4]

`Promise`\<`number`>

##### Inherited from [#inherited-from-4]

[`QueryCreator`](/docs/core/reference/api/classes/QueryCreator).[`executeQuery`](/docs/core/reference/api/classes/QueryCreator#executequery)

#### Call Signature [#call-signature-1]

```ts
executeQuery<O>(compiledQuery, options?): Promise<readonly O[]>;
```

Executes a supplied operation tree through this creator's compiler, plugins, and executor.

##### Type Parameters [#type-parameters-2]

| Type Parameter |
| -------------- |
| `O`            |

##### Parameters [#parameters-4]

| Parameter       | Type                                                                                 |
| --------------- | ------------------------------------------------------------------------------------ |
| `compiledQuery` | [`CompiledQuery`](/docs/core/reference/api/interfaces/CompiledQuery)\<`O`>           |
| `options?`      | [`AbortableQueryOptions`](/docs/core/reference/api/interfaces/AbortableQueryOptions) |

##### Returns [#returns-5]

`Promise`\<readonly `O`\[]>

##### Inherited from [#inherited-from-5]

[`QueryCreator`](/docs/core/reference/api/classes/QueryCreator).[`executeQuery`](/docs/core/reference/api/classes/QueryCreator#executequery)
