[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › local‑first/Query

Query helpers, execution, and caching.

## Functions

| Function                                                                                                | Description                                                                                                                                                                                                                                                                                                                    |
| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [applyPatches](https://evolu.dev/docs/api-reference/common/local-first/Query/functions/applyPatches)                 | -                                                                                                                                                                                                                                                                                                                              |
| [evoluJsonArrayFrom](https://evolu.dev/docs/api-reference/common/local-first/Query/functions/evoluJsonArrayFrom)     | An improved Evolu version of Kysely's SQLite `jsonArrayFrom` helper.                                                                                                                                                                                                                                                           |
| [evoluJsonBuildObject](https://evolu.dev/docs/api-reference/common/local-first/Query/functions/evoluJsonBuildObject) | An improved Evolu version of Kysely's SQLite `jsonBuildObject` helper.                                                                                                                                                                                                                                                         |
| [evoluJsonObjectFrom](https://evolu.dev/docs/api-reference/common/local-first/Query/functions/evoluJsonObjectFrom)   | An improved Evolu version of Kysely's SQLite `jsonObjectFrom` helper.                                                                                                                                                                                                                                                          |
| [getJsonObjectArgs](https://evolu.dev/docs/api-reference/common/local-first/Query/functions/getJsonObjectArgs)       | -                                                                                                                                                                                                                                                                                                                              |
| [makePatches](https://evolu.dev/docs/api-reference/common/local-first/Query/functions/makePatches)                   | We detect only changes in the whole result and in-place edits. In the future, we will add more heuristics. We will probably not implement the Myers diff algorithm because it's faster to rerender all than to compute many detailed patches. We will only implement logic a developer would implement manually, if necessary. |
| [parseSqliteJsonArray](https://evolu.dev/docs/api-reference/common/local-first/Query/functions/parseSqliteJsonArray) | -                                                                                                                                                                                                                                                                                                                              |

## Interfaces

| Interface                                                                                      | Description |
| ---------------------------------------------------------------------------------------------- | ----------- |
| [ReplaceAllPatch](https://evolu.dev/docs/api-reference/common/local-first/Query/interfaces/ReplaceAllPatch) | -           |
| [ReplaceAtPatch](https://evolu.dev/docs/api-reference/common/local-first/Query/interfaces/ReplaceAtPatch)   | -           |
| [Row](https://evolu.dev/docs/api-reference/common/local-first/Query/interfaces/Row)                         | -           |

## Type Aliases

| Type Alias                                                                                                             | Description                                                                          |
| ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| [InferRow](https://evolu.dev/docs/api-reference/common/local-first/Query/type-aliases/InferRow)                                     | -                                                                                    |
| [KyselyNotNull](https://evolu.dev/docs/api-reference/common/local-first/Query/type-aliases/KyselyNotNull)                           | A type constant for marking a column as not null. Can be used with `$narrowPartial`. |
| [Patch](https://evolu.dev/docs/api-reference/common/local-first/Query/type-aliases/Patch)                                           | -                                                                                    |
| [Queries](https://evolu.dev/docs/api-reference/common/local-first/Query/type-aliases/Queries)                                       | -                                                                                    |
| [QueriesToQueryRows](https://evolu.dev/docs/api-reference/common/local-first/Query/type-aliases/QueriesToQueryRows)                 | -                                                                                    |
| [QueriesToQueryRowsPromises](https://evolu.dev/docs/api-reference/common/local-first/Query/type-aliases/QueriesToQueryRowsPromises) | -                                                                                    |
| [Query](https://evolu.dev/docs/api-reference/common/local-first/Query/type-aliases/Query)                                           | A type-safe SQL query.                                                               |
| [QueryRows](https://evolu.dev/docs/api-reference/common/local-first/Query/type-aliases/QueryRows)                                   | Rows returned by a query.                                                            |
| [RowsByQueryMap](https://evolu.dev/docs/api-reference/common/local-first/Query/type-aliases/RowsByQueryMap)                         | -                                                                                    |

## Variables

| Variable                                                                                                | Description                                                                                                                                  |
| ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| [kyselyJsonIdentifier](https://evolu.dev/docs/api-reference/common/local-first/Query/variables/kyselyJsonIdentifier) | A unique identifier prepended to JSON-encoded strings. This allows safe detection and parsing of only those columns that require JSON.parse. |
| [kyselySql](https://evolu.dev/docs/api-reference/common/local-first/Query/variables/kyselySql)                       | -                                                                                                                                            |