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

```ts
function evoluJsonBuildObject<O>(
  obj: O,
): RawBuilder<
  Simplify<{
    [K in string | number | symbol]: O[K] extends Expression<V> ? V : never;
  }>
>;
```

Defined in: [packages/common/src/local-first/Query.ts:281](https://github.com/evoluhq/evolu/blob/49ea8ca499566aba270f8cb601e7f49aa62320f8/packages/common/src/local-first/Query.ts#L281)

An improved Evolu version of Kysely's SQLite `jsonBuildObject` helper.

Kysely's `ParseJSONResultsPlugin` heuristically parses any result string that
looks like JSON. Evolu instead prefixes JSON produced by these helpers with a
per-runtime identifier and only parses values carrying that prefix, avoiding
accidental parsing of ordinary string columns that merely happen to start
with `{` or `[`.

### Example

```ts
import {
  createQueryBuilder,
  evoluJsonBuildObject,
  id,
  kyselySql,
  NonEmptyTrimmedString100,
} from "@evolu/common";

const Schema = {
  person: {
    id: id("Person"),
    firstName: NonEmptyTrimmedString100,
    lastName: NonEmptyTrimmedString100,
  },
};
const createQuery = createQueryBuilder(Schema);
const people = createQuery((db) =>
  db
    .selectFrom("person")
    .select("person.id")
    .select((eb) => [
      evoluJsonBuildObject({
        first: eb.ref("firstName"),
        last: eb.ref("lastName"),
        full: kyselySql<string>`${eb.ref("firstName")} || ' ' || ${eb.ref(
          "lastName",
        )}`,
      }).as("name"),
    ]),
);

expectTypeOf<typeof people.Row.name>().toEqualTypeOf<{
  first: NonEmptyTrimmedString100 | null;
  last: NonEmptyTrimmedString100 | null;
  full: string;
}>();
```