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

```ts
type CreateQuery<S> = <R>(queryCallback: (db: Pick<Kysely.Kysely<{ [Table in keyof S]: { readonly [Column in keyof S[Table]]: Column extends "id" ? InferOutput<(...)[(...)]> : InferOutput<(...)> | null } & SystemColumns } & {
  evolu_history: {
     column: string;
     id: IdBytes;
     table: keyof S;
     timestamp: TimestampBytes;
     value: SqliteValue;
  };
  evolu_message_quarantine: {
     column: string;
     id: IdBytes;
     table: string;
     timestamp: TimestampBytes;
     value: SqliteValue;
  };
}>, "selectFrom" | "fn" | "with" | "withRecursive">) => Kysely.SelectQueryBuilder<any, any, R>, options?: SqliteQueryOptions) => Query<S, Simplify<R>>;
```

Defined in: [packages/common/src/local-first/Schema.ts:122](https://github.com/evoluhq/evolu/blob/e7144e2bbe9069362b62dec1b64a8aa922b8f1b0/packages/common/src/local-first/Schema.ts#L122)